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


test/bntest.c:2048:33: Call
2046.       BN_zero(zero);
2047.   
2048.       if (!BN_mod_exp(r, a, zero, BN_value_one(), NULL)
                                        ^
2049.               || !BN_is_zero(r)
2050.               || !BN_mod_exp_mont(r, a, zero, BN_value_one(), NULL, NULL)

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

test/bntest.c:2048:10: Call
2046.       BN_zero(zero);
2047.   
2048.       if (!BN_mod_exp(r, a, zero, BN_value_one(), NULL)
                 ^
2049.               || !BN_is_zero(r)
2050.               || !BN_mod_exp_mont(r, a, zero, BN_value_one(), NULL, NULL)

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

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

crypto/bn/bn_lib.c:865:1: Parameter `*a->d`
    863.   }
    864.   
    865. > int BN_is_odd(const BIGNUM *a)
    866.   {
    867.       return (a->top > 0) && (a->d[0] & 1);

crypto/bn/bn_exp.c:144:19: Call
  142.           } else
  143.   # endif
  144.               ret = BN_mod_exp_mont(r, a, p, m, ctx, NULL);
                           ^
  145.       } else
  146.   #endif

crypto/bn/bn_exp.c:294:1: <RHS trace>
292.   }
293.   
294. > int BN_mod_exp_mont(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p,
295.                       const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *in_mont)
296.   {

crypto/bn/bn_exp.c:294:1: Parameter `*m->d`
    292.   }
    293.   
    294. > int BN_mod_exp_mont(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p,
    295.                       const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *in_mont)
    296.   {

crypto/bn/bn_exp.c:313:10: Call
    311.       bn_check_top(m);
    312.   
    313.       if (!BN_is_odd(m)) {
                    ^
    314.           BNerr(BN_F_BN_MOD_EXP_MONT, BN_R_CALLED_WITH_EVEN_MODULUS);
    315.           return (0);

crypto/bn/bn_lib.c:865:1: Parameter `*a->d`
      863.   }
      864.   
      865. > int BN_is_odd(const BIGNUM *a)
      866.   {
      867.       return (a->top > 0) && (a->d[0] & 1);

crypto/bn/bn_exp.c:349:19: Call
    347.       }
    348.   
    349.       if (a->neg || BN_ucmp(a, m) >= 0) {
                             ^
    350.           if (!BN_nnmod(val[0], a, m, ctx))
    351.               goto err;

crypto/bn/bn_lib.c:553:1: Parameter `*b->d`
      551.   }
      552.   
      553. > int BN_ucmp(const BIGNUM *a, const BIGNUM *b)
      554.   {
      555.       int i;

crypto/bn/bn_exp.c:388:9: Binary operation: (0 - [0, 1]):unsigned64 by call to `BN_mod_exp` 
    386.               goto err;
    387.           /* 2^(top*BN_BITS2) - m */
    388.           r->d[0] = (0 - m->d[0]) & BN_MASK2;
                   ^
    389.           for (i = 1; i < j; i++)
    390.               r->d[i] = (~m->d[i]) & BN_MASK2;
