crypto/rand/drbg_rand.c:183: error: INTEGER_OVERFLOW_L2
  (16 - [1, 68]):unsigned64 by call to `ctr_BCC_final`.
Showing all 13 steps of the trace


crypto/rand/drbg_rand.c:178:5: Assignment
176.       *p++ = 0;
177.       *p = (unsigned char)((ctr->keylen + 16) & 0xff);
178.       ctr->bltmp_pos = 8;
           ^
179.       ctr_BCC_update(ctr, in1, in1len);
180.       ctr_BCC_update(ctr, in2, in2len);

crypto/rand/drbg_rand.c:179:5: Call
177.       *p = (unsigned char)((ctr->keylen + 16) & 0xff);
178.       ctr->bltmp_pos = 8;
179.       ctr_BCC_update(ctr, in1, in1len);
           ^
180.       ctr_BCC_update(ctr, in2, in2len);
181.       ctr_BCC_update(ctr, in3, in3len);

crypto/rand/drbg_rand.c:110:1: Parameter `ctr->bltmp_pos`
  108.    * Process several blocks into BCC algorithm, some possibly partial
  109.    */
  110. > static void ctr_BCC_update(RAND_DRBG_CTR *ctr,
  111.                              const unsigned char *in, size_t inlen)
  112.   {

crypto/rand/drbg_rand.c:180:5: Call
178.       ctr->bltmp_pos = 8;
179.       ctr_BCC_update(ctr, in1, in1len);
180.       ctr_BCC_update(ctr, in2, in2len);
           ^
181.       ctr_BCC_update(ctr, in3, in3len);
182.       ctr_BCC_update(ctr, &c80, 1);

crypto/rand/drbg_rand.c:110:1: Parameter `ctr->bltmp_pos`
  108.    * Process several blocks into BCC algorithm, some possibly partial
  109.    */
  110. > static void ctr_BCC_update(RAND_DRBG_CTR *ctr,
  111.                              const unsigned char *in, size_t inlen)
  112.   {

crypto/rand/drbg_rand.c:181:5: Call
179.       ctr_BCC_update(ctr, in1, in1len);
180.       ctr_BCC_update(ctr, in2, in2len);
181.       ctr_BCC_update(ctr, in3, in3len);
           ^
182.       ctr_BCC_update(ctr, &c80, 1);
183.       ctr_BCC_final(ctr);

crypto/rand/drbg_rand.c:110:1: Parameter `ctr->bltmp_pos`
  108.    * Process several blocks into BCC algorithm, some possibly partial
  109.    */
  110. > static void ctr_BCC_update(RAND_DRBG_CTR *ctr,
  111.                              const unsigned char *in, size_t inlen)
  112.   {

crypto/rand/drbg_rand.c:182:5: Call
180.       ctr_BCC_update(ctr, in2, in2len);
181.       ctr_BCC_update(ctr, in3, in3len);
182.       ctr_BCC_update(ctr, &c80, 1);
           ^
183.       ctr_BCC_final(ctr);
184.       /* Set up key K */

crypto/rand/drbg_rand.c:110:1: Parameter `ctr->bltmp_pos`
  108.    * Process several blocks into BCC algorithm, some possibly partial
  109.    */
  110. > static void ctr_BCC_update(RAND_DRBG_CTR *ctr,
  111.                              const unsigned char *in, size_t inlen)
  112.   {

crypto/rand/drbg_rand.c:183:5: Call
181.       ctr_BCC_update(ctr, in3, in3len);
182.       ctr_BCC_update(ctr, &c80, 1);
183.       ctr_BCC_final(ctr);
           ^
184.       /* Set up key K */
185.       AES_set_encrypt_key(ctr->KX, ctr->keylen * 8, &ctr->df_kxks);

crypto/rand/drbg_rand.c:142:1: <RHS trace>
140.   }
141.   
142. > static void ctr_BCC_final(RAND_DRBG_CTR *ctr)
143.   {
144.       if (ctr->bltmp_pos) {

crypto/rand/drbg_rand.c:142:1: Parameter `ctr->bltmp_pos`
  140.   }
  141.   
  142. > static void ctr_BCC_final(RAND_DRBG_CTR *ctr)
  143.   {
  144.       if (ctr->bltmp_pos) {

crypto/rand/drbg_rand.c:145:9: Binary operation: (16 - [1, 68]):unsigned64 by call to `ctr_BCC_final` 
  143.   {
  144.       if (ctr->bltmp_pos) {
  145.           memset(ctr->bltmp + ctr->bltmp_pos, 0, 16 - ctr->bltmp_pos);
                 ^
  146.           ctr_BCC_blocks(ctr, ctr->bltmp);
  147.       }

static void ctr_BCC_final(RAND_DRBG_CTR *ctr)
{
    if (ctr->bltmp_pos) {
        memset(ctr->bltmp + ctr->bltmp_pos, 0, 16 - ctr->bltmp_pos);
        ctr_BCC_blocks(ctr, ctr->bltmp);
    }
}
['static void ctr_df(RAND_DRBG_CTR *ctr,\n                   const unsigned char *in1, size_t in1len,\n                   const unsigned char *in2, size_t in2len,\n                   const unsigned char *in3, size_t in3len)\n{\n    static unsigned char c80 = 0x80;\n    size_t inlen;\n    unsigned char *p = ctr->bltmp;\n    ctr_BCC_init(ctr);\n    if (in1 == NULL)\n        in1len = 0;\n    if (in2 == NULL)\n        in2len = 0;\n    if (in3 == NULL)\n        in3len = 0;\n    inlen = in1len + in2len + in3len;\n    *p++ = (inlen >> 24) & 0xff;\n    *p++ = (inlen >> 16) & 0xff;\n    *p++ = (inlen >> 8) & 0xff;\n    *p++ = inlen & 0xff;\n    *p++ = 0;\n    *p++ = 0;\n    *p++ = 0;\n    *p = (unsigned char)((ctr->keylen + 16) & 0xff);\n    ctr->bltmp_pos = 8;\n    ctr_BCC_update(ctr, in1, in1len);\n    ctr_BCC_update(ctr, in2, in2len);\n    ctr_BCC_update(ctr, in3, in3len);\n    ctr_BCC_update(ctr, &c80, 1);\n    ctr_BCC_final(ctr);\n    AES_set_encrypt_key(ctr->KX, ctr->keylen * 8, &ctr->df_kxks);\n    AES_encrypt(ctr->KX + ctr->keylen, ctr->KX, &ctr->df_kxks);\n    AES_encrypt(ctr->KX, ctr->KX + 16, &ctr->df_kxks);\n    if (ctr->keylen != 16)\n        AES_encrypt(ctr->KX + 16, ctr->KX + 32, &ctr->df_kxks);\n}', 'static void ctr_BCC_update(RAND_DRBG_CTR *ctr,\n                           const unsigned char *in, size_t inlen)\n{\n    if (in == NULL || inlen == 0)\n        return;\n    if (ctr->bltmp_pos) {\n        size_t left = 16 - ctr->bltmp_pos;\n        if (inlen >= left) {\n            memcpy(ctr->bltmp + ctr->bltmp_pos, in, left);\n            ctr_BCC_blocks(ctr, ctr->bltmp);\n            ctr->bltmp_pos = 0;\n            inlen -= left;\n            in += left;\n        }\n    }\n    for (; inlen >= 16; in += 16, inlen -= 16) {\n        ctr_BCC_blocks(ctr, in);\n    }\n    if (inlen > 0) {\n        memcpy(ctr->bltmp + ctr->bltmp_pos, in, inlen);\n        ctr->bltmp_pos += inlen;\n    }\n}', 'static void ctr_BCC_final(RAND_DRBG_CTR *ctr)\n{\n    if (ctr->bltmp_pos) {\n        memset(ctr->bltmp + ctr->bltmp_pos, 0, 16 - ctr->bltmp_pos);\n        ctr_BCC_blocks(ctr, ctr->bltmp);\n    }\n}']