crypto/bn/bn_sqrt.c:148: error: INTEGER_OVERFLOW_L2
  ([0, 6+max(0, `ctx->stack.depth`)] - 1):unsigned32 by call to `BN_mod_exp`.
Showing all 37 steps of the trace


crypto/bn/bn_sqrt.c:63:1: Parameter `ctx->stack.depth`
61.   #include "bn_lcl.h"
62.   
63. > BIGNUM *BN_mod_sqrt(BIGNUM *in, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx)
64.   /*
65.    * Returns 'ret' such that ret^2 == a (mod p), using the Tonelli/Shanks

crypto/bn/bn_sqrt.c:109:5: Call
107.       }
108.   
109.       BN_CTX_start(ctx);
           ^
110.       A = BN_CTX_get(ctx);
111.       b = BN_CTX_get(ctx);

crypto/bn/bn_ctx.c:236:1: Parameter `ctx->stack.depth`
  234.   }
  235.   
  236. > void BN_CTX_start(BN_CTX *ctx)
  237.   {
  238.       CTXDBG_ENTRY("BN_CTX_start", ctx);

crypto/bn/bn_sqrt.c:125:10: Call
123.   
124.       /* A = a mod p */
125.       if (!BN_nnmod(A, a, p, ctx))
                ^
126.           goto end;
127.   

crypto/bn/bn_mod.c:119:1: Parameter `ctx->stack.depth`
  117.   #include "bn_lcl.h"
  118.   
  119. > int BN_nnmod(BIGNUM *r, const BIGNUM *m, const BIGNUM *d, BN_CTX *ctx)
  120.   {
  121.       /*

crypto/bn/bn_mod.c:126:11: Call
  124.        */
  125.   
  126.       if (!(BN_mod(r, m, d, ctx)))
                   ^
  127.           return 0;
  128.       if (!r->neg)

crypto/bn/bn_div.c:189:1: Parameter `ctx->stack.depth`
    187.    * If 'dv' or 'rm' is NULL, the respective value is not returned.
    188.    */
    189. > int BN_div(BIGNUM *dv, BIGNUM *rm, const BIGNUM *num, const BIGNUM *divisor,
    190.              BN_CTX *ctx)
    191.   {

crypto/bn/bn_sqrt.c:148:14: Call
146.           if (!BN_add_word(q, 1))
147.               goto end;
148.           if (!BN_mod_exp(ret, A, q, p, ctx))
                    ^
149.               goto end;
150.           err = 0;

crypto/bn/bn_exp.c:191:1: Parameter `ctx->stack.depth`
  189.   }
  190.   
  191. > int BN_mod_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, const BIGNUM *m,
  192.                  BN_CTX *ctx)
  193.   {

crypto/bn/bn_exp.c:248:19: Call
  246.               && (BN_get_flags(p, BN_FLG_CONSTTIME) == 0)) {
  247.               BN_ULONG A = a->d[0];
  248.               ret = BN_mod_exp_mont_word(r, A, p, m, ctx, NULL);
                           ^
  249.           } else
  250.   # endif

crypto/bn/bn_exp.c:1135:1: Parameter `ctx->stack.depth`
    1133.   }
    1134.   
    1135. > int BN_mod_exp_mont_word(BIGNUM *rr, BN_ULONG a, const BIGNUM *p,
    1136.                            const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *in_mont)
    1137.   {

crypto/bn/bn_exp.c:1193:5: Call
    1191.       }
    1192.   
    1193.       BN_CTX_start(ctx);
                ^
    1194.       d = BN_CTX_get(ctx);
    1195.       r = BN_CTX_get(ctx);

crypto/bn/bn_ctx.c:236:1: Parameter `ctx->stack.depth`
      234.   }
      235.   
      236. > void BN_CTX_start(BN_CTX *ctx)
      237.   {
      238.       CTXDBG_ENTRY("BN_CTX_start", ctx);

crypto/bn/bn_exp.c:1205:14: Call
    1203.           if ((mont = BN_MONT_CTX_new()) == NULL)
    1204.               goto err;
    1205.           if (!BN_MONT_CTX_set(mont, m, ctx))
                         ^
    1206.               goto err;
    1207.       }

crypto/bn/bn_mont.c:349:1: Parameter `ctx->stack.depth`
      347.   }
      348.   
      349. > int BN_MONT_CTX_set(BN_MONT_CTX *mont, const BIGNUM *mod, BN_CTX *ctx)
      350.   {
      351.       int ret = 0;

crypto/bn/bn_mont.c:357:5: Call
      355.           return 0;
      356.   
      357.       BN_CTX_start(ctx);
                 ^
      358.       if ((Ri = BN_CTX_get(ctx)) == NULL)
      359.           goto err;

crypto/bn/bn_ctx.c:236:1: Parameter `ctx->stack.depth`
        234.   }
        235.   
        236. > void BN_CTX_start(BN_CTX *ctx)
        237.   {
        238.       CTXDBG_ENTRY("BN_CTX_start", ctx);

crypto/bn/bn_mont.c:428:14: Call
      426.           tmod.top = buf[0] != 0 ? 1 : 0;
      427.           /* Ri = R^-1 mod N */
      428.           if ((BN_mod_inverse(Ri, R, &tmod, ctx)) == NULL)
                          ^
      429.               goto err;
      430.           if (!BN_lshift(Ri, Ri, BN_BITS2))

crypto/bn/bn_gcd.c:226:1: Parameter `ctx->stack.depth`
        224.                                           BN_CTX *ctx);
        225.   
        226. > BIGNUM *BN_mod_inverse(BIGNUM *in,
        227.                          const BIGNUM *a, const BIGNUM *n, BN_CTX *ctx)
        228.   {

crypto/bn/bn_gcd.c:231:10: Call
        229.       BIGNUM *rv;
        230.       int noinv;
        231.       rv = int_bn_mod_inverse(in, a, n, ctx, &noinv);
                        ^
        232.       if (noinv)
        233.           BNerr(BN_F_BN_MOD_INVERSE, BN_R_NO_INVERSE);

crypto/bn/bn_gcd.c:237:1: Parameter `ctx->stack.depth`
          235.   }
          236.   
          237. > BIGNUM *int_bn_mod_inverse(BIGNUM *in,
          238.                              const BIGNUM *a, const BIGNUM *n, BN_CTX *ctx,
          239.                              int *pnoinv)

