Update aes.c

This commit is contained in:
kokke 2017-12-01 01:48:19 +01:00 committed by GitHub
parent f92f371438
commit 9acae40f3e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions

2
aes.c
View File

@ -618,10 +618,12 @@ void AES_CTR_xcrypt_buffer(uint8_t* output, uint8_t* input, uint32_t length, con
state = (state_t*)buffer;
Cipher();
/* Increment counter and handle overflow */
for (j = (BLOCKLEN - 1); j >= 0; --j)
{
counter[j] += 1;
/* Break if no overflow, keep going otherwise */
if (counter[j] != 0)
{
break;