crypto/aes/aes_cbc.c:74: error: INTEGER_OVERFLOW_L2
  ([1, `length`] - 16):unsigned64.
Showing all 4 steps of the trace


crypto/aes/aes_cbc.c:56:1: <LHS trace>
54.   #include "aes_locl.h"
55.   
56. > void AES_cbc_encrypt(const unsigned char *in, unsigned char *out,
57.   		     const unsigned long length, const AES_KEY *key,
58.   		     unsigned char *ivec, const int enc) {

crypto/aes/aes_cbc.c:56:1: Parameter `length`
54.   #include "aes_locl.h"
55.   
56. > void AES_cbc_encrypt(const unsigned char *in, unsigned char *out,
57.   		     const unsigned long length, const AES_KEY *key,
58.   		     unsigned char *ivec, const int enc) {

crypto/aes/aes_cbc.c:61:2: Assignment
59.   
60.   	int n;
61.   	unsigned long len = length;
       ^
62.   	unsigned char tmp[16];
63.   

crypto/aes/aes_cbc.c:74:4: Binary operation: ([1, length] - 16):unsigned64
72.   			AES_encrypt(tmp, out, key);
73.   			memcpy(ivec, out, 16);
74.   			len -= 16;
         ^
75.   			in += 16;
76.   			out += 16;

void AES_cbc_encrypt(const unsigned char *in, unsigned char *out,
		     const unsigned long length, const AES_KEY *key,
		     unsigned char *ivec, const int enc) {
	int n;
	unsigned long len = length;
	unsigned char tmp[16];
	assert(in && out && key && ivec);
	assert(length % AES_BLOCK_SIZE == 0);
	assert((AES_ENCRYPT == enc)||(AES_DECRYPT == enc));
	if (AES_ENCRYPT == enc)
		while (len > 0) {
			for(n=0; n < 16; ++n)
				tmp[n] = in[n] ^ ivec[n];
			AES_encrypt(tmp, out, key);
			memcpy(ivec, out, 16);
			len -= 16;
			in += 16;
			out += 16;
		}
	else
		while (len > 0) {
			memcpy(tmp, in, 16);
			AES_decrypt(in, out, key);
			for(n=0; n < 16; ++n)
				out[n] ^= ivec[n];
			memcpy(ivec, tmp, 16);
			len -= 16;
			in += 16;
			out += 16;
		}
}
['void AES_cbc_encrypt(const unsigned char *in, unsigned char *out,\n\t\t     const unsigned long length, const AES_KEY *key,\n\t\t     unsigned char *ivec, const int enc) {\n\tint n;\n\tunsigned long len = length;\n\tunsigned char tmp[16];\n\tassert(in && out && key && ivec);\n\tassert(length % AES_BLOCK_SIZE == 0);\n\tassert((AES_ENCRYPT == enc)||(AES_DECRYPT == enc));\n\tif (AES_ENCRYPT == enc)\n\t\twhile (len > 0) {\n\t\t\tfor(n=0; n < 16; ++n)\n\t\t\t\ttmp[n] = in[n] ^ ivec[n];\n\t\t\tAES_encrypt(tmp, out, key);\n\t\t\tmemcpy(ivec, out, 16);\n\t\t\tlen -= 16;\n\t\t\tin += 16;\n\t\t\tout += 16;\n\t\t}\n\telse\n\t\twhile (len > 0) {\n\t\t\tmemcpy(tmp, in, 16);\n\t\t\tAES_decrypt(in, out, key);\n\t\t\tfor(n=0; n < 16; ++n)\n\t\t\t\tout[n] ^= ivec[n];\n\t\t\tmemcpy(ivec, tmp, 16);\n\t\t\tlen -= 16;\n\t\t\tin += 16;\n\t\t\tout += 16;\n\t\t}\n}']