test/bntest.c:1960: error: INTEGER_OVERFLOW_L1
  (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: 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:313:16: Call
    311.   
    312.       if (BN_get_flags(p, BN_FLG_CONSTTIME) != 0) {
    313.           return BN_mod_exp_mont_consttime(rr, a, p, m, ctx, in_mont);
                          ^
    314.       }
    315.   

crypto/bn/bn_exp.c:601:1: <RHS trace>
599.    * http://www.daemonology.net/hyperthreading-considered-harmful/)
600.    */
601. > int BN_mod_exp_mont_consttime(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p,
602.                                 const BIGNUM *m, BN_CTX *ctx,
603.                                 BN_MONT_CTX *in_mont)

crypto/bn/bn_exp.c:601:1: Parameter `*m->d`
      599.    * http://www.daemonology.net/hyperthreading-considered-harmful/)
      600.    */
      601. > int BN_mod_exp_mont_consttime(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p,
      602.                                 const BIGNUM *m, BN_CTX *ctx,
      603.                                 BN_MONT_CTX *in_mont)

crypto/bn/bn_exp.c:622:10: Call
      620.       bn_check_top(m);
      621.   
      622.       if (!BN_is_odd(m)) {
                      ^
      623.           BNerr(BN_F_BN_MOD_EXP_MONT_CONSTTIME, BN_R_CALLED_WITH_EVEN_MODULUS);
      624.           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:743:9: Binary operation: (0 - 1):unsigned64 by call to `BN_mod_exp` 
      741.       if (m->d[top - 1] & (((BN_ULONG)1) << (BN_BITS2 - 1))) {
      742.           /* 2^(top*BN_BITS2) - m */
      743.           tmp.d[0] = (0 - m->d[0]) & BN_MASK2;
                     ^
      744.           for (i = 1; i < top; i++)
      745.               tmp.d[i] = (~m->d[i]) & BN_MASK2;
