summaryrefslogtreecommitdiff
path: root/shacal2.cpp
diff options
context:
space:
mode:
authorweidai <weidai11@users.noreply.github.com>2004-03-09 12:40:59 +0000
committerweidai <weidai11@users.noreply.github.com>2004-03-09 12:40:59 +0000
commit4e99bcc40db7203e010203d125b0bfe6f27fb99e (patch)
tree9781c1ee68c278dc99743f3efc38136c61060758 /shacal2.cpp
parent88076c078d9b63339b4870e042f20e14d4fbeda9 (diff)
downloadcryptopp-git-4e99bcc40db7203e010203d125b0bfe6f27fb99e.tar.gz
fix assert when keylen not multiple of 4
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 971aec02..78e4a839 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]);