mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-01-22 08:14:15 +00:00
check # of block to encrypt/decrypt for zero
This commit is contained in:
parent
12641ab0c0
commit
00ac1f7ec9
8
aes.cpp
8
aes.cpp
@ -192,7 +192,9 @@ namespace crypto
|
||||
void CBCEncryption::Encrypt (const uint8_t * in, std::size_t len, uint8_t * out)
|
||||
{
|
||||
// len/16
|
||||
Encrypt (len >> 4, (const ChipherBlock *)in, (ChipherBlock *)out);
|
||||
int numBlocks = len >> 4;
|
||||
if (numBlocks > 0)
|
||||
Encrypt (numBlocks, (const ChipherBlock *)in, (ChipherBlock *)out);
|
||||
}
|
||||
|
||||
void CBCEncryption::Encrypt (const uint8_t * in, uint8_t * out)
|
||||
@ -252,7 +254,9 @@ namespace crypto
|
||||
|
||||
void CBCDecryption::Decrypt (const uint8_t * in, std::size_t len, uint8_t * out)
|
||||
{
|
||||
Decrypt (len >> 4, (const ChipherBlock *)in, (ChipherBlock *)out);
|
||||
int numBlocks = len >> 4;
|
||||
if (numBlocks > 0)
|
||||
Decrypt (numBlocks, (const ChipherBlock *)in, (ChipherBlock *)out);
|
||||
}
|
||||
|
||||
void CBCDecryption::Decrypt (const uint8_t * in, uint8_t * out)
|
||||
|
Loading…
x
Reference in New Issue
Block a user