From 0a0244dacface689335de6e0edf978b29ddb66e1 Mon Sep 17 00:00:00 2001 From: weidai Date: Wed, 26 Mar 2003 21:50:44 +0000 Subject: fix bugs in SEAL and Panama git-svn-id: svn://svn.code.sf.net/p/cryptopp/code/trunk/c5@54 57ff6487-cd31-0410-9ec3-f628ee90f5f0 --- modes.cpp | 28 ++++++---------------------- 1 file changed, 6 insertions(+), 22 deletions(-) (limited to 'modes.cpp') diff --git a/modes.cpp b/modes.cpp index 70c2323..09c370e 100644 --- a/modes.cpp +++ b/modes.cpp @@ -32,7 +32,7 @@ template class AdditiveCipherTemplateOptimalNumberOfParallelBlocks()); - memcpy(m_counterArray, iv, s); + CopyOrZero(m_counterArray, iv, s); } -void BlockOrientedCipherModeBase::UncheckedSetKey(const NameValuePairs ¶ms, const byte *key, unsigned int length) +void BlockOrientedCipherModeBase::UncheckedSetKey(const NameValuePairs ¶ms, const byte *key, unsigned int length, const byte *iv) { m_cipher->SetKey(key, length, params); ResizeBuffers(); - const byte *iv = params.GetValueWithDefault(Name::IV(), (const byte *)NULL); - SetIV(iv); + if (IsResynchronizable()) + Resynchronize(iv); } void BlockOrientedCipherModeBase::ProcessData(byte *outString, const byte *inString, unsigned int length) -- cgit v1.2.1