diff options
author | Bodo Möller <bodo@openssl.org> | 2001-03-08 15:56:15 +0000 |
---|---|---|
committer | Bodo Möller <bodo@openssl.org> | 2001-03-08 15:56:15 +0000 |
commit | c62b26fdc6bb176541ec56498090ff6f2ad4a885 (patch) | |
tree | 8c29e8e873252b41f54761a71c2e75e15e154ac8 /crypto/engine/hw_atalla.c | |
parent | e0a9ba9c3c4ea7bf27ceff33633cd48b542de860 (diff) |
Hide BN_CTX structure details.
Incease the number of BIGNUMs in a BN_CTX.
Diffstat (limited to 'crypto/engine/hw_atalla.c')
-rw-r--r-- | crypto/engine/hw_atalla.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/crypto/engine/hw_atalla.c b/crypto/engine/hw_atalla.c index 9cd9bac5d3..84105516ee 100644 --- a/crypto/engine/hw_atalla.c +++ b/crypto/engine/hw_atalla.c @@ -318,11 +318,12 @@ static int atalla_mod_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, goto err; } /* Prepare the params */ + BN_CTX_start(ctx); modulus = BN_CTX_get(ctx); exponent = BN_CTX_get(ctx); argument = BN_CTX_get(ctx); result = BN_CTX_get(ctx); - if(!modulus || !exponent || !argument || !result) + if (!result) { ENGINEerr(ENGINE_F_ATALLA_MOD_EXP,ENGINE_R_BN_CTX_FULL); goto err; @@ -360,10 +361,7 @@ static int atalla_mod_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_bin2bn((unsigned char *)result->d, numbytes, r); to_return = 1; err: - if(modulus) ctx->tos--; - if(exponent) ctx->tos--; - if(argument) ctx->tos--; - if(result) ctx->tos--; + BN_CTX_end(ctx); return to_return; } |