Thread (14 messages) 14 messages, 2 authors, 2017-07-18

[PATCH v3 7/7] crypto: aes - allow generic AES to be replaced by fixed time AES

flat view
STALE3370d

From: Ard Biesheuvel <hidden>
Date: 2017-06-20 09:29:13
Subsystem: crypto api, the rest · Maintainers: Herbert Xu, "David S. Miller", Linus Torvalds

Revision v3 of 2 in this series.

Revisions (2)
  1. v1 [diff vs current]
  2. v3 current
On systems where a small memory footprint is important, the generic
AES code with its 16 KB of lookup tables and fully unrolled encrypt
and decrypt routines may be an unnecessary burden, especially given
that modern SoCs often have dedicated instructions for AES. And even
if they don't, a time invariant implementation may be preferred over
a fast one that may be susceptible to cache timing attacks.

So allow the declared dependency of other subsystems on AES to be
fulfilled by either the generic table based AES or by the much smaller
generic time invariant implementation.

Signed-off-by: Ard Biesheuvel <redacted>
---
 crypto/Kconfig | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/crypto/Kconfig b/crypto/Kconfig
index 87d9e03dcb74..dd0bc0d84789 100644
--- a/crypto/Kconfig
+++ b/crypto/Kconfig
@@ -899,7 +899,8 @@ config CRYPTO_AES_CORE
 
 config CRYPTO_AES
 	tristate
-	select CRYPTO_AES_GENERIC
+	select CRYPTO_AES_GENERIC if (CRYPTO_AES=y && CRYPTO_AES_TI != y) || \
+				     (CRYPTO_AES=m && !CRYPTO_AES_TI)
 
 config CRYPTO_AES_GENERIC
 	tristate "Generic table based AES cipher"
-- 
2.7.4
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help