From 9b141126d4b6f0636bc047e81b846c193ae26611 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ulf=20M=C3=B6ller?= Date: Sat, 5 Feb 2000 14:17:32 +0000 Subject: New functions BN_CTX_start(), BN_CTX_get(), BN_CTX_end() to access temporary BIGNUMs. BN_CTX still uses a fixed number of BIGNUMs, but the BN_CTX implementation could now easily be changed. --- crypto/bn/bn_lib.c | 37 ------------------------------------- 1 file changed, 37 deletions(-) (limited to 'crypto/bn/bn_lib.c') diff --git a/crypto/bn/bn_lib.c b/crypto/bn/bn_lib.c index e734909968..8c62761d4c 100644 --- a/crypto/bn/bn_lib.c +++ b/crypto/bn/bn_lib.c @@ -304,43 +304,6 @@ BIGNUM *BN_new(void) return(ret); } - -BN_CTX *BN_CTX_new(void) - { - BN_CTX *ret; - - ret=(BN_CTX *)Malloc(sizeof(BN_CTX)); - if (ret == NULL) - { - BNerr(BN_F_BN_CTX_NEW,ERR_R_MALLOC_FAILURE); - return(NULL); - } - - BN_CTX_init(ret); - ret->flags=BN_FLG_MALLOCED; - return(ret); - } - -void BN_CTX_init(BN_CTX *ctx) - { - memset(ctx,0,sizeof(BN_CTX)); - ctx->tos=0; - ctx->flags=0; - } - -void BN_CTX_free(BN_CTX *c) - { - int i; - - if(c == NULL) - return; - - for (i=0; ibn[i])); - if (c->flags & BN_FLG_MALLOCED) - Free(c); - } - /* This is an internal function that should not be used in applications. * It ensures that 'b' has enough room for a 'bits' bit number. It is * mostly used by the various BIGNUM routines. If there is an error, -- cgit v1.2.3