crypto/bn/bn_gcd.c:250:16: Call
          248.       if ((BN_get_flags(a, BN_FLG_CONSTTIME) != 0)
          249.           || (BN_get_flags(n, BN_FLG_CONSTTIME) != 0)) {
          250.           return BN_mod_inverse_no_branch(in, a, n, ctx);
                                ^
          251.       }
          252.   

crypto/bn/bn_gcd.c:557:1: Parameter `ctx->stack.depth`
            555.    * not contain branches that may leak sensitive information.
            556.    */
            557. > static BIGNUM *BN_mod_inverse_no_branch(BIGNUM *in,
            558.                                           const BIGNUM *a, const BIGNUM *n,
            559.                                           BN_CTX *ctx)

crypto/bn/bn_gcd.c:568:5: Call
            566.       bn_check_top(n);
            567.   
            568.       BN_CTX_start(ctx);
                       ^
            569.       A = BN_CTX_get(ctx);
            570.       B = BN_CTX_get(ctx);

crypto/bn/bn_ctx.c:236:1: Parameter `ctx->stack.depth`
              234.   }
              235.   
              236. > void BN_CTX_start(BN_CTX *ctx)
              237.   {
              238.       CTXDBG_ENTRY("BN_CTX_start", ctx);

crypto/bn/bn_gcd.c:603:18: Call
            601.               bn_init(&local_B);
            602.               BN_with_flags(&local_B, B, BN_FLG_CONSTTIME);
            603.               if (!BN_nnmod(B, &local_B, A, ctx))
                                    ^
            604.                   goto err;
            605.               /* Ensure local_B goes out of scope before any further use of B */

crypto/bn/bn_mod.c:119:1: Parameter `ctx->stack.depth`
              117.   #include "bn_lcl.h"
              118.   
              119. > int BN_nnmod(BIGNUM *r, const BIGNUM *m, const BIGNUM *d, BN_CTX *ctx)
              120.   {
              121.       /*

crypto/bn/bn_mod.c:126:11: Call
              124.        */
              125.   
              126.       if (!(BN_mod(r, m, d, ctx)))
                               ^
              127.           return 0;
              128.       if (!r->neg)

crypto/bn/bn_div.c:189:1: Parameter `ctx->stack.depth`
                187.    * If 'dv' or 'rm' is NULL, the respective value is not returned.
                188.    */
                189. > int BN_div(BIGNUM *dv, BIGNUM *rm, const BIGNUM *num, const BIGNUM *divisor,
                190.              BN_CTX *ctx)
                191.   {

crypto/bn/bn_div.c:242:5: Call
                240.       }
                241.   
                242.       BN_CTX_start(ctx);
                           ^
                243.       tmp = BN_CTX_get(ctx);
                244.       snum = BN_CTX_get(ctx);

crypto/bn/bn_ctx.c:236:1: Parameter `ctx->stack.depth`
                  234.   }
                  235.   
                  236. > void BN_CTX_start(BN_CTX *ctx)
                  237.   {
                  238.       CTXDBG_ENTRY("BN_CTX_start", ctx);

crypto/bn/bn_div.c:469:5: Call
                467.       if (no_branch)
                468.           bn_correct_top(res);
                469.       BN_CTX_end(ctx);
                           ^
                470.       return (1);
                471.    err:

crypto/bn/bn_ctx.c:250:1: Parameter `ctx->stack.depth`
                  248.   }
                  249.   
                  250. > void BN_CTX_end(BN_CTX *ctx)
                  251.   {
                  252.       CTXDBG_ENTRY("BN_CTX_end", ctx);

crypto/bn/bn_ctx.c:256:27: Call
                  254.           ctx->err_stack--;
                  255.       else {
                  256.           unsigned int fp = BN_STACK_pop(&ctx->stack);
                                                   ^
                  257.           /* Does this stack frame have anything to release? */
                  258.           if (fp < ctx->used)

crypto/bn/bn_ctx.c:326:1: <LHS trace>
324.   }
325.   
326. > static unsigned int BN_STACK_pop(BN_STACK *st)
327.   {
328.       return st->indexes[--(st->depth)];

crypto/bn/bn_ctx.c:326:1: Parameter `st->depth`
                    324.   }
                    325.   
                    326. > static unsigned int BN_STACK_pop(BN_STACK *st)
                    327.   {
                    328.       return st->indexes[--(st->depth)];

crypto/bn/bn_ctx.c:328:12: Binary operation: ([0, 6+max(0, ctx->stack.depth)] - 1):unsigned32 by call to `BN_mod_exp` 
                    326.   static unsigned int BN_STACK_pop(BN_STACK *st)
                    327.   {
                    328.       return st->indexes[--(st->depth)];
                                      ^
                    329.   }
                    330.   
