diff options
author | kokke <spam@rowdy.dk> | 2017-12-01 01:48:19 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-12-01 01:48:19 +0100 |
commit | 9acae40f3ec8dc728a14e298a4ad9505a1d4a3bd (patch) | |
tree | ad4737c23e89a4e101c2dda162bec66f52112a63 /aes.c | |
parent | Update aes.c (diff) | |
download | tiny-AES-c-9acae40f3ec8dc728a14e298a4ad9505a1d4a3bd.tar tiny-AES-c-9acae40f3ec8dc728a14e298a4ad9505a1d4a3bd.tar.gz tiny-AES-c-9acae40f3ec8dc728a14e298a4ad9505a1d4a3bd.tar.bz2 tiny-AES-c-9acae40f3ec8dc728a14e298a4ad9505a1d4a3bd.tar.lz tiny-AES-c-9acae40f3ec8dc728a14e298a4ad9505a1d4a3bd.tar.xz tiny-AES-c-9acae40f3ec8dc728a14e298a4ad9505a1d4a3bd.tar.zst tiny-AES-c-9acae40f3ec8dc728a14e298a4ad9505a1d4a3bd.zip |
Diffstat (limited to 'aes.c')
-rw-r--r-- | aes.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -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; |