summaryrefslogtreecommitdiffstats
path: root/crypto/bn/bntest.c
diff options
context:
space:
mode:
authorBodo Möller <bodo@openssl.org>2001-03-08 15:56:15 +0000
committerBodo Möller <bodo@openssl.org>2001-03-08 15:56:15 +0000
commitc62b26fdc6bb176541ec56498090ff6f2ad4a885 (patch)
tree8c29e8e873252b41f54761a71c2e75e15e154ac8 /crypto/bn/bntest.c
parente0a9ba9c3c4ea7bf27ceff33633cd48b542de860 (diff)
Hide BN_CTX structure details.
Incease the number of BIGNUMs in a BN_CTX.
Diffstat (limited to 'crypto/bn/bntest.c')
-rw-r--r--crypto/bn/bntest.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/crypto/bn/bntest.c b/crypto/bn/bntest.c
index 43a620e3a5..443cf420e5 100644
--- a/crypto/bn/bntest.c
+++ b/crypto/bn/bntest.c
@@ -485,9 +485,11 @@ int test_mul(BIO *bp)
{
BIGNUM a,b,c,d,e;
int i;
- BN_CTX ctx;
+ BN_CTX *ctx;
- BN_CTX_init(&ctx);
+ ctx = BN_CTX_new();
+ if (ctx == NULL) exit(1);
+
BN_init(&a);
BN_init(&b);
BN_init(&c);
@@ -505,7 +507,7 @@ int test_mul(BIO *bp)
BN_bntest_rand(&b,i-num1,0,0);
a.neg=rand_neg();
b.neg=rand_neg();
- BN_mul(&c,&a,&b,&ctx);
+ BN_mul(&c,&a,&b,ctx);
if (bp != NULL)
{
if (!results)
@@ -518,7 +520,7 @@ int test_mul(BIO *bp)
BN_print(bp,&c);
BIO_puts(bp,"\n");
}
- BN_div(&d,&e,&c,&a,&ctx);
+ BN_div(&d,&e,&c,&a,ctx);
BN_sub(&d,&d,&b);
if(!BN_is_zero(&d) || !BN_is_zero(&e))
{
@@ -531,7 +533,7 @@ int test_mul(BIO *bp)
BN_free(&c);
BN_free(&d);
BN_free(&e);
- BN_CTX_free(&ctx);
+ BN_CTX_free(ctx);
return(1);
}