diff options
author | weidai <weidai@57ff6487-cd31-0410-9ec3-f628ee90f5f0> | 2006-07-17 14:48:59 +0000 |
---|---|---|
committer | weidai <weidai@57ff6487-cd31-0410-9ec3-f628ee90f5f0> | 2006-07-17 14:48:59 +0000 |
commit | 69fb6c7fd8f5f591b38bb134567ea0786182b0ca (patch) | |
tree | c8076624e56c952ffd234c8327848a392eb6ecd1 /config.h | |
parent | dc4097807c67cdd91b7aeafc6f144e7f3640ae59 (diff) | |
download | cryptopp-69fb6c7fd8f5f591b38bb134567ea0786182b0ca.tar.gz |
AES timing attack countermeasures
git-svn-id: svn://svn.code.sf.net/p/cryptopp/code/trunk/c5@226 57ff6487-cd31-0410-9ec3-f628ee90f5f0
Diffstat (limited to 'config.h')
-rw-r--r-- | config.h | 17 |
1 files changed, 17 insertions, 0 deletions
@@ -48,6 +48,9 @@ #define PREFER_BERKELEY_STYLE_SOCKETS // #define PREFER_WINDOWS_STYLE_SOCKETS +// set the name of Rijndael cipher, was "Rijndael" before version 5.3 +#define CRYPTOPP_RIJNDAEL_NAME "AES" + // ***************** Important Settings Again ******************** // But the defaults should be ok. @@ -155,6 +158,20 @@ const unsigned int WORD_BITS = WORD_SIZE * 8; #define FAST_ROTATE #endif +#ifndef CRYPTOPP_L1_CACHE_LINE_SIZE + // This should be a lower bound on the L1 cache line size. It's used for defense against timing attacks. + // L1 cache line size is 32 on Pentium III and earlier + #define CRYPTOPP_L1_CACHE_LINE_SIZE 32 +#endif + +#ifndef CRYPTOPP_L1_CACHE_ALIGN + #ifdef _MSC_VER + #define CRYPTOPP_L1_CACHE_ALIGN(x) __declspec(align(CRYPTOPP_L1_CACHE_LINE_SIZE)) x + #elif defined(__GNUC__) + #define CRYPTOPP_L1_CACHE_ALIGN(x) x __attribute__((aligned(CRYPTOPP_L1_CACHE_LINE_SIZE))) + #endif +#endif + NAMESPACE_END // VC60 workaround: it doesn't allow typename in some places |