crypto/bn/bn_nist.c:805: error: INTEGER_OVERFLOW_L2
  ([0, +oo] - [0, 4294967295]):unsigned32 by call to `bn_sub_words`.
Showing all 10 steps of the trace


crypto/bn/bn_nist.c:778:2: Assignment
776.   
777.   	/*S1*/
778.   	nist_set_256(t_d, buf.bn, 15, 14, 13, 12, 11, 0, 0, 0);
        ^
779.   	/*S2*/
780.   	nist_set_256(c_d, buf.bn, 0, 15, 14, 13, 12, 0, 0, 0);

crypto/bn/bn_nist.c:778:2: Assignment
776.   
777.   	/*S1*/
778.   	nist_set_256(t_d, buf.bn, 15, 14, 13, 12, 11, 0, 0, 0);
        ^
779.   	/*S2*/
780.   	nist_set_256(c_d, buf.bn, 0, 15, 14, 13, 12, 0, 0, 0);

crypto/bn/bn_nist.c:805:16: Call
803.   	/*D1*/
804.   	nist_set_256(t_d, buf.bn, 10, 8, 0, 0, 0, 13, 12, 11);
805.   	carry -= (int)bn_sub_words(r_d, r_d, t_d, BN_NIST_256_TOP);
                      ^
806.   	/*D2*/
807.   	nist_set_256(t_d, buf.bn, 11, 9, 0, 0, 15, 14, 13, 12);

