Stephan Müller
43490e8046
crypto: drbg - in-place cipher operation for CTR
...
The cipher implementations of the kernel crypto API favor in-place
cipher operations. Thus, switch the CTR cipher operation in the DRBG to
perform in-place operations. This is implemented by using the output
buffer as input buffer and zeroizing it before the cipher operation to
implement a CTR encryption of a NULL buffer.
The speed improvement is quite visibile with the following comparison
using the LRNG implementation.
Without the patch set:
16 bytes| 12.267661 MB/s| 61338304 bytes | 5000000213 ns
32 bytes| 23.603770 MB/s| 118018848 bytes | 5000000073 ns
64 bytes| 46.732262 MB/s| 233661312 bytes | 5000000241 ns
128 bytes| 90.038042 MB/s| 450190208 bytes | 5000000244 ns
256 bytes| 160.399616 MB/s| 801998080 bytes | 5000000393 ns
512 bytes| 259.878400 MB/s| 1299392000 bytes | 5000001675 ns
1024 bytes| 386.050662 MB/s| 1930253312 bytes | 5000001661 ns
2048 bytes| 493.641728 MB/s| 2468208640 bytes | 5000001598 ns
4096 bytes| 581.835981 MB/s| 2909179904 bytes | 5000003426 ns
With the patch set:
16 bytes | 17.051142 MB/s | 85255712 bytes | 5000000854 ns
32 bytes | 32.695898 MB/s | 163479488 bytes | 5000000544 ns
64 bytes | 64.490739 MB/s | 322453696 bytes | 5000000954 ns
128 bytes | 123.285043 MB/s | 616425216 bytes | 5000000201 ns
256 bytes | 233.434573 MB/s | 1167172864 bytes | 5000000573 ns
512 bytes | 384.405197 MB/s | 1922025984 bytes | 5000000671 ns
1024 bytes | 566.313370 MB/s | 2831566848 bytes | 5000001080 ns
2048 bytes | 744.518042 MB/s | 3722590208 bytes | 5000000926 ns
4096 bytes | 867.501670 MB/s | 4337508352 bytes | 5000002181 ns
Signed-off-by: Stephan Mueller <smueller@chronox.de>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2018-08-03 18:05:48 +08:00
..
2018-06-25 12:17:08 -07:00
2017-11-02 11:10:55 +01:00
2016-10-25 11:08:33 +08:00
2018-07-09 00:26:20 +08:00
2017-04-21 20:30:50 +08:00
2018-01-12 23:03:39 +11:00
2018-07-09 00:30:26 +08:00
2018-07-09 00:30:26 +08:00
2018-07-09 00:30:26 +08:00
2018-05-19 00:13:58 +08:00
2017-02-11 17:50:43 +08:00
2017-06-19 14:11:53 +08:00
2018-07-19 07:32:44 -07:00
2018-03-31 01:34:19 +08:00
2017-01-13 00:24:39 +08:00
2018-04-21 00:58:32 +08:00
2017-10-07 12:10:34 +08:00
2018-06-28 10:40:47 -07:00
2018-05-26 09:16:44 +02:00
2018-05-26 09:16:44 +02:00
2018-06-28 10:40:47 -07:00
2015-04-22 09:30:18 +08:00
2014-11-24 22:43:57 +08:00
2018-04-21 00:24:02 +08:00
2014-11-24 22:43:57 +08:00
2018-04-21 00:58:30 +08:00
2018-04-21 00:58:30 +08:00
2018-07-09 00:26:20 +08:00
2015-01-13 22:29:11 +11:00
2017-11-29 17:33:25 +11:00
2017-11-29 17:33:25 +11:00
2017-11-29 17:33:25 +11:00
2017-03-09 18:34:39 +08:00
2017-11-03 21:35:35 +08:00
2018-04-21 00:58:34 +08:00
2017-11-29 17:33:33 +11:00
2017-12-22 19:02:33 +11:00
2018-04-21 00:58:34 +08:00
2017-02-11 17:52:28 +08:00
2016-10-21 11:03:42 +08:00
2018-05-27 00:12:09 +08:00
2018-05-27 00:12:08 +08:00
2016-09-13 20:27:26 +08:00
2018-01-12 23:03:35 +11:00
2018-02-15 23:26:50 +08:00
2018-07-09 00:30:24 +08:00
2018-02-15 23:26:47 +08:00
2014-03-21 21:54:28 +08:00
2018-04-21 00:58:34 +08:00
2018-04-21 00:58:34 +08:00
2017-04-24 18:11:08 +08:00
2015-01-13 22:29:11 +11:00
2018-07-09 00:26:22 +08:00
2018-07-20 13:51:21 +08:00
2018-08-03 18:05:48 +08:00
2014-11-26 20:06:30 +08:00
2018-07-20 13:51:22 +08:00
2018-07-09 00:26:19 +08:00
2018-04-21 00:58:29 +08:00
2017-10-12 22:55:00 +08:00
2018-04-21 00:58:29 +08:00
2017-12-22 19:52:45 +11:00
2014-11-24 22:43:57 +08:00
2015-04-23 14:18:09 +08:00
2017-12-22 19:29:08 +11:00
2017-12-22 19:52:40 +11:00
2018-07-09 00:30:24 +08:00
2015-12-20 15:27:12 +02:00
2017-11-29 13:39:15 +11:00
2018-03-31 01:32:58 +08:00
2016-11-17 23:34:52 +08:00
2015-06-25 23:18:33 +08:00
2018-05-31 00:13:57 +08:00
2017-11-29 17:33:26 +11:00
2014-11-24 22:43:57 +08:00
2017-01-13 00:24:39 +08:00
2018-03-31 01:33:10 +08:00
2017-04-10 19:17:27 +08:00
2017-04-10 19:17:27 +08:00
2017-05-08 17:15:13 -07:00
2018-05-31 00:13:41 +08:00
2018-02-15 23:26:45 +08:00
2018-07-09 00:30:24 +08:00
2018-07-09 00:30:24 +08:00
2013-12-09 20:09:12 +08:00
2014-11-24 22:43:57 +08:00
2018-08-03 17:55:12 +08:00
2018-07-09 00:30:26 +08:00
2018-04-21 00:58:34 +08:00
2017-12-22 19:02:47 +11:00
2018-07-09 00:30:24 +08:00
2018-05-16 07:23:35 +02:00
2017-11-02 11:10:55 +01:00
2018-07-09 00:30:24 +08:00
2018-07-09 00:30:24 +08:00
2018-07-27 19:28:36 +08:00
2018-07-27 19:28:36 +08:00
2017-07-28 17:56:00 +08:00
2018-04-07 19:04:02 +09:00
2018-02-15 23:26:47 +08:00
2018-04-21 00:58:37 +08:00
2016-07-05 23:05:26 +08:00
2015-10-14 22:23:16 +08:00
2018-05-31 00:13:57 +08:00
2016-11-22 15:02:25 +08:00
2018-01-06 09:18:00 -07:00
2014-11-24 22:43:57 +08:00
2017-12-22 19:52:45 +11:00
2017-08-09 20:17:54 +08:00
2018-07-09 00:30:24 +08:00
2018-08-03 17:55:12 +08:00
2018-07-09 00:30:24 +08:00
2018-07-09 00:30:24 +08:00
2018-01-12 23:03:37 +11:00
2018-03-03 00:03:17 +08:00
2018-07-01 21:00:47 +08:00
2018-07-09 00:30:24 +08:00
2018-05-05 14:52:51 +08:00
2018-02-22 22:16:54 +08:00
2018-07-01 21:00:44 +08:00
2015-07-17 21:20:20 +08:00
2015-01-13 22:29:11 +11:00
2018-07-09 00:33:35 +08:00
2018-07-20 13:51:21 +08:00
2018-07-09 00:30:24 +08:00
2017-11-29 17:33:25 +11:00
2017-11-29 17:33:25 +11:00
2018-07-01 21:00:44 +08:00
2018-07-09 00:30:24 +08:00
2017-11-29 17:33:25 +11:00
2017-11-15 18:21:04 -08:00
2018-03-03 00:03:33 +08:00
2018-04-21 00:58:30 +08:00