|
|
@ -19,7 +19,7 @@ namespace crypto |
|
|
|
// block size is 64 bytes
|
|
|
|
// block size is 64 bytes
|
|
|
|
{ |
|
|
|
{ |
|
|
|
size_t totalLen = len + 64 + 32; |
|
|
|
size_t totalLen = len + 64 + 32; |
|
|
|
uint8_t * buf = new uint8_t[totalLen]; // TODO: reuse buffers
|
|
|
|
uint8_t buf[2048]; |
|
|
|
// ikeypad
|
|
|
|
// ikeypad
|
|
|
|
((uint64_t *)buf)[0] = ((uint64_t *)key)[0] ^ IPAD; |
|
|
|
((uint64_t *)buf)[0] = ((uint64_t *)key)[0] ^ IPAD; |
|
|
|
((uint64_t *)buf)[1] = ((uint64_t *)key)[1] ^ IPAD; |
|
|
|
((uint64_t *)buf)[1] = ((uint64_t *)key)[1] ^ IPAD; |
|
|
@ -51,7 +51,6 @@ namespace crypto |
|
|
|
|
|
|
|
|
|
|
|
// calculate digest
|
|
|
|
// calculate digest
|
|
|
|
CryptoPP::Weak1::MD5().CalculateDigest (digest, buf, totalLen); |
|
|
|
CryptoPP::Weak1::MD5().CalculateDigest (digest, buf, totalLen); |
|
|
|
delete[] buf; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|