diff options
author | lloyd <[email protected]> | 2009-11-10 19:27:34 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2009-11-10 19:27:34 +0000 |
commit | 1a4210926dd857eff1a862806b8c05bda919981e (patch) | |
tree | 424d3c39a46c8783998ca40aa8f021f7a5ea2914 /src/block/aes_intel/aes_intel.h | |
parent | c3216ded9086f442f6378639de7bf5afe8c3228a (diff) |
Add AES-192 using AES-NI. Tested OK with Intel's simulator.
Currently requires SSE4.1 for _mm_extract_epi32 for the key schedule, it
would be nice to remove this dependency, though all currently known/scheduled
chips with AES-NI (Intel Westmere and Sandy Bridge, and AMD Bulldozer) are
supposed to include SSE 4.1 so this is not a huge problem.
Diffstat (limited to 'src/block/aes_intel/aes_intel.h')
-rw-r--r-- | src/block/aes_intel/aes_intel.h | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/block/aes_intel/aes_intel.h b/src/block/aes_intel/aes_intel.h index 7afd7aaec..373e95b9e 100644 --- a/src/block/aes_intel/aes_intel.h +++ b/src/block/aes_intel/aes_intel.h @@ -12,6 +12,9 @@ namespace Botan { +/** +* AES-128 using AES-NI +*/ class BOTAN_DLL AES_128_Intel : public BlockCipher { public: @@ -29,6 +32,29 @@ class BOTAN_DLL AES_128_Intel : public BlockCipher SecureBuffer<u32bit, 44> EK, DK; }; +/** +* AES-192 using AES-NI +*/ +class BOTAN_DLL AES_192_Intel : public BlockCipher + { + public: + void encrypt_n(const byte in[], byte out[], u32bit blocks) const; + void decrypt_n(const byte in[], byte out[], u32bit blocks) const; + + void clear(); + std::string name() const { return "AES-192"; } + BlockCipher* clone() const { return new AES_192_Intel; } + + AES_192_Intel() : BlockCipher(16, 24) { } + private: + void key_schedule(const byte[], u32bit); + + SecureBuffer<u32bit, 56> EK, DK; + }; + +/** +* AES-256 using AES-NI +*/ class BOTAN_DLL AES_256_Intel : public BlockCipher { public: |