crypto/bn/bn_asm.c:394:1: <LHS trace>
392.   #endif /* !BN_LLONG */
393.   
394. > BN_ULONG bn_sub_words(BN_ULONG *r, const BN_ULONG *a, const BN_ULONG *b, int n)
395.           {
396.   	BN_ULONG t1,t2;

crypto/bn/bn_asm.c:394:1: Parameter `*a`
  392.   #endif /* !BN_LLONG */
  393.   
  394. > BN_ULONG bn_sub_words(BN_ULONG *r, const BN_ULONG *a, const BN_ULONG *b, int n)
  395.           {
  396.   	BN_ULONG t1,t2;

crypto/bn/bn_asm.c:405:3: Assignment
  403.   	while (n&~3)
  404.   		{
  405.   		t1=a[0]; t2=b[0];
           ^
  406.   		r[0]=(t1-t2-c)&BN_MASK2;
  407.   		if (t1 != t2) c=(t1 < t2);

crypto/bn/bn_asm.c:394:1: <RHS trace>
392.   #endif /* !BN_LLONG */
393.   
394. > BN_ULONG bn_sub_words(BN_ULONG *r, const BN_ULONG *a, const BN_ULONG *b, int n)
395.           {
396.   	BN_ULONG t1,t2;

crypto/bn/bn_asm.c:394:1: Parameter `*b`
  392.   #endif /* !BN_LLONG */
  393.   
  394. > BN_ULONG bn_sub_words(BN_ULONG *r, const BN_ULONG *a, const BN_ULONG *b, int n)
  395.           {
  396.   	BN_ULONG t1,t2;

crypto/bn/bn_asm.c:405:12: Assignment
  403.   	while (n&~3)
  404.   		{
  405.   		t1=a[0]; t2=b[0];
                    ^
  406.   		r[0]=(t1-t2-c)&BN_MASK2;
  407.   		if (t1 != t2) c=(t1 < t2);

crypto/bn/bn_asm.c:406:3: Binary operation: ([0, +oo] - [0, 4294967295]):unsigned32 by call to `bn_sub_words` 
  404.   		{
  405.   		t1=a[0]; t2=b[0];
  406.   		r[0]=(t1-t2-c)&BN_MASK2;
           ^
  407.   		if (t1 != t2) c=(t1 < t2);
  408.   		t1=a[1]; t2=b[1];

BN_ULONG bn_sub_words(BN_ULONG *r, const BN_ULONG *a, const BN_ULONG *b, int n)
        {
	BN_ULONG t1,t2;
	int c=0;
	assert(n >= 0);
	if (n <= 0) return((BN_ULONG)0);
#ifndef OPENSSL_SMALL_FOOTPRINT
	while (n&~3)
		{
		t1=a[0]; t2=b[0];
		r[0]=(t1-t2-c)&BN_MASK2;
		if (t1 != t2) c=(t1 < t2);
		t1=a[1]; t2=b[1];
		r[1]=(t1-t2-c)&BN_MASK2;
		if (t1 != t2) c=(t1 < t2);
		t1=a[2]; t2=b[2];
		r[2]=(t1-t2-c)&BN_MASK2;
		if (t1 != t2) c=(t1 < t2);
		t1=a[3]; t2=b[3];
		r[3]=(t1-t2-c)&BN_MASK2;
		if (t1 != t2) c=(t1 < t2);
		a+=4; b+=4; r+=4; n-=4;
		}
#endif
	while (n)
		{
		t1=a[0]; t2=b[0];
		r[0]=(t1-t2-c)&BN_MASK2;
		if (t1 != t2) c=(t1 < t2);
		a++; b++; r++; n--;
		}
	return(c);
	}
['int BN_nist_mod_256(BIGNUM *r, const BIGNUM *a, const BIGNUM *field,\n\tBN_CTX *ctx)\n\t{\n\tint\ti, top = a->top;\n\tint\tcarry = 0;\n\tregister BN_ULONG *a_d = a->d, *r_d;\n\tunion\t{\n\t\tBN_ULONG bn[BN_NIST_256_TOP];\n\t\tunsigned int ui[BN_NIST_256_TOP*sizeof(BN_ULONG)/sizeof(unsigned int)];\n\t\t} buf;\n\tBN_ULONG c_d[BN_NIST_256_TOP],\n\t\t*res;\n\tPTR_SIZE_INT mask;\n\tunion { bn_addsub_f f; PTR_SIZE_INT p; } u;\n\tstatic const BIGNUM _bignum_nist_p_256_sqr = {\n\t\t(BN_ULONG *)_nist_p_256_sqr,\n\t\tsizeof(_nist_p_256_sqr)/sizeof(_nist_p_256_sqr[0]),\n\t\tsizeof(_nist_p_256_sqr)/sizeof(_nist_p_256_sqr[0]),\n\t\t0,BN_FLG_STATIC_DATA };\n\tfield = &_bignum_nist_p_256;\n \tif (BN_is_negative(a) || BN_ucmp(a,&_bignum_nist_p_256_sqr)>=0)\n\t\treturn BN_nnmod(r, a, field, ctx);\n\ti = BN_ucmp(field, a);\n\tif (i == 0)\n\t\t{\n\t\tBN_zero(r);\n\t\treturn 1;\n\t\t}\n\telse if (i > 0)\n\t\treturn (r == a)? 1 : (BN_copy(r ,a) != NULL);\n\tif (r != a)\n\t\t{\n\t\tif (!bn_wexpand(r, BN_NIST_256_TOP))\n\t\t\treturn 0;\n\t\tr_d = r->d;\n\t\tnist_cp_bn(r_d, a_d, BN_NIST_256_TOP);\n\t\t}\n\telse\n\t\tr_d = a_d;\n\tnist_cp_bn_0(buf.bn, a_d + BN_NIST_256_TOP, top - BN_NIST_256_TOP, BN_NIST_256_TOP);\n#if defined(NIST_INT64)\n\t{\n\tNIST_INT64\t\tacc;\n\tunsigned int\t\t*rp=(unsigned int *)r_d;\n\tconst unsigned int\t*bp=(const unsigned int *)buf.ui;\n\tacc = rp[0];\tacc += bp[8-8];\n\t\t\tacc += bp[9-8];\n\t\t\tacc -= bp[11-8];\n\t\t\tacc -= bp[12-8];\n\t\t\tacc -= bp[13-8];\n\t\t\tacc -= bp[14-8]; rp[0] = (unsigned int)acc; acc >>= 32;\n\tacc += rp[1];\tacc += bp[9-8];\n\t\t\tacc += bp[10-8];\n\t\t\tacc -= bp[12-8];\n\t\t\tacc -= bp[13-8];\n\t\t\tacc -= bp[14-8];\n\t\t\tacc -= bp[15-8]; rp[1] = (unsigned int)acc; acc >>= 32;\n\tacc += rp[2];\tacc += bp[10-8];\n\t\t\tacc += bp[11-8];\n\t\t\tacc -= bp[13-8];\n\t\t\tacc -= bp[14-8];\n\t\t\tacc -= bp[15-8]; rp[2] = (unsigned int)acc; acc >>= 32;\n\tacc += rp[3];\tacc += bp[11-8];\n\t\t\tacc += bp[11-8];\n\t\t\tacc += bp[12-8];\n\t\t\tacc += bp[12-8];\n\t\t\tacc += bp[13-8];\n\t\t\tacc -= bp[15-8];\n\t\t\tacc -= bp[8-8];\n\t\t\tacc -= bp[9-8];  rp[3] = (unsigned int)acc; acc >>= 32;\n\tacc += rp[4];\tacc += bp[12-8];\n\t\t\tacc += bp[12-8];\n\t\t\tacc += bp[13-8];\n\t\t\tacc += bp[13-8];\n\t\t\tacc += bp[14-8];\n\t\t\tacc -= bp[9-8];\n\t\t\tacc -= bp[10-8]; rp[4] = (unsigned int)acc; acc >>= 32;\n\tacc += rp[5];\tacc += bp[13-8];\n\t\t\tacc += bp[13-8];\n\t\t\tacc += bp[14-8];\n\t\t\tacc += bp[14-8];\n\t\t\tacc += bp[15-8];\n\t\t\tacc -= bp[10-8];\n\t\t\tacc -= bp[11-8]; rp[5] = (unsigned int)acc; acc >>= 32;\n\tacc += rp[6];\tacc += bp[14-8];\n\t\t\tacc += bp[14-8];\n\t\t\tacc += bp[15-8];\n\t\t\tacc += bp[15-8];\n\t\t\tacc += bp[14-8];\n\t\t\tacc += bp[13-8];\n\t\t\tacc -= bp[8-8];\n\t\t\tacc -= bp[9-8];  rp[6] = (unsigned int)acc; acc >>= 32;\n\tacc += rp[7];\tacc += bp[15-8];\n\t\t\tacc += bp[15-8];\n\t\t\tacc += bp[15-8];\n\t\t\tacc += bp[8 -8];\n\t\t\tacc -= bp[10-8];\n\t\t\tacc -= bp[11-8];\n\t\t\tacc -= bp[12-8];\n\t\t\tacc -= bp[13-8]; rp[7] = (unsigned int)acc;\n\tcarry = (int)(acc>>32);\n\t}\n#else\n\t{\n\tBN_ULONG t_d[BN_NIST_256_TOP];\n\tnist_set_256(t_d, buf.bn, 15, 14, 13, 12, 11, 0, 0, 0);\n\tnist_set_256(c_d, buf.bn, 0, 15, 14, 13, 12, 0, 0, 0);\n\tcarry = (int)bn_add_words(t_d, t_d, c_d, BN_NIST_256_TOP);\n\t\t{\n\t\tregister BN_ULONG *ap,t,c;\n\t\tap = t_d;\n\t\tc=0;\n\t\tfor (i = BN_NIST_256_TOP; i != 0; --i)\n\t\t\t{\n\t\t\tt= *ap;\n\t\t\t*(ap++)=((t<<1)|c)&BN_MASK2;\n\t\t\tc=(t & BN_TBIT)?1:0;\n\t\t\t}\n\t\tcarry <<= 1;\n\t\tcarry  |= c;\n\t\t}\n\tcarry += (int)bn_add_words(r_d, r_d, t_d, BN_NIST_256_TOP);\n\tnist_set_256(t_d, buf.bn, 15, 14, 0, 0, 0, 10, 9, 8);\n\tcarry += (int)bn_add_words(r_d, r_d, t_d, BN_NIST_256_TOP);\n\tnist_set_256(t_d, buf.bn, 8, 13, 15, 14, 13, 11, 10, 9);\n\tcarry += (int)bn_add_words(r_d, r_d, t_d, BN_NIST_256_TOP);\n\tnist_set_256(t_d, buf.bn, 10, 8, 0, 0, 0, 13, 12, 11);\n\tcarry -= (int)bn_sub_words(r_d, r_d, t_d, BN_NIST_256_TOP);\n\tnist_set_256(t_d, buf.bn, 11, 9, 0, 0, 15, 14, 13, 12);\n\tcarry -= (int)bn_sub_words(r_d, r_d, t_d, BN_NIST_256_TOP);\n\tnist_set_256(t_d, buf.bn, 12, 0, 10, 9, 8, 15, 14, 13);\n\tcarry -= (int)bn_sub_words(r_d, r_d, t_d, BN_NIST_256_TOP);\n\tnist_set_256(t_d, buf.bn, 13, 0, 11, 10, 9, 0, 15, 14);\n\tcarry -= (int)bn_sub_words(r_d, r_d, t_d, BN_NIST_256_TOP);\n\t}\n#endif\n\tu.f = bn_sub_words;\n\tif (carry > 0)\n\t\tcarry = (int)bn_sub_words(r_d,r_d,_nist_p_256[carry-1],BN_NIST_256_TOP);\n\telse if (carry < 0)\n\t\t{\n\t\tcarry = (int)bn_add_words(r_d,r_d,_nist_p_256[-carry-1],BN_NIST_256_TOP);\n\t\tmask = 0-(PTR_SIZE_INT)carry;\n\t\tu.p = ((PTR_SIZE_INT)bn_sub_words&mask) |\n\t\t ((PTR_SIZE_INT)bn_add_words&~mask);\n\t\t}\n\telse\n\t\tcarry = 1;\n\tmask  = 0-(PTR_SIZE_INT)(*u.f)(c_d,r_d,_nist_p_256[0],BN_NIST_256_TOP);\n\tmask &= 0-(PTR_SIZE_INT)carry;\n\tres   = (BN_ULONG *)(((PTR_SIZE_INT)c_d&~mask) |\n\t ((PTR_SIZE_INT)r_d&mask));\n\tnist_cp_bn(r_d, res, BN_NIST_256_TOP);\n\tr->top = BN_NIST_256_TOP;\n\tbn_correct_top(r);\n\treturn 1;\n\t}', 'BN_ULONG bn_sub_words(BN_ULONG *r, const BN_ULONG *a, const BN_ULONG *b, int n)\n        {\n\tBN_ULONG t1,t2;\n\tint c=0;\n\tassert(n >= 0);\n\tif (n <= 0) return((BN_ULONG)0);\n#ifndef OPENSSL_SMALL_FOOTPRINT\n\twhile (n&~3)\n\t\t{\n\t\tt1=a[0]; t2=b[0];\n\t\tr[0]=(t1-t2-c)&BN_MASK2;\n\t\tif (t1 != t2) c=(t1 < t2);\n\t\tt1=a[1]; t2=b[1];\n\t\tr[1]=(t1-t2-c)&BN_MASK2;\n\t\tif (t1 != t2) c=(t1 < t2);\n\t\tt1=a[2]; t2=b[2];\n\t\tr[2]=(t1-t2-c)&BN_MASK2;\n\t\tif (t1 != t2) c=(t1 < t2);\n\t\tt1=a[3]; t2=b[3];\n\t\tr[3]=(t1-t2-c)&BN_MASK2;\n\t\tif (t1 != t2) c=(t1 < t2);\n\t\ta+=4; b+=4; r+=4; n-=4;\n\t\t}\n#endif\n\twhile (n)\n\t\t{\n\t\tt1=a[0]; t2=b[0];\n\t\tr[0]=(t1-t2-c)&BN_MASK2;\n\t\tif (t1 != t2) c=(t1 < t2);\n\t\ta++; b++; r++; n--;\n\t\t}\n\treturn(c);\n\t}']