int bn_mull(BIGNUM *r,BIGNUM *a,BIGNUM *b, BN_CTX *ctx);
-int bn_mull(r,a,b,ctx)
-BIGNUM *r,*a,*b;
-BN_CTX *ctx;
+int bn_mull(BIGNUM *r, BIGNUM *a, BIGNUM *b, BN_CTX *ctx)
{
int top,i,j,k,al,bl;
BIGNUM *t;
bn_check_top(a);
bn_check_top(b);
bn_check_top(r);
+ BN_CTX_start(ctx);
al=a->top;
bl=b->top;
j=BN_num_bits_word((BN_ULONG)al);
j=1<<(j-1);
k=j+j;
- t= &(ctx->bn[ctx->tos]);
+ t = BN_CTX_get(ctx);
if (al == j) /* exact multiple */
{
bn_wexpand(t,k*2);
r->top=top;
}
end:
+ BN_CTX_end(ctx);
bn_fix_top(r);
return(1);
}
#endif
-void bn_mul_normal(r,a,na,b,nb)
-BN_ULONG *r,*a;
-int na;
-BN_ULONG *b;
-int nb;
+void bn_mul_normal(BN_ULONG *r, BN_ULONG *a, int na, BN_ULONG *b, int nb)
{
BN_ULONG *rr;
}
#if 1
-void bn_mul_low_normal(r,a,b,n)
-BN_ULONG *r,*a,*b;
-int n;
+void bn_mul_low_normal(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b, int n)
{
#ifdef BN_COUNT
printf(" bn_mul_low_normal %d * %d\n",n,n);