diff options
author | kokke <spam@rowdy.dk> | 2017-12-01 01:44:23 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-12-01 01:44:23 +0100 |
commit | f92f3714388069be123f34ce2f201fb986687006 (patch) | |
tree | a1a059461f95e29219aa7732add91a98bbb1c1f7 | |
parent | Update README.md (diff) | |
download | tiny-AES-c-f92f3714388069be123f34ce2f201fb986687006.tar tiny-AES-c-f92f3714388069be123f34ce2f201fb986687006.tar.gz tiny-AES-c-f92f3714388069be123f34ce2f201fb986687006.tar.bz2 tiny-AES-c-f92f3714388069be123f34ce2f201fb986687006.tar.lz tiny-AES-c-f92f3714388069be123f34ce2f201fb986687006.tar.xz tiny-AES-c-f92f3714388069be123f34ce2f201fb986687006.tar.zst tiny-AES-c-f92f3714388069be123f34ce2f201fb986687006.zip |
-rw-r--r-- | aes.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -612,7 +612,7 @@ void AES_CTR_xcrypt_buffer(uint8_t* output, uint8_t* input, uint32_t length, con int i, j; for (i = 0; i < length; ++i) { - if ((i & 0x0F) == 0) + if ((i & (BLOCKLEN - 1)) == 0) { memcpy(buffer, counter, BLOCKLEN); state = (state_t*)buffer; @@ -629,7 +629,7 @@ void AES_CTR_xcrypt_buffer(uint8_t* output, uint8_t* input, uint32_t length, con } } - output[i] = (input[i] ^ buffer[(i & 0x0F)]); + output[i] = (input[i] ^ buffer[(i & (BLOCKLEN - 1))]); } } |