1
0
mirror of https://github.com/PurpleI2P/i2pd.git synced 2025-01-22 04:04:16 +00:00

check # of block to encrypt/decrypt for zero

This commit is contained in:
orignal 2015-03-30 11:56:24 -04:00
parent 12641ab0c0
commit 00ac1f7ec9

View File

@ -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)