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_mod_exp_mont_consttime(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p,\n\t\t    const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *in_mont)\n\t{\n\tint i,bits,ret=0,window,wvalue;\n\tint top;\n\tBN_MONT_CTX *mont=NULL;\n\tint numPowers;\n\tunsigned char *powerbufFree=NULL;\n\tint powerbufLen = 0;\n\tunsigned char *powerbuf=NULL;\n\tBIGNUM tmp, am;\n#if defined(OPENSSL_BN_ASM_MONT) && (defined(__sparc__) || defined(__sparc))\n\tunsigned int t4=0;\n#endif\n\tbn_check_top(a);\n\tbn_check_top(p);\n\tbn_check_top(m);\n\ttop = m->top;\n\tif (!(m->d[0] & 1))\n\t\t{\n\t\tBNerr(BN_F_BN_MOD_EXP_MONT_CONSTTIME,BN_R_CALLED_WITH_EVEN_MODULUS);\n\t\treturn(0);\n\t\t}\n\tbits=BN_num_bits(p);\n\tif (bits == 0)\n\t\t{\n\t\tret = BN_one(rr);\n\t\treturn ret;\n\t\t}\n\tBN_CTX_start(ctx);\n\tif (in_mont != NULL)\n\t\tmont=in_mont;\n\telse\n\t\t{\n\t\tif ((mont=BN_MONT_CTX_new()) == NULL) goto err;\n\t\tif (!BN_MONT_CTX_set(mont,m,ctx)) goto err;\n\t\t}\n\twindow = BN_window_bits_for_ctime_exponent_size(bits);\n#if defined(OPENSSL_BN_ASM_MONT) && (defined(__sparc__) || defined(__sparc))\n\tif (window>=5 && (top&15)==0 && top<=64 &&\n\t    (OPENSSL_sparcv9cap_P[1]&(CFR_MONTMUL|CFR_MONTSQR))==\n\t    \t\t\t     (CFR_MONTMUL|CFR_MONTSQR) &&\n\t    (t4=OPENSSL_sparcv9cap_P[0]))\n\t\twindow=5;\n\telse\n#endif\n#if defined(OPENSSL_BN_ASM_MONT5)\n\tif (window==6 && bits<=1024) window=5;\n#endif\n\t(void)0;\n\tnumPowers = 1 << window;\n\tpowerbufLen = sizeof(m->d[0])*(top*numPowers +\n\t\t\t\t((2*top)>numPowers?(2*top):numPowers));\n#ifdef alloca\n\tif (powerbufLen < 3072)\n\t\tpowerbufFree = alloca(powerbufLen+MOD_EXP_CTIME_MIN_CACHE_LINE_WIDTH);\n\telse\n#endif\n\tif ((powerbufFree=(unsigned char*)OPENSSL_malloc(powerbufLen+MOD_EXP_CTIME_MIN_CACHE_LINE_WIDTH)) == NULL)\n\t\tgoto err;\n\tpowerbuf = MOD_EXP_CTIME_ALIGN(powerbufFree);\n\tmemset(powerbuf, 0, powerbufLen);\n#ifdef alloca\n\tif (powerbufLen < 3072)\n\t\tpowerbufFree = NULL;\n#endif\n\ttmp.d     = (BN_ULONG *)(powerbuf + sizeof(m->d[0])*top*numPowers);\n\tam.d      = tmp.d + top;\n\ttmp.top   = am.top  = 0;\n\ttmp.dmax  = am.dmax = top;\n\ttmp.neg   = am.neg  = 0;\n\ttmp.flags = am.flags = BN_FLG_STATIC_DATA;\n#if 1\n\ttmp.d[0] = (0-m->d[0])&BN_MASK2;\n\tfor (i=1;i<top;i++)\n\t\ttmp.d[i] = (~m->d[i])&BN_MASK2;\n\ttmp.top = top;\n#else\n \tif (!BN_to_montgomery(&tmp,BN_value_one(),mont,ctx))\tgoto err;\n#endif\n\tif (a->neg || BN_ucmp(a,m) >= 0)\n\t\t{\n\t\tif (!BN_mod(&am,a,m,ctx))\t\t\tgoto err;\n\t\tif (!BN_to_montgomery(&am,&am,mont,ctx))\tgoto err;\n\t\t}\n\telse\tif (!BN_to_montgomery(&am,a,mont,ctx))\t\tgoto err;\n#if defined(OPENSSL_BN_ASM_MONT) && (defined(__sparc__) || defined(__sparc))\n    if (t4)\n\t{\n\ttypedef int (*bn_pwr5_mont_f)(BN_ULONG *tp,const BN_ULONG *np,\n\t\t\tconst BN_ULONG *n0,const void *table,int power,int bits);\n\tint bn_pwr5_mont_t4_8(BN_ULONG *tp,const BN_ULONG *np,\n\t\t\tconst BN_ULONG *n0,const void *table,int power,int bits);\n\tint bn_pwr5_mont_t4_16(BN_ULONG *tp,const BN_ULONG *np,\n\t\t\tconst BN_ULONG *n0,const void *table,int power,int bits);\n\tint bn_pwr5_mont_t4_24(BN_ULONG *tp,const BN_ULONG *np,\n\t\t\tconst BN_ULONG *n0,const void *table,int power,int bits);\n\tint bn_pwr5_mont_t4_32(BN_ULONG *tp,const BN_ULONG *np,\n\t\t\tconst BN_ULONG *n0,const void *table,int power,int bits);\n\tstatic const bn_pwr5_mont_f pwr5_funcs[4] = {\n\t\t\tbn_pwr5_mont_t4_8,\tbn_pwr5_mont_t4_16,\n\t\t\tbn_pwr5_mont_t4_24,\tbn_pwr5_mont_t4_32 };\n\tbn_pwr5_mont_f pwr5_worker = pwr5_funcs[top/16-1];\n\ttypedef int (*bn_mul_mont_f)(BN_ULONG *rp,const BN_ULONG *ap,\n\t\t\tconst void *bp,const BN_ULONG *np,const BN_ULONG *n0);\n\tint bn_mul_mont_t4_8(BN_ULONG *rp,const BN_ULONG *ap,\n\t\t\tconst void *bp,const BN_ULONG *np,const BN_ULONG *n0);\n\tint bn_mul_mont_t4_16(BN_ULONG *rp,const BN_ULONG *ap,\n\t\t\tconst void *bp,const BN_ULONG *np,const BN_ULONG *n0);\n\tint bn_mul_mont_t4_24(BN_ULONG *rp,const BN_ULONG *ap,\n\t\t\tconst void *bp,const BN_ULONG *np,const BN_ULONG *n0);\n\tint bn_mul_mont_t4_32(BN_ULONG *rp,const BN_ULONG *ap,\n\t\t\tconst void *bp,const BN_ULONG *np,const BN_ULONG *n0);\n\tstatic const bn_mul_mont_f mul_funcs[4] = {\n\t\t\tbn_mul_mont_t4_8,\tbn_mul_mont_t4_16,\n\t\t\tbn_mul_mont_t4_24,\tbn_mul_mont_t4_32 };\n\tbn_mul_mont_f mul_worker = mul_funcs[top/16-1];\n\tvoid bn_mul_mont_vis3(BN_ULONG *rp,const BN_ULONG *ap,\n\t\t\tconst void *bp,const BN_ULONG *np,\n\t\t\tconst BN_ULONG *n0,int num);\n\tvoid bn_mul_mont_t4(BN_ULONG *rp,const BN_ULONG *ap,\n\t\t\tconst void *bp,const BN_ULONG *np,\n\t\t\tconst BN_ULONG *n0,int num);\n\tvoid bn_mul_mont_gather5_t4(BN_ULONG *rp,const BN_ULONG *ap,\n\t\t\tconst void *table,const BN_ULONG *np,\n\t\t\tconst BN_ULONG *n0,int num,int power);\n\tvoid bn_flip_n_scatter5_t4(const BN_ULONG *inp,size_t num,\n\t\t\tvoid *table,size_t power);\n\tvoid bn_gather5_t4(BN_ULONG *out,size_t num,\n\t\t\tvoid *table,size_t power);\n\tvoid bn_flip_t4(BN_ULONG *dst,BN_ULONG *src,size_t num);\n\tBN_ULONG *np=mont->N.d, *n0=mont->n0;\n\tint stride = 5*(6-(top/16-1));\n\tfor (i=am.top; i<top; i++)\tam.d[i]=0;\n\tfor (i=tmp.top; i<top; i++)\ttmp.d[i]=0;\n\tbn_flip_n_scatter5_t4(tmp.d,top,powerbuf,0);\n\tbn_flip_n_scatter5_t4(am.d,top,powerbuf,1);\n\tif (!(*mul_worker)(tmp.d,am.d,am.d,np,n0) &&\n\t    !(*mul_worker)(tmp.d,am.d,am.d,np,n0))\n\t\tbn_mul_mont_vis3(tmp.d,am.d,am.d,np,n0,top);\n\tbn_flip_n_scatter5_t4(tmp.d,top,powerbuf,2);\n\tfor (i=3; i<32; i++)\n\t\t{\n\t\tif (!(*mul_worker)(tmp.d,tmp.d,am.d,np,n0) &&\n\t\t    !(*mul_worker)(tmp.d,tmp.d,am.d,np,n0))\n\t\t\tbn_mul_mont_vis3(tmp.d,tmp.d,am.d,np,n0,top);\n\t\tbn_flip_n_scatter5_t4(tmp.d,top,powerbuf,i);\n\t\t}\n\tnp = alloca(top*sizeof(BN_ULONG));\n\ttop /= 2;\n\tbn_flip_t4(np,mont->N.d,top);\n\tbits--;\n\tfor (wvalue=0, i=bits%5; i>=0; i--,bits--)\n\t\twvalue = (wvalue<<1)+BN_is_bit_set(p,bits);\n\tbn_gather5_t4(tmp.d,top,powerbuf,wvalue);\n\twhile (bits >= 0)\n\t\t{\n\t\tif (bits < stride) stride = bits+1;\n\t\tbits -= stride;\n\t\twvalue = bn_get_bits(p,bits+1);\n\t\tif ((*pwr5_worker)(tmp.d,np,n0,powerbuf,wvalue,stride)) continue;\n\t\tif ((*pwr5_worker)(tmp.d,np,n0,powerbuf,wvalue,stride)) continue;\n\t\tbits += stride-5;\n\t\twvalue >>= stride-5;\n\t\twvalue &= 31;\n\t\tbn_mul_mont_t4(tmp.d,tmp.d,tmp.d,np,n0,top);\n\t\tbn_mul_mont_t4(tmp.d,tmp.d,tmp.d,np,n0,top);\n\t\tbn_mul_mont_t4(tmp.d,tmp.d,tmp.d,np,n0,top);\n\t\tbn_mul_mont_t4(tmp.d,tmp.d,tmp.d,np,n0,top);\n\t\tbn_mul_mont_t4(tmp.d,tmp.d,tmp.d,np,n0,top);\n\t\tbn_mul_mont_gather5_t4(tmp.d,tmp.d,powerbuf,np,n0,top,wvalue);\n\t\t}\n\tbn_flip_t4(tmp.d,tmp.d,top);\n\ttop *= 2;\n\ttmp.top=top;\n\tbn_correct_top(&tmp);\n\tOPENSSL_cleanse(np,top*sizeof(BN_ULONG));\n\t}\n    else\n#endif\n#if defined(OPENSSL_BN_ASM_MONT5)\n    if (window==5)\n\t{\n\tvoid bn_mul_mont_gather5(BN_ULONG *rp,const BN_ULONG *ap,\n\t\t\tconst void *table,const BN_ULONG *np,\n\t\t\tconst BN_ULONG *n0,int num,int power);\n\tvoid bn_scatter5(const BN_ULONG *inp,size_t num,\n\t\t\tvoid *table,size_t power);\n\tvoid bn_gather5(BN_ULONG *out,size_t num,\n\t\t\tvoid *table,size_t power);\n\tBN_ULONG *np=mont->N.d, *n0=mont->n0;\n\tfor (i=am.top; i<top; i++)\tam.d[i]=0;\n\tfor (i=tmp.top; i<top; i++)\ttmp.d[i]=0;\n\tbn_scatter5(tmp.d,top,powerbuf,0);\n\tbn_scatter5(am.d,am.top,powerbuf,1);\n\tbn_mul_mont(tmp.d,am.d,am.d,np,n0,top);\n\tbn_scatter5(tmp.d,top,powerbuf,2);\n#if 0\n\tfor (i=3; i<32; i++)\n\t\t{\n\t\tbn_mul_mont_gather5(tmp.d,am.d,powerbuf,np,n0,top,i-1);\n\t\tbn_scatter5(tmp.d,top,powerbuf,i);\n\t\t}\n#else\n\tfor (i=4; i<32; i*=2)\n\t\t{\n\t\tbn_mul_mont(tmp.d,tmp.d,tmp.d,np,n0,top);\n\t\tbn_scatter5(tmp.d,top,powerbuf,i);\n\t\t}\n\tfor (i=3; i<8; i+=2)\n\t\t{\n\t\tint j;\n\t\tbn_mul_mont_gather5(tmp.d,am.d,powerbuf,np,n0,top,i-1);\n\t\tbn_scatter5(tmp.d,top,powerbuf,i);\n\t\tfor (j=2*i; j<32; j*=2)\n\t\t\t{\n\t\t\tbn_mul_mont(tmp.d,tmp.d,tmp.d,np,n0,top);\n\t\t\tbn_scatter5(tmp.d,top,powerbuf,j);\n\t\t\t}\n\t\t}\n\tfor (; i<16; i+=2)\n\t\t{\n\t\tbn_mul_mont_gather5(tmp.d,am.d,powerbuf,np,n0,top,i-1);\n\t\tbn_scatter5(tmp.d,top,powerbuf,i);\n\t\tbn_mul_mont(tmp.d,tmp.d,tmp.d,np,n0,top);\n\t\tbn_scatter5(tmp.d,top,powerbuf,2*i);\n\t\t}\n\tfor (; i<32; i+=2)\n\t\t{\n\t\tbn_mul_mont_gather5(tmp.d,am.d,powerbuf,np,n0,top,i-1);\n\t\tbn_scatter5(tmp.d,top,powerbuf,i);\n\t\t}\n#endif\n\tbits--;\n\tfor (wvalue=0, i=bits%5; i>=0; i--,bits--)\n\t\twvalue = (wvalue<<1)+BN_is_bit_set(p,bits);\n\tbn_gather5(tmp.d,top,powerbuf,wvalue);\n\twhile (bits >= 0)\n\t\t{\n\t\tfor (wvalue=0, i=0; i<5; i++,bits--)\n\t\t\twvalue = (wvalue<<1)+BN_is_bit_set(p,bits);\n\t\tbn_mul_mont(tmp.d,tmp.d,tmp.d,np,n0,top);\n\t\tbn_mul_mont(tmp.d,tmp.d,tmp.d,np,n0,top);\n\t\tbn_mul_mont(tmp.d,tmp.d,tmp.d,np,n0,top);\n\t\tbn_mul_mont(tmp.d,tmp.d,tmp.d,np,n0,top);\n\t\tbn_mul_mont(tmp.d,tmp.d,tmp.d,np,n0,top);\n\t\tbn_mul_mont_gather5(tmp.d,tmp.d,powerbuf,np,n0,top,wvalue);\n\t\t}\n\ttmp.top=top;\n\tbn_correct_top(&tmp);\n\t}\n    else\n#endif\n\t{\n\tif (!MOD_EXP_CTIME_COPY_TO_PREBUF(&tmp, top, powerbuf, 0, numPowers)) goto err;\n\tif (!MOD_EXP_CTIME_COPY_TO_PREBUF(&am,  top, powerbuf, 1, numPowers)) goto err;\n\tif (window > 1)\n\t\t{\n\t\tif (!BN_mod_mul_montgomery(&tmp,&am,&am,mont,ctx))\tgoto err;\n\t\tif (!MOD_EXP_CTIME_COPY_TO_PREBUF(&tmp, top, powerbuf, 2, numPowers)) goto err;\n\t\tfor (i=3; i<numPowers; i++)\n\t\t\t{\n\t\t\tif (!BN_mod_mul_montgomery(&tmp,&am,&tmp,mont,ctx))\n\t\t\t\tgoto err;\n\t\t\tif (!MOD_EXP_CTIME_COPY_TO_PREBUF(&tmp, top, powerbuf, i, numPowers)) goto err;\n\t\t\t}\n\t\t}\n\tbits--;\n\tfor (wvalue=0, i=bits%window; i>=0; i--,bits--)\n\t\twvalue = (wvalue<<1)+BN_is_bit_set(p,bits);\n\tif (!MOD_EXP_CTIME_COPY_FROM_PREBUF(&tmp,top,powerbuf,wvalue,numPowers)) goto err;\n \twhile (bits >= 0)\n  \t\t{\n \t\twvalue=0;\n \t\tfor (i=0; i<window; i++,bits--)\n \t\t\t{\n\t\t\tif (!BN_mod_mul_montgomery(&tmp,&tmp,&tmp,mont,ctx))\tgoto err;\n\t\t\twvalue = (wvalue<<1)+BN_is_bit_set(p,bits);\n  \t\t\t}\n\t\tif (!MOD_EXP_CTIME_COPY_FROM_PREBUF(&am, top, powerbuf, wvalue, numPowers)) goto err;\n \t\tif (!BN_mod_mul_montgomery(&tmp,&tmp,&am,mont,ctx)) goto err;\n  \t\t}\n\t}\n#if defined(OPENSSL_BN_ASM_MONT) && (defined(__sparc__) || defined(__sparc))\n\tif (OPENSSL_sparcv9cap_P[0]&(SPARCV9_VIS3|SPARCV9_PREFER_FPU))\n\t\t{\n\t\tam.d[0] = 1;\n\t\tfor (i=1;i<top;i++) am.d[i] = 0;\n\t\tif (!BN_mod_mul_montgomery(rr,&tmp,&am,mont,ctx)) goto err;\n\t\t}\n\telse\n#endif\n\tif (!BN_from_montgomery(rr,&tmp,mont,ctx)) goto err;\n\tret=1;\nerr:\n\tif ((in_mont == NULL) && (mont != NULL)) BN_MONT_CTX_free(mont);\n\tif (powerbuf!=NULL)\n\t\t{\n\t\tOPENSSL_cleanse(powerbuf,powerbufLen);\n\t\tif (powerbufFree) OPENSSL_free(powerbufFree);\n\t\t}\n\tBN_CTX_end(ctx);\n\treturn(ret);\n\t}', 'int BN_mod_mul_montgomery(BIGNUM *r, const BIGNUM *a, const BIGNUM *b,\n\t\t\t  BN_MONT_CTX *mont, BN_CTX *ctx)\n\t{\n\tBIGNUM *tmp;\n\tint ret=0;\n#if defined(OPENSSL_BN_ASM_MONT) && defined(MONT_WORD)\n\tint num = mont->N.top;\n\tif (num>1 && a->top==num && b->top==num)\n\t\t{\n\t\tif (bn_wexpand(r,num) == NULL) return(0);\n\t\tif (bn_mul_mont(r->d,a->d,b->d,mont->N.d,mont->n0,num))\n\t\t\t{\n\t\t\tr->neg = a->neg^b->neg;\n\t\t\tr->top = num;\n\t\t\tbn_correct_top(r);\n\t\t\treturn(1);\n\t\t\t}\n\t\t}\n#endif\n\tBN_CTX_start(ctx);\n\ttmp = BN_CTX_get(ctx);\n\tif (tmp == NULL) goto err;\n\tbn_check_top(tmp);\n\tif (a == b)\n\t\t{\n\t\tif (!BN_sqr(tmp,a,ctx)) goto err;\n\t\t}\n\telse\n\t\t{\n\t\tif (!BN_mul(tmp,a,b,ctx)) goto err;\n\t\t}\n#ifdef MONT_WORD\n\tif (!BN_from_montgomery_word(r,tmp,mont)) goto err;\n#else\n\tif (!BN_from_montgomery(r,tmp,mont,ctx)) goto err;\n#endif\n\tbn_check_top(r);\n\tret=1;\nerr:\n\tBN_CTX_end(ctx);\n\treturn(ret);\n\t}', 'static int BN_from_montgomery_word(BIGNUM *ret, BIGNUM *r, BN_MONT_CTX *mont)\n\t{\n\tBIGNUM *n;\n\tBN_ULONG *ap,*np,*rp,n0,v,carry;\n\tint nl,max,i;\n\tn= &(mont->N);\n\tnl=n->top;\n\tif (nl == 0) { ret->top=0; return(1); }\n\tmax=(2*nl);\n\tif (bn_wexpand(r,max) == NULL) return(0);\n\tr->neg^=n->neg;\n\tnp=n->d;\n\trp=r->d;\n#if 1\n\tfor (i=r->top; i<max; i++)\n\t\trp[i]=0;\n#else\n\tmemset(&(rp[r->top]),0,(max-r->top)*sizeof(BN_ULONG));\n#endif\n\tr->top=max;\n\tn0=mont->n0[0];\n#ifdef BN_COUNT\n\tfprintf(stderr,"word BN_from_montgomery_word %d * %d\\n",nl,nl);\n#endif\n\tfor (carry=0, i=0; i<nl; i++, rp++)\n\t\t{\n#ifdef __TANDEM\n                {\n                   long long t1;\n                   long long t2;\n                   long long t3;\n                   t1 = rp[0] * (n0 & 0177777);\n                   t2 = 037777600000l;\n                   t2 = n0 & t2;\n                   t3 = rp[0] & 0177777;\n                   t2 = (t3 * t2) & BN_MASK2;\n                   t1 = t1 + t2;\n                   v=bn_mul_add_words(rp,np,nl,(BN_ULONG) t1);\n                }\n#else\n\t\tv=bn_mul_add_words(rp,np,nl,(rp[0]*n0)&BN_MASK2);\n#endif\n\t\tv = (v+carry+rp[nl])&BN_MASK2;\n\t\tcarry |= (v != rp[nl]);\n\t\tcarry &= (v <= rp[nl]);\n\t\trp[nl]=v;\n\t\t}\n\tif (bn_wexpand(ret,nl) == NULL) return(0);\n\tret->top=nl;\n\tret->neg=r->neg;\n\trp=ret->d;\n\tap=&(r->d[nl]);\n#define BRANCH_FREE 1\n#if BRANCH_FREE\n\t{\n\tBN_ULONG *nrp;\n\tsize_t m;\n\tv=bn_sub_words(rp,ap,np,nl)-carry;\n\tm=(0-(size_t)v);\n\tnrp=(BN_ULONG *)(((PTR_SIZE_INT)rp&~m)|((PTR_SIZE_INT)ap&m));\n\tfor (i=0,nl-=4; i<nl; i+=4)\n\t\t{\n\t\tBN_ULONG t1,t2,t3,t4;\n\t\tt1=nrp[i+0];\n\t\tt2=nrp[i+1];\n\t\tt3=nrp[i+2];\tap[i+0]=0;\n\t\tt4=nrp[i+3];\tap[i+1]=0;\n\t\trp[i+0]=t1;\tap[i+2]=0;\n\t\trp[i+1]=t2;\tap[i+3]=0;\n\t\trp[i+2]=t3;\n\t\trp[i+3]=t4;\n\t\t}\n\tfor (nl+=4; i<nl; i++)\n\t\trp[i]=nrp[i], ap[i]=0;\n\t}\n#else\n\tif (bn_sub_words (rp,ap,np,nl)-carry)\n\t\tmemcpy(rp,ap,nl*sizeof(BN_ULONG));\n#endif\n\tbn_correct_top(r);\n\tbn_correct_top(ret);\n\tbn_check_top(ret);\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}']