diff options
author | lloyd <[email protected]> | 2012-05-25 23:56:05 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2012-05-25 23:56:05 +0000 |
commit | d956f632061cb80f3d7a3ee2b6b4f384dcc73145 (patch) | |
tree | c045eeabc4f98c1eb9b5e3e20bcb23370087869a /src/stream | |
parent | 12090a7148d9ee73572cc1a7268fc489504a8173 (diff) |
Some post merge fixups.
Fix some bugs that triggered if DEFAULT_BUFFERSIZE was either too
small or an odd size.
Diffstat (limited to 'src/stream')
-rw-r--r-- | src/stream/arc4/arc4.cpp | 4 | ||||
-rw-r--r-- | src/stream/wid_wake/wid_wake.cpp | 4 |
2 files changed, 5 insertions, 3 deletions
diff --git a/src/stream/arc4/arc4.cpp b/src/stream/arc4/arc4.cpp index 13eb6ff9e..16c6058d2 100644 --- a/src/stream/arc4/arc4.cpp +++ b/src/stream/arc4/arc4.cpp @@ -7,7 +7,7 @@ #include <botan/arc4.h> #include <botan/internal/xor_buf.h> -#include <botan/parsing.h> +#include <botan/internal/rounding.h> namespace Botan { @@ -62,7 +62,7 @@ void ARC4::generate() void ARC4::key_schedule(const byte key[], size_t length) { state.resize(256); - buffer.resize(DEFAULT_BUFFERSIZE); + buffer.resize(round_up<size_t>(DEFAULT_BUFFERSIZE, 4)); position = X = Y = 0; diff --git a/src/stream/wid_wake/wid_wake.cpp b/src/stream/wid_wake/wid_wake.cpp index e4ab6477f..0f56148a5 100644 --- a/src/stream/wid_wake/wid_wake.cpp +++ b/src/stream/wid_wake/wid_wake.cpp @@ -8,6 +8,7 @@ #include <botan/wid_wake.h> #include <botan/loadstor.h> #include <botan/internal/xor_buf.h> +#include <botan/internal/rounding.h> namespace Botan { @@ -76,7 +77,8 @@ void WiderWake_41_BE::key_schedule(const byte key[], size_t) { t_key.resize(4); state.resize(5); - buffer.resize(DEFAULT_BUFFERSIZE); + buffer.resize( + round_up<size_t>(std::max<size_t>(8*4, DEFAULT_BUFFERSIZE), 8)); for(size_t i = 0; i != 4; ++i) t_key[i] = load_be<u32bit>(key, i); |