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/wid_wake/wid_wake.cpp | |
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/wid_wake/wid_wake.cpp')
-rw-r--r-- | src/stream/wid_wake/wid_wake.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
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); |