crypto/bn/bn_sqr.c:266: error: INTEGER_OVERFLOW_L2
  ([0, max(4294967295, `*t`)] - [0, max(4294967295, `*t`)]):unsigned32 by call to `bn_sub_words`.
Showing all 11 steps of the trace


crypto/bn/bn_sqr.c:206:1: Parameter `*t`
204.    * a[1]*b[1]
205.    */
206. > void bn_sqr_recursive(BN_ULONG *r, const BN_ULONG *a, int n2, BN_ULONG *t)
207.   	{
208.   	int n=n2/2;

crypto/bn/bn_sqr.c:263:11: Call
261.   	 */
262.   
263.   	c1=(int)(bn_add_words(t,r,&(r[n2]),n2));
                 ^
264.   
265.   	/* t[32] is negative */

crypto/bn/bn_asm.c:341:1: Parameter `*r`
  339.   	}
  340.   #else /* !BN_LLONG */
  341. > BN_ULONG bn_add_words(BN_ULONG *r, const BN_ULONG *a, const BN_ULONG *b, size_t n)
  342.           {
  343.   	BN_ULONG c,l,t;

crypto/bn/bn_sqr.c:266:12: Call
264.   
265.   	/* t[32] is negative */
266.   	c1-=(int)(bn_sub_words(&(t[n2]),t,&(t[n2]),n2));
                  ^
267.   
268.   	/* t[32] holds (a[0]-a[1])*(a[1]-a[0])+(a[0]*a[0])+(a[1]*a[1])

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

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

crypto/bn/bn_asm.c:421:3: Assignment
  419.   	while (n)
  420.   		{
  421.   		t1=a[0]; t2=b[0];
           ^
  422.   		r[0]=(t1-t2-c)&BN_MASK2;
  423.   		if (t1 != t2) c=(t1 < t2);

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

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

crypto/bn/bn_asm.c:421:12: Assignment
  419.   	while (n)
  420.   		{
  421.   		t1=a[0]; t2=b[0];
                    ^
  422.   		r[0]=(t1-t2-c)&BN_MASK2;
  423.   		if (t1 != t2) c=(t1 < t2);

crypto/bn/bn_asm.c:422:3: Binary operation: ([0, max(4294967295, *t)] - [0, max(4294967295, *t)]):unsigned32 by call to `bn_sub_words` 
  420.   		{
  421.   		t1=a[0]; t2=b[0];
  422.   		r[0]=(t1-t2-c)&BN_MASK2;
           ^
  423.   		if (t1 != t2) c=(t1 < t2);
  424.   		a++; b++; r++; n--;

BN_ULONG bn_sub_words(BN_ULONG *r, const BN_ULONG *a, const BN_ULONG *b, size_t 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);
	}
['void bn_sqr_recursive(BN_ULONG *r, const BN_ULONG *a, int n2, BN_ULONG *t)\n\t{\n\tint n=n2/2;\n\tint zero,c1;\n\tBN_ULONG ln,lo,*p;\n#ifdef BN_COUNT\n\tfprintf(stderr," bn_sqr_recursive %d * %d\\n",n2,n2);\n#endif\n\tif (n2 == 4)\n\t\t{\n#ifndef BN_SQR_COMBA\n\t\tbn_sqr_normal(r,a,4,t);\n#else\n\t\tbn_sqr_comba4(r,a);\n#endif\n\t\treturn;\n\t\t}\n\telse if (n2 == 8)\n\t\t{\n#ifndef BN_SQR_COMBA\n\t\tbn_sqr_normal(r,a,8,t);\n#else\n\t\tbn_sqr_comba8(r,a);\n#endif\n\t\treturn;\n\t\t}\n\tif (n2 < BN_SQR_RECURSIVE_SIZE_NORMAL)\n\t\t{\n\t\tbn_sqr_normal(r,a,n2,t);\n\t\treturn;\n\t\t}\n\tc1=bn_cmp_words(a,&(a[n]),n);\n\tzero=0;\n\tif (c1 > 0)\n\t\tbn_sub_words(t,a,&(a[n]),n);\n\telse if (c1 < 0)\n\t\tbn_sub_words(t,&(a[n]),a,n);\n\telse\n\t\tzero=1;\n\tp= &(t[n2*2]);\n\tif (!zero)\n\t\tbn_sqr_recursive(&(t[n2]),t,n,p);\n\telse\n\t\tmemset(&(t[n2]),0,n2*sizeof(BN_ULONG));\n\tbn_sqr_recursive(r,a,n,p);\n\tbn_sqr_recursive(&(r[n2]),&(a[n]),n,p);\n\tc1=(int)(bn_add_words(t,r,&(r[n2]),n2));\n\tc1-=(int)(bn_sub_words(&(t[n2]),t,&(t[n2]),n2));\n\tc1+=(int)(bn_add_words(&(r[n]),&(r[n]),&(t[n2]),n2));\n\tif (c1)\n\t\t{\n\t\tp= &(r[n+n2]);\n\t\tlo= *p;\n\t\tln=(lo+c1)&BN_MASK2;\n\t\t*p=ln;\n\t\tif (ln < (BN_ULONG)c1)\n\t\t\t{\n\t\t\tdo\t{\n\t\t\t\tp++;\n\t\t\t\tlo= *p;\n\t\t\t\tln=(lo+1)&BN_MASK2;\n\t\t\t\t*p=ln;\n\t\t\t\t} while (ln == 0);\n\t\t\t}\n\t\t}\n\t}', 'BN_ULONG bn_add_words(BN_ULONG *r, const BN_ULONG *a, const BN_ULONG *b, size_t n)\n        {\n\tBN_ULONG c,l,t;\n\tassert(n >= 0);\n\tif (n <= 0) return((BN_ULONG)0);\n\tc=0;\n#ifndef OPENSSL_SMALL_FOOTPRINT\n\twhile (n&~3)\n\t\t{\n\t\tt=a[0];\n\t\tt=(t+c)&BN_MASK2;\n\t\tc=(t < c);\n\t\tl=(t+b[0])&BN_MASK2;\n\t\tc+=(l < t);\n\t\tr[0]=l;\n\t\tt=a[1];\n\t\tt=(t+c)&BN_MASK2;\n\t\tc=(t < c);\n\t\tl=(t+b[1])&BN_MASK2;\n\t\tc+=(l < t);\n\t\tr[1]=l;\n\t\tt=a[2];\n\t\tt=(t+c)&BN_MASK2;\n\t\tc=(t < c);\n\t\tl=(t+b[2])&BN_MASK2;\n\t\tc+=(l < t);\n\t\tr[2]=l;\n\t\tt=a[3];\n\t\tt=(t+c)&BN_MASK2;\n\t\tc=(t < c);\n\t\tl=(t+b[3])&BN_MASK2;\n\t\tc+=(l < t);\n\t\tr[3]=l;\n\t\ta+=4; b+=4; r+=4; n-=4;\n\t\t}\n#endif\n\twhile(n)\n\t\t{\n\t\tt=a[0];\n\t\tt=(t+c)&BN_MASK2;\n\t\tc=(t < c);\n\t\tl=(t+b[0])&BN_MASK2;\n\t\tc+=(l < t);\n\t\tr[0]=l;\n\t\ta++; b++; r++; n--;\n\t\t}\n\treturn((BN_ULONG)c);\n\t}', 'BN_ULONG bn_sub_words(BN_ULONG *r, const BN_ULONG *a, const BN_ULONG *b, size_t 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}']