From ca8f8299cdbaef3933495df4f20083ce2f2a6d7c Mon Sep 17 00:00:00 2001 From: tb <> Date: Wed, 8 Jan 2025 20:21:28 +0000 Subject: Improve order of things in BN_RECP_CTX_set() + some whitespace cosmetics --- src/lib/libcrypto/bn/bn_recp.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/lib/libcrypto/bn/bn_recp.c b/src/lib/libcrypto/bn/bn_recp.c index 5990413052..44c5b05e4d 100644 --- a/src/lib/libcrypto/bn/bn_recp.c +++ b/src/lib/libcrypto/bn/bn_recp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bn_recp.c,v 1.24 2025/01/08 20:18:12 tb Exp $ */ +/* $OpenBSD: bn_recp.c,v 1.25 2025/01/08 20:21:28 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -101,9 +101,11 @@ BN_RECP_CTX_set(BN_RECP_CTX *recp, const BIGNUM *d, BN_CTX *ctx) { if (!bn_copy(&recp->N, d)) return 0; + recp->num_bits = BN_num_bits(&recp->N); + BN_zero(&recp->Nr); - recp->num_bits = BN_num_bits(d); recp->shift = 0; + return 1; } @@ -229,7 +231,6 @@ err: return ret; } - int BN_mod_mul_reciprocal(BIGNUM *r, const BIGNUM *x, const BIGNUM *y, BN_RECP_CTX *recp, BN_CTX *ctx) -- cgit v1.2.3-55-g6feb