crypto/bn/bn_gf2m.c:756: error: INTEGER_OVERFLOW_L2
  ([0, +oo] - 1):unsigned64 by call to `BN_GF2m_mod_sqr_arr`.
Showing all 6 steps of the trace


crypto/bn/bn_gf2m.c:751:7: Call
749.   	if ((u = BN_CTX_get(ctx)) == NULL) goto err;
750.   	
751.   	if (!BN_GF2m_mod_arr(u, a, p)) goto err;
             ^
752.   	
753.   	n = BN_num_bits(b) - 1;

crypto/bn/bn_gf2m.c:261:1: Parameter `r->top`
  259.   
  260.   /* Performs modular reduction of a and store result in r.  r could be a. */
  261. > int BN_GF2m_mod_arr(BIGNUM *r, const BIGNUM *a, const int p[])
  262.   	{
  263.   	int j, k;

crypto/bn/bn_gf2m.c:756:8: Call
754.   	for (i = n - 1; i >= 0; i--)
755.   		{
756.   		if (!BN_GF2m_mod_sqr_arr(u, u, p, ctx)) goto err;
              ^
757.   		if (BN_is_bit_set(b, i))
758.   			{

crypto/bn/bn_gf2m.c:461:1: <LHS trace>
459.   
460.   /* Square a, reduce the result mod p, and store it in a.  r could be a. */
461. > int	BN_GF2m_mod_sqr_arr(BIGNUM *r, const BIGNUM *a, const int p[], BN_CTX *ctx)
462.   	{
463.   	int i, ret = 0;

crypto/bn/bn_gf2m.c:461:1: Parameter `a->top`
  459.   
  460.   /* Square a, reduce the result mod p, and store it in a.  r could be a. */
  461. > int	BN_GF2m_mod_sqr_arr(BIGNUM *r, const BIGNUM *a, const int p[], BN_CTX *ctx)
  462.   	{
  463.   	int i, ret = 0;

crypto/bn/bn_gf2m.c:471:7: Binary operation: ([0, +oo] - 1):unsigned64 by call to `BN_GF2m_mod_sqr_arr` 
  469.   	if (!bn_wexpand(s, 2 * a->top)) goto err;
  470.   
  471.   	for (i = a->top - 1; i >= 0; i--)
               ^
  472.   		{
  473.   		s->d[2*i+1] = SQR1(a->d[i]);

int	BN_GF2m_mod_sqr_arr(BIGNUM *r, const BIGNUM *a, const int p[], BN_CTX *ctx)
	{
	int i, ret = 0;
	BIGNUM *s;
	bn_check_top(a);
	BN_CTX_start(ctx);
	if ((s = BN_CTX_get(ctx)) == NULL) return 0;
	if (!bn_wexpand(s, 2 * a->top)) goto err;
	for (i = a->top - 1; i >= 0; i--)
		{
		s->d[2*i+1] = SQR1(a->d[i]);
		s->d[2*i  ] = SQR0(a->d[i]);
		}
	s->top = 2 * a->top;
	bn_correct_top(s);
	if (!BN_GF2m_mod_arr(r, s, p)) goto err;
	bn_check_top(r);
	ret = 1;
err:
	BN_CTX_end(ctx);
	return ret;
	}
['int\tBN_GF2m_mod_exp_arr(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const int p[], BN_CTX *ctx)\n\t{\n\tint ret = 0, i, n;\n\tBIGNUM *u;\n\tbn_check_top(a);\n\tbn_check_top(b);\n\tif (BN_is_zero(b))\n\t\treturn(BN_one(r));\n\tif (BN_abs_is_word(b, 1))\n\t\treturn (BN_copy(r, a) != NULL);\n\tBN_CTX_start(ctx);\n\tif ((u = BN_CTX_get(ctx)) == NULL) goto err;\n\tif (!BN_GF2m_mod_arr(u, a, p)) goto err;\n\tn = BN_num_bits(b) - 1;\n\tfor (i = n - 1; i >= 0; i--)\n\t\t{\n\t\tif (!BN_GF2m_mod_sqr_arr(u, u, p, ctx)) goto err;\n\t\tif (BN_is_bit_set(b, i))\n\t\t\t{\n\t\t\tif (!BN_GF2m_mod_mul_arr(u, u, a, p, ctx)) goto err;\n\t\t\t}\n\t\t}\n\tif (!BN_copy(r, u)) goto err;\n\tbn_check_top(r);\n\tret = 1;\nerr:\n\tBN_CTX_end(ctx);\n\treturn ret;\n\t}', 'int BN_GF2m_mod_arr(BIGNUM *r, const BIGNUM *a, const int p[])\n\t{\n\tint j, k;\n\tint n, dN, d0, d1;\n\tBN_ULONG zz, *z;\n\tbn_check_top(a);\n\tif (!p[0])\n\t\t{\n\t\tBN_zero(r);\n\t\treturn 1;\n\t\t}\n\tif (a != r)\n\t\t{\n\t\tif (!bn_wexpand(r, a->top)) return 0;\n\t\tfor (j = 0; j < a->top; j++)\n\t\t\t{\n\t\t\tr->d[j] = a->d[j];\n\t\t\t}\n\t\tr->top = a->top;\n\t\t}\n\tz = r->d;\n\tdN = p[0] / BN_BITS2;\n\tfor (j = r->top - 1; j > dN;)\n\t\t{\n\t\tzz = z[j];\n\t\tif (z[j] == 0) { j--; continue; }\n\t\tz[j] = 0;\n\t\tfor (k = 1; p[k] != 0; k++)\n\t\t\t{\n\t\t\tn = p[0] - p[k];\n\t\t\td0 = n % BN_BITS2;  d1 = BN_BITS2 - d0;\n\t\t\tn /= BN_BITS2;\n\t\t\tz[j-n] ^= (zz>>d0);\n\t\t\tif (d0) z[j-n-1] ^= (zz<<d1);\n\t\t\t}\n\t\tn = dN;\n\t\td0 = p[0] % BN_BITS2;\n\t\td1 = BN_BITS2 - d0;\n\t\tz[j-n] ^= (zz >> d0);\n\t\tif (d0) z[j-n-1] ^= (zz << d1);\n\t\t}\n\twhile (j == dN)\n\t\t{\n\t\td0 = p[0] % BN_BITS2;\n\t\tzz = z[dN] >> d0;\n\t\tif (zz == 0) break;\n\t\td1 = BN_BITS2 - d0;\n\t\tif (d0)\n\t\t\tz[dN] = (z[dN] << d1) >> d1;\n\t\telse\n\t\t\tz[dN] = 0;\n\t\tz[0] ^= zz;\n\t\tfor (k = 1; p[k] != 0; k++)\n\t\t\t{\n\t\t\tBN_ULONG tmp_ulong;\n\t\t\tn = p[k] / BN_BITS2;\n\t\t\td0 = p[k] % BN_BITS2;\n\t\t\td1 = BN_BITS2 - d0;\n\t\t\tz[n] ^= (zz << d0);\n\t\t\ttmp_ulong = zz >> d1;\n                        if (d0 && tmp_ulong)\n                                z[n+1] ^= tmp_ulong;\n\t\t\t}\n\t\t}\n\tbn_correct_top(r);\n\treturn 1;\n\t}', 'int\tBN_GF2m_mod_sqr_arr(BIGNUM *r, const BIGNUM *a, const int p[], BN_CTX *ctx)\n\t{\n\tint i, ret = 0;\n\tBIGNUM *s;\n\tbn_check_top(a);\n\tBN_CTX_start(ctx);\n\tif ((s = BN_CTX_get(ctx)) == NULL) return 0;\n\tif (!bn_wexpand(s, 2 * a->top)) goto err;\n\tfor (i = a->top - 1; i >= 0; i--)\n\t\t{\n\t\ts->d[2*i+1] = SQR1(a->d[i]);\n\t\ts->d[2*i  ] = SQR0(a->d[i]);\n\t\t}\n\ts->top = 2 * a->top;\n\tbn_correct_top(s);\n\tif (!BN_GF2m_mod_arr(r, s, p)) goto err;\n\tbn_check_top(r);\n\tret = 1;\nerr:\n\tBN_CTX_end(ctx);\n\treturn ret;\n\t}']