diff options
author | lloyd <[email protected]> | 2013-03-14 18:02:26 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2013-03-14 18:02:26 +0000 |
commit | 261a665b1be34f07d5012eed5f6090fd85dd8479 (patch) | |
tree | 612220e3d21a6f6b92ba06837b87b6dbd5b4f0f9 /src/engine | |
parent | 35c5cbed2ebe0eb72e2ff665b78a9027d17c19ec (diff) |
Add OCB mode, currently encrypt only, and an AEAD interface
Diffstat (limited to 'src/engine')
-rw-r--r-- | src/engine/core_engine/core_modes.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/engine/core_engine/core_modes.cpp b/src/engine/core_engine/core_modes.cpp index 21a5863e2..039a60c78 100644 --- a/src/engine/core_engine/core_modes.cpp +++ b/src/engine/core_engine/core_modes.cpp @@ -40,6 +40,10 @@ #include <botan/eax.h> #endif +#if defined(BOTAN_HAS_OCB) + #include <botan/ocb.h> +#endif + #if defined(BOTAN_HAS_XTS) #include <botan/xts.h> #endif @@ -127,6 +131,18 @@ Keyed_Filter* get_cipher_mode(const BlockCipher* block_cipher, #endif } +#if defined(BOTAN_HAS_OCB) + if(mode == "OCB") + { + if(direction == ENCRYPTION) + return new OCB_Encryption(block_cipher->clone(), 16); + /* + else + return new OCB_Decryption(block_cipher->clone(), 16); + */ + } +#endif + #if defined(BOTAN_HAS_XTS) if(mode == "XTS") { |