summaryrefslogtreecommitdiff
path: root/crypto/Kconfig
diff options
context:
space:
mode:
authorStephan Mueller <smueller@chronox.de>2016-06-14 07:34:13 +0200
committerHerbert Xu <herbert@gondor.apana.org.au>2016-06-15 17:07:53 +0800
commit1d55d90cae2019ad4651bad93810f3c5eea7aa98 (patch)
treee550fcc24c1f7be35b3f2f993370aad039fbc3fa /crypto/Kconfig
parent64187d76e485a76a89550cfabe2526500c7e6365 (diff)
downloadlinux-crypto-1d55d90cae2019ad4651bad93810f3c5eea7aa98.tar.gz
linux-crypto-1d55d90cae2019ad4651bad93810f3c5eea7aa98.zip
crypto: drbg - use CTR AES instead of ECB AES
The CTR DRBG derives its random data from the CTR that is encrypted with AES. This patch now changes the CTR DRBG implementation such that the CTR AES mode is employed. This allows the use of steamlined CTR AES implementation such as ctr-aes-aesni. Unfortunately there are the following subtile changes we need to apply when using the CTR AES mode: - the CTR mode increments the counter after the cipher operation, but the CTR DRBG requires the increment before the cipher op. Hence, the crypto_inc is applied to the counter (drbg->V) once it is recalculated. - the CTR mode wants to encrypt data, but the CTR DRBG is interested in the encrypted counter only. The full CTR mode is the XOR of the encrypted counter with the plaintext data. To access the encrypted counter, the patch uses a NULL data vector as plaintext to be "encrypted". Signed-off-by: Stephan Mueller <smueller@chronox.de> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'crypto/Kconfig')
-rw-r--r--crypto/Kconfig1
1 files changed, 1 insertions, 0 deletions
diff --git a/crypto/Kconfig b/crypto/Kconfig
index 1d33beb6..c903f183 100644
--- a/crypto/Kconfig
+++ b/crypto/Kconfig
@@ -1567,6 +1567,7 @@ config CRYPTO_DRBG_HASH
config CRYPTO_DRBG_CTR
bool "Enable CTR DRBG"
select CRYPTO_AES
+ depends on CRYPTO_CTR
help
Enable the CTR DRBG variant as defined in NIST SP800-90A.