Skip to content

crypto: CTR DRBG - performance improvements

Stephan Mueller linux-crypto 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest4 patches 1 replyIn review
  2. v14 patches 2 repliesSuperseded

Changes in v2 from the cover letter

* the alignment patch is updated to use the alignment of the underlying TFM

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4crypto: CTR DRBG - use CTR AES instead of ECB AEScrypto/Kconfig crypto/drbg.c include/crypto/drbg.h+149 -540 replies
2/4crypto: DRBG - use aligned bufferscrypto/drbg.c include/crypto/drbg.h+27 -200 replies
3/4crypto: CTR DRBG - use full CTR AES for updatecrypto/drbg.c+13 -170 replies
4/4crypto: CTR DRBG - avoid duplicate maintenance of keycrypto/drbg.c+1 -20 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH v2 0/4] crypto: CTR DRBG - performance improvements

Hi,

The following patch set is aimed to increase the performance of the CTR DRBG, especially when assembler implementations of the CTR AES mode are available.

The patch set increases the performance by 10% for random numbers of 16 bytes and reaches 450% for random numbers reaching 4096 bytes (larger random numbers will even have more performance gains). The performance gains were measured when using ctr-aes-aesni.

Note, when using the C implementation of the CTR mode (cipher/ctr.c), the performance of the CTR DRBG is slightly worse than it is now, but still it is much faster than the Hash or HMAC DRBGs.

The patch set is CAVS tested.

Changes v2:
* the alignment patch is updated to use the alignment of the underlying TFM

Stephan Mueller (4):
crypto: CTR DRBG - use CTR AES instead of ECB AES
crypto: DRBG - use aligned buffers
crypto: CTR DRBG - use full CTR AES for update
crypto: CTR DRBG - avoid duplicate maintenance of key

 crypto/Kconfig        |   1 +
 crypto/drbg.c         | 252 +++++++++++++++++++++++++++++++++-----------------
 include/crypto/drbg.h |  12 +++
 3 files changed, 181 insertions(+), 84 deletions(-)
Signature · 1 line
2.5.5