crypto/bn/bn_mul.c:295: error: INTEGER_OVERFLOW_L2
  ([0, max(4294967295, `*t`)] - [0, max(4294967295, `*t`)]):unsigned64 by call to `bn_mul_recursive`.
Showing all 13 steps of the trace


crypto/bn/bn_mul.c:220:1: Parameter `*t`
218.   /* n+tn is the word length
219.    * t needs to be n*4 is size, as does r */
220. > void bn_mul_part_recursive(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b, int tn,
221.   	     int n, BN_ULONG *t)
222.   	{

crypto/bn/bn_mul.c:295:3: Call
293.   		{
294.   		p= &(t[n2*2]);
295.   		bn_mul_recursive(&(t[n2]),t,&(t[n]),n,p);
         ^
296.   		bn_mul_recursive(r,a,b,n,p);
297.   		i=n/2;

crypto/bn/bn_mul.c:74:1: Parameter `*a`
  72.    * a[1]*b[1]
  73.    */
  74. > void bn_mul_recursive(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b, int n2,
  75.   	     BN_ULONG *t)
  76.   	{

crypto/bn/bn_mul.c:105:5: Call
  103.   		}
  104.   	/* r=(a[0]-a[1])*(b[1]-b[0]) */
  105.   	c1=bn_cmp_words(a,&(a[n]),n);
             ^
  106.   	c2=bn_cmp_words(&(b[n]),b,n);
  107.   	zero=neg=0;

crypto/bn/bn_lib.c:739:1: Parameter `*b`
    737.   	}
    738.   
    739. > int bn_cmp_words(BN_ULONG *a, BN_ULONG *b, int n)
    740.   	{
    741.   	int i;

crypto/bn/bn_mul.c:111:3: Call
  109.   		{
  110.   	case -4:
  111.   		bn_sub_words(t,      &(a[n]),a,      n); /* - */
           ^
  112.   		bn_sub_words(&(t[n]),b,      &(b[n]),n); /* - */
  113.   		break;

crypto/bn/bn_asm.c:390:1: <LHS trace>
388.   #endif /* !BN_LLONG */
389.   
390. > BN_ULONG bn_sub_words(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b, int n)
391.           {
392.   	BN_ULONG t1,t2;

crypto/bn/bn_asm.c:390:1: Parameter `*a`
    388.   #endif /* !BN_LLONG */
    389.   
    390. > BN_ULONG bn_sub_words(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b, int n)
    391.           {
    392.   	BN_ULONG t1,t2;

crypto/bn/bn_asm.c:400:3: Assignment
    398.   	for (;;)
    399.   		{
    400.   		t1=a[0]; t2=b[0];
             ^
    401.   		r[0]=(t1-t2-c)&BN_MASK2;
    402.   		if (t1 != t2) c=(t1 < t2);

crypto/bn/bn_asm.c:390:1: <RHS trace>
388.   #endif /* !BN_LLONG */
389.   
390. > BN_ULONG bn_sub_words(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b, int n)
391.           {
392.   	BN_ULONG t1,t2;

crypto/bn/bn_asm.c:390:1: Parameter `*b`
    388.   #endif /* !BN_LLONG */
    389.   
    390. > BN_ULONG bn_sub_words(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b, int n)
    391.           {
    392.   	BN_ULONG t1,t2;

crypto/bn/bn_asm.c:400:12: Assignment
    398.   	for (;;)
    399.   		{
    400.   		t1=a[0]; t2=b[0];
                      ^
    401.   		r[0]=(t1-t2-c)&BN_MASK2;
    402.   		if (t1 != t2) c=(t1 < t2);

crypto/bn/bn_asm.c:401:3: Binary operation: ([0, max(4294967295, *t)] - [0, max(4294967295, *t)]):unsigned64 by call to `bn_mul_recursive` 
    399.   		{
    400.   		t1=a[0]; t2=b[0];
    401.   		r[0]=(t1-t2-c)&BN_MASK2;
             ^
    402.   		if (t1 != t2) c=(t1 < t2);
    403.   		if (--n <= 0) break;

BN_ULONG bn_sub_words(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b, int n)
        {
	BN_ULONG t1,t2;
	int c=0;
	assert(n >= 0);
	if (n <= 0) return((BN_ULONG)0);
	for (;;)
		{
		t1=a[0]; t2=b[0];
		r[0]=(t1-t2-c)&BN_MASK2;
		if (t1 != t2) c=(t1 < t2);
		if (--n <= 0) break;
		t1=a[1]; t2=b[1];
		r[1]=(t1-t2-c)&BN_MASK2;
		if (t1 != t2) c=(t1 < t2);
		if (--n <= 0) break;
		t1=a[2]; t2=b[2];
		r[2]=(t1-t2-c)&BN_MASK2;
		if (t1 != t2) c=(t1 < t2);
		if (--n <= 0) break;
		t1=a[3]; t2=b[3];
		r[3]=(t1-t2-c)&BN_MASK2;
		if (t1 != t2) c=(t1 < t2);
		if (--n <= 0) break;
		a+=4;
		b+=4;
		r+=4;
		}
	return(c);
	}
['void bn_mul_part_recursive(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b, int tn,\n\t     int n, BN_ULONG *t)\n\t{\n\tint i,j,n2=n*2;\n\tunsigned int c1,c2,neg,zero;\n\tBN_ULONG ln,lo,*p;\n# ifdef BN_COUNT\n\tprintf(" bn_mul_part_recursive %d * %d\\n",tn+n,tn+n);\n# endif\n\tif (n < 8)\n\t\t{\n\t\ti=tn+n;\n\t\tbn_mul_normal(r,a,i,b,i);\n\t\treturn;\n\t\t}\n\tc1=bn_cmp_words(a,&(a[n]),n);\n\tc2=bn_cmp_words(&(b[n]),b,n);\n\tzero=neg=0;\n\tswitch (c1*3+c2)\n\t\t{\n\tcase -4:\n\t\tbn_sub_words(t,      &(a[n]),a,      n);\n\t\tbn_sub_words(&(t[n]),b,      &(b[n]),n);\n\t\tbreak;\n\tcase -3:\n\t\tzero=1;\n\tcase -2:\n\t\tbn_sub_words(t,      &(a[n]),a,      n);\n\t\tbn_sub_words(&(t[n]),&(b[n]),b,      n);\n\t\tneg=1;\n\t\tbreak;\n\tcase -1:\n\tcase 0:\n\tcase 1:\n\t\tzero=1;\n\tcase 2:\n\t\tbn_sub_words(t,      a,      &(a[n]),n);\n\t\tbn_sub_words(&(t[n]),b,      &(b[n]),n);\n\t\tneg=1;\n\t\tbreak;\n\tcase 3:\n\t\tzero=1;\n\tcase 4:\n\t\tbn_sub_words(t,      a,      &(a[n]),n);\n\t\tbn_sub_words(&(t[n]),&(b[n]),b,      n);\n\t\tbreak;\n\t\t}\n# if 0\n\tif (n == 4)\n\t\t{\n\t\tbn_mul_comba4(&(t[n2]),t,&(t[n]));\n\t\tbn_mul_comba4(r,a,b);\n\t\tbn_mul_normal(&(r[n2]),&(a[n]),tn,&(b[n]),tn);\n\t\tmemset(&(r[n2+tn*2]),0,sizeof(BN_ULONG)*(n2-tn*2));\n\t\t}\n\telse\n# endif\n\tif (n == 8)\n\t\t{\n\t\tbn_mul_comba8(&(t[n2]),t,&(t[n]));\n\t\tbn_mul_comba8(r,a,b);\n\t\tbn_mul_normal(&(r[n2]),&(a[n]),tn,&(b[n]),tn);\n\t\tmemset(&(r[n2+tn*2]),0,sizeof(BN_ULONG)*(n2-tn*2));\n\t\t}\n\telse\n\t\t{\n\t\tp= &(t[n2*2]);\n\t\tbn_mul_recursive(&(t[n2]),t,&(t[n]),n,p);\n\t\tbn_mul_recursive(r,a,b,n,p);\n\t\ti=n/2;\n\t\tj=tn-i;\n\t\tif (j == 0)\n\t\t\t{\n\t\t\tbn_mul_recursive(&(r[n2]),&(a[n]),&(b[n]),i,p);\n\t\t\tmemset(&(r[n2+i*2]),0,sizeof(BN_ULONG)*(n2-i*2));\n\t\t\t}\n\t\telse if (j > 0)\n\t\t\t\t{\n\t\t\t\tbn_mul_part_recursive(&(r[n2]),&(a[n]),&(b[n]),\n\t\t\t\t\tj,i,p);\n\t\t\t\tmemset(&(r[n2+tn*2]),0,\n\t\t\t\t\tsizeof(BN_ULONG)*(n2-tn*2));\n\t\t\t\t}\n\t\telse\n\t\t\t{\n\t\t\tmemset(&(r[n2]),0,sizeof(BN_ULONG)*n2);\n\t\t\tif (tn < BN_MUL_RECURSIVE_SIZE_NORMAL)\n\t\t\t\t{\n\t\t\t\tbn_mul_normal(&(r[n2]),&(a[n]),tn,&(b[n]),tn);\n\t\t\t\t}\n\t\t\telse\n\t\t\t\t{\n\t\t\t\tfor (;;)\n\t\t\t\t\t{\n\t\t\t\t\ti/=2;\n\t\t\t\t\tif (i < tn)\n\t\t\t\t\t\t{\n\t\t\t\t\t\tbn_mul_part_recursive(&(r[n2]),\n\t\t\t\t\t\t\t&(a[n]),&(b[n]),\n\t\t\t\t\t\t\ttn-i,i,p);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\telse if (i == tn)\n\t\t\t\t\t\t{\n\t\t\t\t\t\tbn_mul_recursive(&(r[n2]),\n\t\t\t\t\t\t\t&(a[n]),&(b[n]),\n\t\t\t\t\t\t\ti,p);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\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 < 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}', 'void bn_mul_recursive(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b, int n2,\n\t     BN_ULONG *t)\n\t{\n\tint n=n2/2,c1,c2;\n\tunsigned int neg,zero;\n\tBN_ULONG ln,lo,*p;\n# ifdef BN_COUNT\n\tprintf(" bn_mul_recursive %d * %d\\n",n2,n2);\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)\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,b,n2);\n\t\treturn;\n\t\t}\n\tc1=bn_cmp_words(a,&(a[n]),n);\n\tc2=bn_cmp_words(&(b[n]),b,n);\n\tzero=neg=0;\n\tswitch (c1*3+c2)\n\t\t{\n\tcase -4:\n\t\tbn_sub_words(t,      &(a[n]),a,      n);\n\t\tbn_sub_words(&(t[n]),b,      &(b[n]),n);\n\t\tbreak;\n\tcase -3:\n\t\tzero=1;\n\t\tbreak;\n\tcase -2:\n\t\tbn_sub_words(t,      &(a[n]),a,      n);\n\t\tbn_sub_words(&(t[n]),&(b[n]),b,      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_words(t,      a,      &(a[n]),n);\n\t\tbn_sub_words(&(t[n]),b,      &(b[n]),n);\n\t\tneg=1;\n\t\tbreak;\n\tcase 3:\n\t\tzero=1;\n\t\tbreak;\n\tcase 4:\n\t\tbn_sub_words(t,      a,      &(a[n]),n);\n\t\tbn_sub_words(&(t[n]),&(b[n]),b,      n);\n\t\tbreak;\n\t\t}\n# ifdef BN_MUL_COMBA\n\tif (n == 4)\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)\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,p);\n\t\telse\n\t\t\tmemset(&(t[n2]),0,n2*sizeof(BN_ULONG));\n\t\tbn_mul_recursive(r,a,b,n,p);\n\t\tbn_mul_recursive(&(r[n2]),&(a[n]),&(b[n]),n,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}', 'int bn_cmp_words(BN_ULONG *a, BN_ULONG *b, int n)\n\t{\n\tint i;\n\tBN_ULONG aa,bb;\n\taa=a[n-1];\n\tbb=b[n-1];\n\tif (aa != bb) return((aa > bb)?1:-1);\n\tfor (i=n-2; i>=0; i--)\n\t\t{\n\t\taa=a[i];\n\t\tbb=b[i];\n\t\tif (aa != bb) return((aa > bb)?1:-1);\n\t\t}\n\treturn(0);\n\t}', 'BN_ULONG bn_sub_words(BN_ULONG *r, BN_ULONG *a, 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\tfor (;;)\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\tif (--n <= 0) break;\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\tif (--n <= 0) break;\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\tif (--n <= 0) break;\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\tif (--n <= 0) break;\n\t\ta+=4;\n\t\tb+=4;\n\t\tr+=4;\n\t\t}\n\treturn(c);\n\t}']