test/bntest.c:2183: error: INTEGER_OVERFLOW_L2
  (0 - [0, 1]):unsigned64 by call to `BN_mod_exp`.
Showing all 17 steps of the trace


test/bntest.c:2183:10: Call
2181.       BN_zero(zero);
2182.   
2183.       if (!TEST_true(BN_mod_exp(r, a, zero, BN_value_one(), NULL))
                 ^
2184.               || !TEST_BN_eq_zero(r)
2185.               || !TEST_true(BN_mod_exp_mont(r, a, zero, BN_value_one(),

crypto/bn/bn_lib.c:83:5: Assignment
  81.   const BIGNUM *BN_value_one(void)
  82.   {
  83.       static const BN_ULONG data_one = 1L;
            ^
  84.       static const BIGNUM const_one =
  85.           { (BN_ULONG *)&data_one, 1, 1, 0, BN_FLG_STATIC_DATA };

test/bntest.c:2183:10: Call
2181.       BN_zero(zero);
2182.   
2183.       if (!TEST_true(BN_mod_exp(r, a, zero, BN_value_one(), NULL))
                 ^
2184.               || !TEST_BN_eq_zero(r)
2185.               || !TEST_true(BN_mod_exp_mont(r, a, zero, BN_value_one(),

crypto/bn/bn_exp.c:89:1: Parameter `*m->d`
  87.   }
  88.   
  89. > int BN_mod_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, const BIGNUM *m,
  90.                  BN_CTX *ctx)
  91.   {

crypto/bn/bn_exp.c:134:9: Call
  132.   
  133.   #ifdef MONT_MUL_MOD
  134.       if (BN_is_odd(m)) {
                 ^
  135.   # ifdef MONT_EXP_WORD
  136.           if (a->top == 1 && !a->neg

crypto/bn/bn_lib.c:920:1: Parameter `*a->d`
    918.   }
    919.   
    920. > int BN_is_odd(const BIGNUM *a)
    921.   {
    922.       return (a->top > 0) && (a->d[0] & 1);

crypto/bn/bn_exp.c:149:15: Call
  147.   #ifdef RECP_MUL_MOD
  148.       {
  149.           ret = BN_mod_exp_recp(r, a, p, m, ctx);
                       ^
  150.       }
  151.   #else

crypto/bn/bn_exp.c:161:1: Parameter `*m->d`
    159.   }
    160.   
    161. > int BN_mod_exp_recp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
    162.                       const BIGNUM *m, BN_CTX *ctx)
    163.   {

crypto/bn/bn_exp.c:206:13: Call
    204.               goto err;
    205.       } else {
    206.           if (BN_RECP_CTX_set(&recp, m, ctx) <= 0)
                       ^
    207.               goto err;
    208.       }

crypto/bn/bn_recp.c:45:1: Parameter `*d->d`
      43.   }
      44.   
      45. > int BN_RECP_CTX_set(BN_RECP_CTX *recp, const BIGNUM *d, BN_CTX *ctx)
      46.   {
      47.       if (!BN_copy(&(recp->N), d))

crypto/bn/bn_recp.c:50:22: Call
      48.           return 0;
      49.       BN_zero(&(recp->Nr));
      50.       recp->num_bits = BN_num_bits(d);
                                 ^
      51.       recp->shift = 0;
      52.       return 1;

crypto/bn/bn_lib.c:165:1: Parameter `*a->d`
        163.   }
        164.   
        165. > int BN_num_bits(const BIGNUM *a)
        166.   {
        167.       int i = a->top - 1;

crypto/bn/bn_lib.c:186:30: Call
        184.           return 0;
        185.   
        186.       return ((i * BN_BITS2) + BN_num_bits_word(a->d[i]));
                                            ^
        187.   }
        188.   

crypto/bn/bn_lib.c:90:1: <RHS trace>
88.   }
89.   
90. > int BN_num_bits_word(BN_ULONG l)
91.   {
92.       BN_ULONG x, mask;

crypto/bn/bn_lib.c:90:1: Parameter `l`
          88.   }
          89.   
          90. > int BN_num_bits_word(BN_ULONG l)
          91.   {
          92.       BN_ULONG x, mask;

crypto/bn/bn_lib.c:96:5: Assignment
          94.   
          95.   #if BN_BITS2 > 32
          96.       x = l >> 32;
                    ^
          97.       mask = (0 - x) & BN_MASK2;
          98.       mask = (0 - (mask >> (BN_BITS2 - 1)));

crypto/bn/bn_lib.c:97:5: Binary operation: (0 - [0, 1]):unsigned64 by call to `BN_mod_exp` 
          95.   #if BN_BITS2 > 32
          96.       x = l >> 32;
          97.       mask = (0 - x) & BN_MASK2;
                     ^
          98.       mask = (0 - (mask >> (BN_BITS2 - 1)));
          99.       bits += 32 & mask;
