SSUHeader and authenticate added

This commit is contained in:
orignal 2014-01-27 16:52:17 -05:00
parent 27426a6023
commit 8d4b98c83a
3 changed files with 30 additions and 3 deletions

3
hmac.h
View file

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