diff options
| author | jhurst <jhurst@cinecert.com> | 2009-10-15 17:31:27 +0000 |
|---|---|---|
| committer | jhurst <> | 2009-10-15 17:31:27 +0000 |
| commit | fdf84d4afbaf2b3185c08d66f74853ac270d4060 (patch) | |
| tree | 4b13ae40ef4b4a42b14e7c2366c330a2099154b0 /src/AS_DCP_AES.cpp | |
| parent | 8cfba4c7a4dc6713895b4f03ead3572caad109d0 (diff) | |
hmac pad fix
Diffstat (limited to 'src/AS_DCP_AES.cpp')
| -rwxr-xr-x | src/AS_DCP_AES.cpp | 27 |
1 files changed, 4 insertions, 23 deletions
diff --git a/src/AS_DCP_AES.cpp b/src/AS_DCP_AES.cpp index 6c81cad..51955f6 100755 --- a/src/AS_DCP_AES.cpp +++ b/src/AS_DCP_AES.cpp @@ -241,27 +241,8 @@ ASDCP::AESDecContext::DecryptBlock(const byte_t* ct_buf, byte_t* pt_buf, ui32_t static const ui32_t B_len = 64; // rfc 2104, Sec. 2 -static byte_t ipad[B_len] = { - 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, - 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, - 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, - 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, - 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, - 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, - 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, - 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36 -}; - -static byte_t opad[B_len] = { - 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, - 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, - 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, - 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, - 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, - 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, - 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, - 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c -}; +static byte_t const ipad_const = 0x36; +static byte_t const opad_const = 0x5c; class HMACContext::h__HMACContext { @@ -320,7 +301,7 @@ public: // H(K XOR opad, H(K XOR ipad, text)) // ^^^^^^^^^^ for ( ui32_t i = 0; i < B_len; i++ ) - xor_buf[i] ^= ipad[i]; + xor_buf[i] ^= ipad_const; SHA1_Update(&m_SHA, xor_buf, B_len); } @@ -350,7 +331,7 @@ public: // H(K XOR opad, H(K XOR ipad, text)) // ^^^^^^^^^^ for ( ui32_t i = 0; i < B_len; i++ ) - xor_buf[i] ^= opad[i]; + xor_buf[i] ^= opad_const; SHA1_Update(&SHA, xor_buf, B_len); |
