crypto/bn/bn_gf2m.c:292: error: INTEGER_OVERFLOW_L2
  ([0, +oo] - 1):unsigned64.
Showing all 3 steps of the trace


crypto/bn/bn_gf2m.c:261:1: <LHS trace>
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: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:292:7: Binary operation: ([0, +oo] - 1):unsigned64
290.   	/* start reduction */
291.   	dN = p[0] / BN_BITS2;  
292.   	for (j = r->top - 1; j > dN;)
             ^
293.   		{
294.   		zz = z[j];

int BN_GF2m_mod_arr(BIGNUM *r, const BIGNUM *a, const int p[])
	{
	int j, k;
	int n, dN, d0, d1;
	BN_ULONG zz, *z;
	bn_check_top(a);
	if (!p[0])
		{
		BN_zero(r);
		return 1;
		}
	if (a != r)
		{
		if (!bn_wexpand(r, a->top)) return 0;
		for (j = 0; j < a->top; j++)
			{
			r->d[j] = a->d[j];
			}
		r->top = a->top;
		}
	z = r->d;
	dN = p[0] / BN_BITS2;
	for (j = r->top - 1; j > dN;)
		{
		zz = z[j];
		if (z[j] == 0) { j--; continue; }
		z[j] = 0;
		for (k = 1; p[k] != 0; k++)
			{
			n = p[0] - p[k];
			d0 = n % BN_BITS2;  d1 = BN_BITS2 - d0;
			n /= BN_BITS2;
			z[j-n] ^= (zz>>d0);
			if (d0) z[j-n-1] ^= (zz<<d1);
			}
		n = dN;
		d0 = p[0] % BN_BITS2;
		d1 = BN_BITS2 - d0;
		z[j-n] ^= (zz >> d0);
		if (d0) z[j-n-1] ^= (zz << d1);
		}
	while (j == dN)
		{
		d0 = p[0] % BN_BITS2;
		zz = z[dN] >> d0;
		if (zz == 0) break;
		d1 = BN_BITS2 - d0;
		if (d0)
			z[dN] = (z[dN] << d1) >> d1;
		else
			z[dN] = 0;
		z[0] ^= zz;
		for (k = 1; p[k] != 0; k++)
			{
			BN_ULONG tmp_ulong;
			n = p[k] / BN_BITS2;
			d0 = p[k] % BN_BITS2;
			d1 = BN_BITS2 - d0;
			z[n] ^= (zz << d0);
			tmp_ulong = zz >> d1;
                        if (d0 && tmp_ulong)
                                z[n+1] ^= tmp_ulong;
			}
		}
	bn_correct_top(r);
	return 1;
	}
['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}']