diff options
author | Jack Lloyd <[email protected]> | 2015-09-10 02:42:48 -0400 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2015-09-10 02:42:48 -0400 |
commit | 8211fdc11fa3bbe692b50d42126f74d259a4a96a (patch) | |
tree | 4c86467f85cae8e09190d91eb1299aa45c806ee1 /src/lib/modes/aead/aead.cpp | |
parent | d21de17f070863c7e0b7e8d254eb35689001a53a (diff) |
Same treatment for cipher modes
Diffstat (limited to 'src/lib/modes/aead/aead.cpp')
-rw-r--r-- | src/lib/modes/aead/aead.cpp | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/src/lib/modes/aead/aead.cpp b/src/lib/modes/aead/aead.cpp index 1f2099d2e..c101480b4 100644 --- a/src/lib/modes/aead/aead.cpp +++ b/src/lib/modes/aead/aead.cpp @@ -7,8 +7,59 @@ #include <botan/internal/mode_utils.h> #include <botan/aead.h> +#if defined(BOTAN_HAS_AEAD_CCM) +#include <botan/ccm.h> +#endif + +#if defined(BOTAN_HAS_AEAD_CHACHA20_POLY1305) +#include <botan/chacha20poly1305.h> +#endif + +#if defined(BOTAN_HAS_AEAD_EAX) +#include <botan/eax.h> +#endif + +#if defined(BOTAN_HAS_AEAD_GCM) +#include <botan/gcm.h> +#endif + +#if defined(BOTAN_HAS_AEAD_OCB) +#include <botan/ocb.h> +#endif + +#if defined(BOTAN_HAS_AEAD_SIV) +#include <botan/siv.h> +#endif + namespace Botan { +AEAD_Mode::~AEAD_Mode() {} + +#if defined(BOTAN_HAS_AEAD_CCM) +BOTAN_REGISTER_BLOCK_CIPHER_MODE_LEN2(CCM_Encryption, CCM_Decryption, 16, 3); +#endif + +#if defined(BOTAN_HAS_AEAD_CHACHA20_POLY1305) +BOTAN_REGISTER_TRANSFORM_NOARGS(ChaCha20Poly1305_Encryption); +BOTAN_REGISTER_TRANSFORM_NOARGS(ChaCha20Poly1305_Decryption); +#endif + +#if defined(BOTAN_HAS_AEAD_EAX) +BOTAN_REGISTER_BLOCK_CIPHER_MODE_LEN(EAX_Encryption, EAX_Decryption, 0); +#endif + +#if defined(BOTAN_HAS_AEAD_GCM) +BOTAN_REGISTER_BLOCK_CIPHER_MODE_LEN(GCM_Encryption, GCM_Decryption, 16); +#endif + +#if defined(BOTAN_HAS_AEAD_OCB) +BOTAN_REGISTER_BLOCK_CIPHER_MODE_LEN(OCB_Encryption, OCB_Decryption, 16); +#endif + +#if defined(BOTAN_HAS_AEAD_SIV) +BOTAN_REGISTER_BLOCK_CIPHER_MODE(SIV_Encryption, SIV_Decryption); +#endif + AEAD_Mode* get_aead(const std::string& algo_spec, Cipher_Dir direction) { std::unique_ptr<Cipher_Mode> mode(get_cipher_mode(algo_spec, direction)); |