mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-28 11:47:48 +02:00
eliminated multiple of 16 check for AES
This commit is contained in:
parent
eb44fdf7a8
commit
a6cc2e647b
3 changed files with 7 additions and 14 deletions
2
SSU.cpp
2
SSU.cpp
|
@ -524,7 +524,6 @@ namespace ssu
|
|||
header->time = htobe32 (i2p::util::GetSecondsSinceEpoch ());
|
||||
uint8_t * encrypted = &header->flag;
|
||||
uint16_t encryptedLen = len - (encrypted - buf);
|
||||
encryptedLen = (encryptedLen>>4)<<4; // make sure 16 bytes boundary, TODO: do we really need it?
|
||||
m_SessionKeyEncryption.Encrypt (encrypted, encryptedLen, encrypted);
|
||||
// assume actual buffer size is 18 (16 + 2) bytes more
|
||||
memcpy (buf + len, header->iv, 16);
|
||||
|
@ -557,7 +556,6 @@ namespace ssu
|
|||
SSUHeader * header = (SSUHeader *)buf;
|
||||
uint8_t * encrypted = &header->flag;
|
||||
uint16_t encryptedLen = len - (encrypted - buf);
|
||||
encryptedLen = (encryptedLen>>4)<<4; // make sure 16 bytes boundary
|
||||
if (encryptedLen > 0)
|
||||
{
|
||||
m_SessionKeyDecryption.SetIV (header->iv);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue