summaryrefslogtreecommitdiff
path: root/shacal2.cpp
diff options
context:
space:
mode:
authorweidai <weidai@57ff6487-cd31-0410-9ec3-f628ee90f5f0>2004-03-09 12:40:59 +0000
committerweidai <weidai@57ff6487-cd31-0410-9ec3-f628ee90f5f0>2004-03-09 12:40:59 +0000
commit16e033d971d0ea878f2b88bf36c10ca1c8ccba5e (patch)
tree9781c1ee68c278dc99743f3efc38136c61060758 /shacal2.cpp
parent8b46269846448b34693279d9a3acd0f8291baabd (diff)
downloadcryptopp-16e033d971d0ea878f2b88bf36c10ca1c8ccba5e.tar.gz
fix assert when keylen not multiple of 4
git-svn-id: svn://svn.code.sf.net/p/cryptopp/code/trunk/c5@150 57ff6487-cd31-0410-9ec3-f628ee90f5f0
Diffstat (limited to 'shacal2.cpp')
-rw-r--r--shacal2.cpp6
1 files changed, 1 insertions, 5 deletions
diff --git a/shacal2.cpp b/shacal2.cpp
index 971aec0..78e4a83 100644
--- a/shacal2.cpp
+++ b/shacal2.cpp
@@ -38,11 +38,7 @@ void SHACAL2::Base::UncheckedSetKey(CipherDir dir, const byte *userKey, unsigned
word32 *rk = m_key;
unsigned int i;
- GetUserKey(BIG_ENDIAN_ORDER, rk, keylen/4, userKey, keylen);
- if (keylen != MAX_KEYLENGTH)
- {
- memset(rk + keylen/4, 0, MAX_KEYLENGTH - keylen);
- }
+ GetUserKey(BIG_ENDIAN_ORDER, rk, m_key.size(), userKey, keylen);
for (i = 0; i < 48; i++, rk++)
{
rk[16] = rk[0] + s0(rk[1]) + rk[9] + s1(rk[14]);