unsigned long n;
unsigned long len = length;
- unsigned char tmp[AES_BLOCK_SIZE], *iv = ivec;
+ unsigned char tmp[AES_BLOCK_SIZE];
+ const unsigned char *iv = ivec;
assert(in && out && key && ivec);
assert((AES_ENCRYPT == enc)||(AES_DECRYPT == enc));
out[n] = iv[n];
AES_encrypt(out, out, key);
iv = out;
- }
+ }
memcpy(ivec,iv,AES_BLOCK_SIZE);
} else if (in != out) {
while (len >= AES_BLOCK_SIZE) {
for(n=0; n < len; ++n)
out[n] = tmp[n] ^ ivec[n];
memcpy(ivec, tmp, AES_BLOCK_SIZE);
- }
+ }
}
}