diff options
author | lloyd <[email protected]> | 2013-03-16 21:23:50 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2013-03-16 21:23:50 +0000 |
commit | 01d1a8f734b9912301e4c0b6504c5ffa1d09e27a (patch) | |
tree | 0858c1e91d8a8161558a2d6ca4430853f8027564 /src/engine | |
parent | aeb997bca6f6ce2856d1d346514f6e41167db957 (diff) |
Some work towards a (very slow) GCM implementation
Does not currently work due to some error in ghash, likely a
misunderstanding of the field representation.
Diffstat (limited to 'src/engine')
-rw-r--r-- | src/engine/core_engine/core_modes.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/engine/core_engine/core_modes.cpp b/src/engine/core_engine/core_modes.cpp index 08124a3a0..b30097eaa 100644 --- a/src/engine/core_engine/core_modes.cpp +++ b/src/engine/core_engine/core_modes.cpp @@ -44,6 +44,10 @@ #include <botan/ocb.h> #endif +#if defined(BOTAN_HAS_GCM) + #include <botan/gcm.h> +#endif + #if defined(BOTAN_HAS_XTS) #include <botan/xts.h> #endif @@ -141,6 +145,16 @@ Keyed_Filter* get_cipher_mode(const BlockCipher* block_cipher, } #endif +#if defined(BOTAN_HAS_GCM) + if(mode == "GCM") + { + if(direction == ENCRYPTION) + return new GCM_Encryption(block_cipher->clone(), 16); + else + return new GCM_Decryption(block_cipher->clone(), 16); + } +#endif + #if defined(BOTAN_HAS_XTS) if(mode == "XTS") { |