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


test/bntest.c:1960:33: Call
1958.       BN_zero(zero);
1959.   
1960.       if (!BN_mod_exp(r, a, zero, BN_value_one(), NULL)
                                        ^
1961.               || !BN_is_zero(r)
1962.               || !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:1960:10: Call
1958.       BN_zero(zero);
1959.   
1960.       if (!BN_mod_exp(r, a, zero, BN_value_one(), NULL)
                 ^
1961.               || !BN_is_zero(r)
1962.               || !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:143:9: Call
  141.       /* if ((m->d[m->top-1]&BN_TBIT) && BN_is_odd(m)) */
  142.   
  143.       if (BN_is_odd(m)) {
                 ^
  144.   # ifdef MONT_EXP_WORD
  145.           if (a->top == 1 && !a->neg

crypto/bn/bn_lib.c:935:1: Parameter `*a->d`
    933.   }
    934.   
    935. > int BN_is_odd(const BIGNUM *a)
    936.   {
    937.       return (a->top > 0) && (a->d[0] & 1);

crypto/bn/bn_exp.c:151:19: Call
  149.           } else
  150.   # endif
  151.               ret = BN_mod_exp_mont(r, a, p, m, ctx, NULL);
                           ^
  152.       } else
  153.   #endif

crypto/bn/bn_exp.c:301:1: <RHS trace>
299.   }
300.   
301. > int BN_mod_exp_mont(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p,
302.                       const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *in_mont)
303.   {

crypto/bn/bn_exp.c:301:1: Parameter `*m->d`
    299.   }
    300.   
    301. > int BN_mod_exp_mont(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p,
    302.                       const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *in_mont)
    303.   {

crypto/bn/bn_exp.c:320:10: Call
    318.       bn_check_top(m);
    319.   
    320.       if (!BN_is_odd(m)) {
                    ^
    321.           BNerr(BN_F_BN_MOD_EXP_MONT, BN_R_CALLED_WITH_EVEN_MODULUS);
    322.           return (0);

crypto/bn/bn_lib.c:935:1: Parameter `*a->d`
      933.   }
      934.   
      935. > int BN_is_odd(const BIGNUM *a)
      936.   {
      937.       return (a->top > 0) && (a->d[0] & 1);

crypto/bn/bn_exp.c:356:19: Call
    354.       }
    355.   
    356.       if (a->neg || BN_ucmp(a, m) >= 0) {
                             ^
    357.           if (!BN_nnmod(val[0], a, m, ctx))
    358.               goto err;

crypto/bn/bn_lib.c:623:1: Parameter `*b->d`
      621.   }
      622.   
      623. > int BN_ucmp(const BIGNUM *a, const BIGNUM *b)
      624.   {
      625.       int i;

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