mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-29 04:07:49 +02:00
SSUHeader and authenticate added
This commit is contained in:
parent
27426a6023
commit
8d4b98c83a
3 changed files with 30 additions and 3 deletions
3
hmac.h
3
hmac.h
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue