diff options
author | lloyd <[email protected]> | 2009-10-14 23:13:23 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2009-10-14 23:13:23 +0000 |
commit | 01ea6faf1b9fb3ccd7233b1117e09c642c22d238 (patch) | |
tree | 02d9c8967de30137d899949d1fcbfd28f4c14c9e /src/cryptobox | |
parent | 09a17201a8132f8422a4c371cf1e56553317bc66 (diff) |
Convert CTR_BE from a Filter to a StreamCipher. Must wrap in a StreamCipher_Filter
to pass it directly to a Pipe now.
Diffstat (limited to 'src/cryptobox')
-rw-r--r-- | src/cryptobox/cryptobox.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/cryptobox/cryptobox.cpp b/src/cryptobox/cryptobox.cpp index c27bbaffa..ba7553c55 100644 --- a/src/cryptobox/cryptobox.cpp +++ b/src/cryptobox/cryptobox.cpp @@ -8,9 +8,8 @@ #include <botan/cryptobox.h> #include <botan/filters.h> #include <botan/pipe.h> -#include <botan/serpent.h> +#include <botan/lookup.h> #include <botan/sha2_64.h> -#include <botan/ctr.h> #include <botan/hmac.h> #include <botan/pbkdf2.h> #include <botan/pem.h> @@ -59,7 +58,7 @@ std::string encrypt(const byte input[], u32bit input_len, InitializationVector iv(mk.begin() + CIPHER_KEY_LEN + MAC_KEY_LEN, CIPHER_IV_LEN); - Pipe pipe(new CTR_BE(new Serpent, cipher_key, iv), + Pipe pipe(get_cipher("Serpent/CTR-BE", cipher_key, iv, ENCRYPTION), new Fork( 0, new MAC_Filter(new HMAC(new SHA_512), @@ -121,7 +120,7 @@ std::string decrypt(const byte input[], u32bit input_len, CIPHER_IV_LEN); Pipe pipe(new Fork( - new CTR_BE(new Serpent, cipher_key, iv), + get_cipher("Serpent/CTR-BE", cipher_key, iv, ENCRYPTION), new MAC_Filter(new HMAC(new SHA_512), mac_key, MAC_OUTPUT_LEN))); |