Update aes.c
This commit is contained in:
2
aes.c
2
aes.c
@@ -618,10 +618,12 @@ void AES_CTR_xcrypt_buffer(uint8_t* output, uint8_t* input, uint32_t length, con
|
|||||||
state = (state_t*)buffer;
|
state = (state_t*)buffer;
|
||||||
Cipher();
|
Cipher();
|
||||||
|
|
||||||
|
/* Increment counter and handle overflow */
|
||||||
for (j = (BLOCKLEN - 1); j >= 0; --j)
|
for (j = (BLOCKLEN - 1); j >= 0; --j)
|
||||||
{
|
{
|
||||||
counter[j] += 1;
|
counter[j] += 1;
|
||||||
|
|
||||||
|
/* Break if no overflow, keep going otherwise */
|
||||||
if (counter[j] != 0)
|
if (counter[j] != 0)
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in New Issue
Block a user