diff options
author | lloyd <[email protected]> | 2015-02-18 04:08:26 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2015-02-18 04:08:26 +0000 |
commit | aced9e88d970546c6324e768ce11b0a483bd3bd0 (patch) | |
tree | bb60301ce9b5305efdc7fac09536b1c677a3ec10 | |
parent | 70d5acbc4dc78d6396fc4565f9fa39aabc7e3cb5 (diff) |
Get algos via lookup in case of SIMD or other optimized versions
-rw-r--r-- | src/lib/modes/aead/chacha20poly1305/chacha20poly1305.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/lib/modes/aead/chacha20poly1305/chacha20poly1305.cpp b/src/lib/modes/aead/chacha20poly1305/chacha20poly1305.cpp index a278156eb..15fd8f959 100644 --- a/src/lib/modes/aead/chacha20poly1305/chacha20poly1305.cpp +++ b/src/lib/modes/aead/chacha20poly1305/chacha20poly1305.cpp @@ -7,8 +7,6 @@ #include <botan/internal/mode_utils.h> #include <botan/chacha20poly1305.h> -#include <botan/chacha.h> -#include <botan/poly1305.h> namespace Botan { @@ -31,7 +29,7 @@ void ChaCha20Poly1305_Mode::clear() void ChaCha20Poly1305_Mode::key_schedule(const byte key[], size_t length) { if(!m_chacha.get()) - m_chacha.reset(new ChaCha); + m_chacha.reset(make_a<StreamCipher>("ChaCha")); m_chacha->set_key(key, length); } @@ -63,7 +61,7 @@ secure_vector<byte> ChaCha20Poly1305_Mode::start_raw(const byte nonce[], size_t m_chacha->encrypt(zeros); if(!m_poly1305.get()) - m_poly1305.reset(new Poly1305); + m_poly1305.reset(make_a<MessageAuthenticationCode>("Poly1305")); m_poly1305->set_key(&zeros[0], 32); // Remainder of output is discard |