diff options
| author | weidai <weidai11@users.noreply.github.com> | 2006-12-14 11:41:39 +0000 |
|---|---|---|
| committer | weidai <weidai11@users.noreply.github.com> | 2006-12-14 11:41:39 +0000 |
| commit | 4afd858ae4974f82f9997b9184bc3d8d71d29b6e (patch) | |
| tree | be3960f1424e79719ea9c5f6152df003bc1c44f3 /hmac.cpp | |
| parent | 0f5ff1a06380139d0e93ba7cda3923d2c41cd866 (diff) | |
| download | cryptopp-git-4afd858ae4974f82f9997b9184bc3d8d71d29b6e.tar.gz | |
port to Borland C++Builder 2006
Diffstat (limited to 'hmac.cpp')
| -rw-r--r-- | hmac.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -20,6 +20,8 @@ void HMAC_Base::UncheckedSetKey(const byte *userKey, unsigned int keylength, con if (!blockSize) throw InvalidArgument("HMAC: can only be used with a block-based hash function"); + m_buf.resize(2*AccessHash().BlockSize() + AccessHash().DigestSize()); + if (keylength <= blockSize) memcpy(AccessIpad(), userKey, keylength); else @@ -33,8 +35,8 @@ void HMAC_Base::UncheckedSetKey(const byte *userKey, unsigned int keylength, con for (unsigned int i=0; i<blockSize; i++) { - AccessOpad()[i] = AccessIpad()[i] ^ OPAD; - AccessIpad()[i] ^= IPAD; + AccessOpad()[i] = AccessIpad()[i] ^ 0x5c; + AccessIpad()[i] ^= 0x36; } } |
