Merge pull request #326 from libtom/pr/ccm_process

fixes #323 ccm_process fails to process input buffer longer than 256
(cherry picked from commit 7c4c61d7ef)
This commit is contained in:
Steffen Jaeckel 2017-11-10 00:41:50 +01:00 committed by Steffen Jaeckel
parent 153b897984
commit 368dc60ff3

View File

@ -24,7 +24,8 @@ int ccm_process(ccm_state *ccm,
unsigned char *ct,
int direction)
{
unsigned char y, z, b;
unsigned char z, b;
unsigned long y;
int err;
LTC_ARGCHK(ccm != NULL);
@ -44,9 +45,8 @@ int ccm_process(ccm_state *ccm,
if (ptlen > 0) {
LTC_ARGCHK(pt != NULL);
LTC_ARGCHK(ct != NULL);
y = 0;
for (; y < ptlen; y++) {
for (y = 0; y < ptlen; y++) {
/* increment the ctr? */
if (ccm->CTRlen == 16) {
for (z = 15; z > 15-ccm->L; z--) {