[PATCH RFC 092/104] crypto: fips140: manual fixups for include/crypto/aes.h

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Define fips_/nonfips_ variants of crypto_*_tab when the kernel is
configured to use a standalone FIPS module.

Signed-off-by: Vegard Nossum <vegard.nossum@xxxxxxxxxx>
---
 include/crypto/aes.h | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/include/crypto/aes.h b/include/crypto/aes.h
index 6a732ea5ee1b..77f5515c49c9 100644
--- a/include/crypto/aes.h
+++ b/include/crypto/aes.h
@@ -29,6 +29,16 @@ struct crypto_aes_ctx {
 	u32 key_length;
 };
 
+#ifdef CONFIG_CRYPTO_FIPS140_EXTMOD
+#ifdef FIPS_MODULE
+#define crypto_ft_tab fips_crypto_ft_tab
+#define crypto_it_tab fips_crypto_it_tab
+#else
+#define crypto_ft_tab nonfips_crypto_ft_tab
+#define crypto_it_tab nonfips_crypto_it_tab
+#endif
+#endif
+
 extern const u32 crypto_ft_tab[4][256] ____cacheline_aligned;
 extern const u32 crypto_it_tab[4][256] ____cacheline_aligned;
 
-- 
2.39.3





[Index of Archives]     [Kernel]     [Gnu Classpath]     [Gnu Crypto]     [DM Crypt]     [Netfilter]     [Bugtraq]
  Powered by Linux