diff options
author | Christophe Leroy <christophe.leroy@c-s.fr> | 2019-05-21 15:34:09 +0200 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2019-05-30 09:30:04 +0200 |
commit | b8fbdc2bc4e71b62646031d5df5f08aafe15d5ad (patch) | |
tree | 1c9cce295a06f5bf97fa1b3547e64e62e9166e1e /drivers/crypto/talitos.c | |
parent | crypto: talitos - rename alternative AEAD algos. (diff) | |
download | linux-b8fbdc2bc4e71b62646031d5df5f08aafe15d5ad.tar.xz linux-b8fbdc2bc4e71b62646031d5df5f08aafe15d5ad.zip |
crypto: talitos - reduce max key size for SEC1
SEC1 doesn't support SHA384/512, so it doesn't require
longer keys.
This patch reduces the max key size when the driver
is built for SEC1 only.
Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
Fixes: 03d2c5114c95 ("crypto: talitos - Extend max key length for SHA384/512-HMAC and AEAD")
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/crypto/talitos.c')
-rw-r--r-- | drivers/crypto/talitos.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/crypto/talitos.c b/drivers/crypto/talitos.c index 6f8bc6467706..6312f8d501b1 100644 --- a/drivers/crypto/talitos.c +++ b/drivers/crypto/talitos.c @@ -837,7 +837,11 @@ static void talitos_unregister_rng(struct device *dev) * HMAC_SNOOP_NO_AFEA (HSNA) instead of type IPSEC_ESP */ #define TALITOS_CRA_PRIORITY_AEAD_HSNA (TALITOS_CRA_PRIORITY - 1) +#ifdef CONFIG_CRYPTO_DEV_TALITOS_SEC2 #define TALITOS_MAX_KEY_SIZE (AES_MAX_KEY_SIZE + SHA512_BLOCK_SIZE) +#else +#define TALITOS_MAX_KEY_SIZE (AES_MAX_KEY_SIZE + SHA256_BLOCK_SIZE) +#endif #define TALITOS_MAX_IV_LENGTH 16 /* max of AES_BLOCK_SIZE, DES3_EDE_BLOCK_SIZE */ struct talitos_ctx { |