aboutsummaryrefslogtreecommitdiffstats
path: root/src/aont
diff options
context:
space:
mode:
authorlloyd <[email protected]>2009-10-14 23:13:23 +0000
committerlloyd <[email protected]>2009-10-14 23:13:23 +0000
commit01ea6faf1b9fb3ccd7233b1117e09c642c22d238 (patch)
tree02d9c8967de30137d899949d1fcbfd28f4c14c9e /src/aont
parent09a17201a8132f8422a4c371cf1e56553317bc66 (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/aont')
-rw-r--r--src/aont/package.cpp14
1 files changed, 3 insertions, 11 deletions
diff --git a/src/aont/package.cpp b/src/aont/package.cpp
index 6c6b56865..37bad46c8 100644
--- a/src/aont/package.cpp
+++ b/src/aont/package.cpp
@@ -7,7 +7,7 @@
*/
#include <botan/package.h>
-#include <botan/pipe.h>
+#include <botan/filters.h>
#include <botan/ctr.h>
#include <botan/loadstor.h>
#include <botan/xor_buf.h>
@@ -29,12 +29,7 @@ void package(RandomNumberGenerator& rng,
SymmetricKey package_key(rng, cipher->BLOCK_SIZE);
- // takes ownership of cipher object
- Keyed_Filter* ctr_mode = new CTR_BE(cipher,
- package_key,
- InitializationVector(all_zeros));
-
- Pipe pipe(ctr_mode);
+ Pipe pipe(new StreamCipher_Filter(new CTR_BE(cipher), package_key));
pipe.process_msg(input, input_len);
pipe.read(output, pipe.remaining());
@@ -113,10 +108,7 @@ void unpackage(BlockCipher* cipher,
xor_buf(&package_key[0], buf, cipher->BLOCK_SIZE);
}
- // takes ownership of cipher object
- Pipe pipe(new CTR_BE(cipher,
- SymmetricKey(package_key),
- InitializationVector(all_zeros)));
+ Pipe pipe(new StreamCipher_Filter(new CTR_BE(cipher), package_key));
pipe.process_msg(input, input_len - cipher->BLOCK_SIZE);