From 3bf1f1321c3c78c499d7e44c9fb2ca97b927f5a1 Mon Sep 17 00:00:00 2001 From: lloyd Date: Wed, 27 Mar 2013 16:57:44 +0000 Subject: Resize each time in the loop --- src/filters/aead_filt/aead_filt.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/filters/aead_filt/aead_filt.cpp b/src/filters/aead_filt/aead_filt.cpp index 62f692ed2..f70b8eafe 100644 --- a/src/filters/aead_filt/aead_filt.cpp +++ b/src/filters/aead_filt/aead_filt.cpp @@ -77,11 +77,11 @@ void AEAD_Filter::start_msg() void AEAD_Filter::buffered_block(const byte input[], size_t input_length) { - secure_vector buf(m_aead->update_granularity()); + secure_vector buf; while(input_length) { - const size_t take = std::min(buf.size(), input_length); + const size_t take = std::min(m_aead->update_granularity(), input_length); buf.resize(take); copy_mem(&buf[0], input, take); -- cgit v1.2.3