mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-03-07 06:09:42 +00:00
check # of block to encrypt/decrypt for zero
This commit is contained in:
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)
|
void CBCEncryption::Encrypt (const uint8_t * in, std::size_t len, uint8_t * out)
|
||||||
{
|
{
|
||||||
// len/16
|
// 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)
|
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)
|
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)
|
void CBCDecryption::Decrypt (const uint8_t * in, uint8_t * out)
|
||||||
|
|||||||
Reference in New Issue
Block a user