int bn_limit_bits_mont=0;
int bn_limit_num_mont=8; /* (1<<bn_limit_bits_mont) */
-void BN_set_params(mult,high,low,mont)
-int mult,high,low,mont;
+void BN_set_params(int mult, int high, int low, int mont)
{
if (mult >= 0)
{
}
}
-int BN_get_params(which)
-int which;
+int BN_get_params(int which)
{
if (which == 0) return(bn_limit_bits);
else if (which == 1) return(bn_limit_bits_high);
else return(0);
}
-BIGNUM *BN_value_one()
+BIGNUM *BN_value_one(void)
{
static BN_ULONG data_one=1L;
static BIGNUM const_one={&data_one,1,1,0};
return(&const_one);
}
-char *BN_options()
+char *BN_options(void)
{
static int init=0;
static char data[16];
return(data);
}
-int BN_num_bits_word(l)
-BN_ULONG l;
+int BN_num_bits_word(BN_ULONG l)
{
static char bits[256]={
0,1,2,2,3,3,3,3,4,4,4,4,4,4,4,4,
}
}
-int BN_num_bits(a)
-BIGNUM *a;
+int BN_num_bits(BIGNUM *a)
{
BN_ULONG l;
int i;
return(i+BN_num_bits_word(l));
}
-void BN_clear_free(a)
-BIGNUM *a;
+void BN_clear_free(BIGNUM *a)
{
int i;
Free(a);
}
-void BN_free(a)
-BIGNUM *a;
+void BN_free(BIGNUM *a)
{
if (a == NULL) return;
if ((a->d != NULL) && !(BN_get_flags(a,BN_FLG_STATIC_DATA)))
Free(a);
}
-void BN_init(a)
-BIGNUM *a;
+void BN_init(BIGNUM *a)
{
memset(a,0,sizeof(BIGNUM));
}
-BIGNUM *BN_new()
+BIGNUM *BN_new(void)
{
BIGNUM *ret;
}
-BN_CTX *BN_CTX_new()
+BN_CTX *BN_CTX_new(void)
{
BN_CTX *ret;
return(ret);
}
-void BN_CTX_init(ctx)
-BN_CTX *ctx;
+void BN_CTX_init(BN_CTX *ctx)
{
memset(ctx,0,sizeof(BN_CTX));
ctx->tos=0;
ctx->flags=0;
}
-void BN_CTX_free(c)
-BN_CTX *c;
+void BN_CTX_free(BN_CTX *c)
{
int i;
Free(c);
}
-BIGNUM *bn_expand2(b, words)
-BIGNUM *b;
-int words;
+BIGNUM *bn_expand2(BIGNUM *b, int words)
{
BN_ULONG *A,*B,*a;
int i,j;
return(b);
}
-BIGNUM *BN_dup(a)
-BIGNUM *a;
+BIGNUM *BN_dup(BIGNUM *a)
{
BIGNUM *r;
return((BIGNUM *)BN_copy(r,a));
}
-BIGNUM *BN_copy(a, b)
-BIGNUM *a;
-BIGNUM *b;
+BIGNUM *BN_copy(BIGNUM *a, BIGNUM *b)
{
int i;
BN_ULONG *A,*B;
return(a);
}
-void BN_clear(a)
-BIGNUM *a;
+void BN_clear(BIGNUM *a)
{
if (a->d != NULL)
memset(a->d,0,a->max*sizeof(a->d[0]));
a->neg=0;
}
-BN_ULONG BN_get_word(a)
-BIGNUM *a;
+BN_ULONG BN_get_word(BIGNUM *a)
{
int i,n;
BN_ULONG ret=0;
return(ret);
}
-int BN_set_word(a,w)
-BIGNUM *a;
-BN_ULONG w;
+int BN_set_word(BIGNUM *a, BN_ULONG w)
{
int i,n;
if (bn_expand(a,sizeof(BN_ULONG)*8) == NULL) return(0);
}
/* ignore negative */
-BIGNUM *BN_bin2bn(s, len, ret)
-unsigned char *s;
-int len;
-BIGNUM *ret;
+BIGNUM *BN_bin2bn(unsigned char *s, int len, BIGNUM *ret)
{
unsigned int i,m;
unsigned int n;
}
/* ignore negative */
-int BN_bn2bin(a, to)
-BIGNUM *a;
-unsigned char *to;
+int BN_bn2bin(BIGNUM *a, unsigned char *to)
{
int n,i;
BN_ULONG l;
return(n);
}
-int BN_ucmp(a, b)
-BIGNUM *a;
-BIGNUM *b;
+int BN_ucmp(BIGNUM *a, BIGNUM *b)
{
int i;
BN_ULONG t1,t2,*ap,*bp;
return(0);
}
-int BN_cmp(a, b)
-BIGNUM *a;
-BIGNUM *b;
+int BN_cmp(BIGNUM *a, BIGNUM *b)
{
int i;
int gt,lt;
return(0);
}
-int BN_set_bit(a, n)
-BIGNUM *a;
-int n;
+int BN_set_bit(BIGNUM *a, int n)
{
int i,j,k;
return(1);
}
-int BN_clear_bit(a, n)
-BIGNUM *a;
-int n;
+int BN_clear_bit(BIGNUM *a, int n)
{
int i,j;
return(1);
}
-int BN_is_bit_set(a, n)
-BIGNUM *a;
-int n;
+int BN_is_bit_set(BIGNUM *a, int n)
{
int i,j;
return((a->d[i]&(((BN_ULONG)1)<<j))?1:0);
}
-int BN_mask_bits(a,n)
-BIGNUM *a;
-int n;
+int BN_mask_bits(BIGNUM *a, int n)
{
int b,w;
return(1);
}
-int bn_cmp_words(a,b,n)
-BN_ULONG *a,*b;
-int n;
+int bn_cmp_words(BN_ULONG *a, BN_ULONG *b, int n)
{
int i;
BN_ULONG aa,bb;