crypto/bn/bn_mul.c:530: error: INTEGER_OVERFLOW_L2
  ([0, max(4294967295, `*r`)] + [-oo, 6]):unsigned32.
Showing all 12 steps of the trace


crypto/bn/bn_mul.c:393:1: <LHS trace>
391.    */
392.   /* dnX may not be positive, but n2/2+dnX has to be */
393. > void bn_mul_recursive(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b, int n2,
394.   	int dna, int dnb, BN_ULONG *t)
395.   	{

crypto/bn/bn_mul.c:393:1: Parameter `*r`
391.    */
392.   /* dnX may not be positive, but n2/2+dnX has to be */
393. > void bn_mul_recursive(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b, int n2,
394.   	int dna, int dnb, BN_ULONG *t)
395.   	{

crypto/bn/bn_mul.c:508:11: Call
506.   	 */
507.   
508.   	c1=(int)(bn_add_words(t,r,&(r[n2]),n2));
                 ^
509.   
510.   	if (neg) /* if t[32] is negative */

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

crypto/bn/bn_mul.c:525:12: Call
523.   	 * c1 holds the carry bits
524.   	 */
525.   	c1+=(int)(bn_add_words(&(r[n]),&(r[n]),&(t[n2]),n2));
                  ^
526.   	if (c1)
527.   		{

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

crypto/bn/bn_mul.c:529:3: Assignment
527.   		{
528.   		p= &(r[n+n2]);
529.   		lo= *p;
         ^
530.   		ln=(lo+c1)&BN_MASK2;
531.   		*p=ln;

crypto/bn/bn_mul.c:525:12: <RHS trace>
523.   	 * c1 holds the carry bits
524.   	 */
525.   	c1+=(int)(bn_add_words(&(r[n]),&(r[n]),&(t[n2]),n2));
                  ^
526.   	if (c1)
527.   		{

crypto/bn/bn_mul.c:525:12: Call
523.   	 * c1 holds the carry bits
524.   	 */
525.   	c1+=(int)(bn_add_words(&(r[n]),&(r[n]),&(t[n2]),n2));
                  ^
526.   	if (c1)
527.   		{

crypto/bn/bn_asm.c:346:14: Assignment
  344.   
  345.   	assert(n >= 0);
  346.   	if (n <= 0) return((BN_ULONG)0);
                      ^
  347.   
  348.   	c=0;

crypto/bn/bn_mul.c:525:2: Assignment
523.   	 * c1 holds the carry bits
524.   	 */
525.   	c1+=(int)(bn_add_words(&(r[n]),&(r[n]),&(t[n2]),n2));
        ^
526.   	if (c1)
527.   		{

crypto/bn/bn_mul.c:530:3: Binary operation: ([0, max(4294967295, *r)] + [-oo, 6]):unsigned32
528.   		p= &(r[n+n2]);
529.   		lo= *p;
530.   		ln=(lo+c1)&BN_MASK2;
         ^
531.   		*p=ln;
532.   

void bn_mul_recursive(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b, int n2,
	int dna, int dnb, BN_ULONG *t)
	{
	int n=n2/2,c1,c2;
	int tna=n+dna, tnb=n+dnb;
	unsigned int neg,zero;
	BN_ULONG ln,lo,*p;
# ifdef BN_COUNT
	fprintf(stderr," bn_mul_recursive %d%+d * %d%+d\n",n2,dna,n2,dnb);
# endif
# ifdef BN_MUL_COMBA
#  if 0
	if (n2 == 4)
		{
		bn_mul_comba4(r,a,b);
		return;
		}
#  endif
	if (n2 == 8 && dna == 0 && dnb == 0)
		{
		bn_mul_comba8(r,a,b);
		return;
		}
# endif
	if (n2 < BN_MUL_RECURSIVE_SIZE_NORMAL)
		{
		bn_mul_normal(r,a,n2+dna,b,n2+dnb);
		if ((dna + dnb) < 0)
			memset(&r[2*n2 + dna + dnb], 0,
				sizeof(BN_ULONG) * -(dna + dnb));
		return;
		}
	c1=bn_cmp_part_words(a,&(a[n]),tna,n-tna);
	c2=bn_cmp_part_words(&(b[n]),b,tnb,tnb-n);
	zero=neg=0;
	switch (c1*3+c2)
		{
	case -4:
		bn_sub_part_words(t,      &(a[n]),a,      tna,tna-n);
		bn_sub_part_words(&(t[n]),b,      &(b[n]),tnb,n-tnb);
		break;
	case -3:
		zero=1;
		break;
	case -2:
		bn_sub_part_words(t,      &(a[n]),a,      tna,tna-n);
		bn_sub_part_words(&(t[n]),&(b[n]),b,      tnb,tnb-n);
		neg=1;
		break;
	case -1:
	case 0:
	case 1:
		zero=1;
		break;
	case 2:
		bn_sub_part_words(t,      a,      &(a[n]),tna,n-tna);
		bn_sub_part_words(&(t[n]),b,      &(b[n]),tnb,n-tnb);
		neg=1;
		break;
	case 3:
		zero=1;
		break;
	case 4:
		bn_sub_part_words(t,      a,      &(a[n]),tna,n-tna);
		bn_sub_part_words(&(t[n]),&(b[n]),b,      tnb,tnb-n);
		break;
		}
# ifdef BN_MUL_COMBA
	if (n == 4 && dna == 0 && dnb == 0)
		{
		if (!zero)
			bn_mul_comba4(&(t[n2]),t,&(t[n]));
		else
			memset(&(t[n2]),0,8*sizeof(BN_ULONG));
		bn_mul_comba4(r,a,b);
		bn_mul_comba4(&(r[n2]),&(a[n]),&(b[n]));
		}
	else if (n == 8 && dna == 0 && dnb == 0)
		{
		if (!zero)
			bn_mul_comba8(&(t[n2]),t,&(t[n]));
		else
			memset(&(t[n2]),0,16*sizeof(BN_ULONG));
		bn_mul_comba8(r,a,b);
		bn_mul_comba8(&(r[n2]),&(a[n]),&(b[n]));
		}
	else
# endif
		{
		p= &(t[n2*2]);
		if (!zero)
			bn_mul_recursive(&(t[n2]),t,&(t[n]),n,0,0,p);
		else
			memset(&(t[n2]),0,n2*sizeof(BN_ULONG));
		bn_mul_recursive(r,a,b,n,0,0,p);
		bn_mul_recursive(&(r[n2]),&(a[n]),&(b[n]),n,dna,dnb,p);
		}
	c1=(int)(bn_add_words(t,r,&(r[n2]),n2));
	if (neg)
		{
		c1-=(int)(bn_sub_words(&(t[n2]),t,&(t[n2]),n2));
		}
	else
		{
		c1+=(int)(bn_add_words(&(t[n2]),&(t[n2]),t,n2));
		}
	c1+=(int)(bn_add_words(&(r[n]),&(r[n]),&(t[n2]),n2));
	if (c1)
		{
		p= &(r[n+n2]);
		lo= *p;
		ln=(lo+c1)&BN_MASK2;
		*p=ln;
		if (ln < (BN_ULONG)c1)
			{
			do	{
				p++;
				lo= *p;
				ln=(lo+1)&BN_MASK2;
				*p=ln;
				} while (ln == 0);
			}
		}
	}
['void bn_mul_recursive(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b, int n2,\n\tint dna, int dnb, BN_ULONG *t)\n\t{\n\tint n=n2/2,c1,c2;\n\tint tna=n+dna, tnb=n+dnb;\n\tunsigned int neg,zero;\n\tBN_ULONG ln,lo,*p;\n# ifdef BN_COUNT\n\tfprintf(stderr," bn_mul_recursive %d%+d * %d%+d\\n",n2,dna,n2,dnb);\n# endif\n# ifdef BN_MUL_COMBA\n#  if 0\n\tif (n2 == 4)\n\t\t{\n\t\tbn_mul_comba4(r,a,b);\n\t\treturn;\n\t\t}\n#  endif\n\tif (n2 == 8 && dna == 0 && dnb == 0)\n\t\t{\n\t\tbn_mul_comba8(r,a,b);\n\t\treturn;\n\t\t}\n# endif\n\tif (n2 < BN_MUL_RECURSIVE_SIZE_NORMAL)\n\t\t{\n\t\tbn_mul_normal(r,a,n2+dna,b,n2+dnb);\n\t\tif ((dna + dnb) < 0)\n\t\t\tmemset(&r[2*n2 + dna + dnb], 0,\n\t\t\t\tsizeof(BN_ULONG) * -(dna + dnb));\n\t\treturn;\n\t\t}\n\tc1=bn_cmp_part_words(a,&(a[n]),tna,n-tna);\n\tc2=bn_cmp_part_words(&(b[n]),b,tnb,tnb-n);\n\tzero=neg=0;\n\tswitch (c1*3+c2)\n\t\t{\n\tcase -4:\n\t\tbn_sub_part_words(t,      &(a[n]),a,      tna,tna-n);\n\t\tbn_sub_part_words(&(t[n]),b,      &(b[n]),tnb,n-tnb);\n\t\tbreak;\n\tcase -3:\n\t\tzero=1;\n\t\tbreak;\n\tcase -2:\n\t\tbn_sub_part_words(t,      &(a[n]),a,      tna,tna-n);\n\t\tbn_sub_part_words(&(t[n]),&(b[n]),b,      tnb,tnb-n);\n\t\tneg=1;\n\t\tbreak;\n\tcase -1:\n\tcase 0:\n\tcase 1:\n\t\tzero=1;\n\t\tbreak;\n\tcase 2:\n\t\tbn_sub_part_words(t,      a,      &(a[n]),tna,n-tna);\n\t\tbn_sub_part_words(&(t[n]),b,      &(b[n]),tnb,n-tnb);\n\t\tneg=1;\n\t\tbreak;\n\tcase 3:\n\t\tzero=1;\n\t\tbreak;\n\tcase 4:\n\t\tbn_sub_part_words(t,      a,      &(a[n]),tna,n-tna);\n\t\tbn_sub_part_words(&(t[n]),&(b[n]),b,      tnb,tnb-n);\n\t\tbreak;\n\t\t}\n# ifdef BN_MUL_COMBA\n\tif (n == 4 && dna == 0 && dnb == 0)\n\t\t{\n\t\tif (!zero)\n\t\t\tbn_mul_comba4(&(t[n2]),t,&(t[n]));\n\t\telse\n\t\t\tmemset(&(t[n2]),0,8*sizeof(BN_ULONG));\n\t\tbn_mul_comba4(r,a,b);\n\t\tbn_mul_comba4(&(r[n2]),&(a[n]),&(b[n]));\n\t\t}\n\telse if (n == 8 && dna == 0 && dnb == 0)\n\t\t{\n\t\tif (!zero)\n\t\t\tbn_mul_comba8(&(t[n2]),t,&(t[n]));\n\t\telse\n\t\t\tmemset(&(t[n2]),0,16*sizeof(BN_ULONG));\n\t\tbn_mul_comba8(r,a,b);\n\t\tbn_mul_comba8(&(r[n2]),&(a[n]),&(b[n]));\n\t\t}\n\telse\n# endif\n\t\t{\n\t\tp= &(t[n2*2]);\n\t\tif (!zero)\n\t\t\tbn_mul_recursive(&(t[n2]),t,&(t[n]),n,0,0,p);\n\t\telse\n\t\t\tmemset(&(t[n2]),0,n2*sizeof(BN_ULONG));\n\t\tbn_mul_recursive(r,a,b,n,0,0,p);\n\t\tbn_mul_recursive(&(r[n2]),&(a[n]),&(b[n]),n,dna,dnb,p);\n\t\t}\n\tc1=(int)(bn_add_words(t,r,&(r[n2]),n2));\n\tif (neg)\n\t\t{\n\t\tc1-=(int)(bn_sub_words(&(t[n2]),t,&(t[n2]),n2));\n\t\t}\n\telse\n\t\t{\n\t\tc1+=(int)(bn_add_words(&(t[n2]),&(t[n2]),t,n2));\n\t\t}\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, int 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}']