summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortb <>2025-01-08 20:21:28 +0000
committertb <>2025-01-08 20:21:28 +0000
commitca8f8299cdbaef3933495df4f20083ce2f2a6d7c (patch)
tree8f67f83480c6ebfa5245ae3e1aaefb9fd108e9c4
parente70a35d60c6eeb547186cecf240202b9d25903f4 (diff)
downloadopenbsd-ca8f8299cdbaef3933495df4f20083ce2f2a6d7c.tar.gz
openbsd-ca8f8299cdbaef3933495df4f20083ce2f2a6d7c.tar.bz2
openbsd-ca8f8299cdbaef3933495df4f20083ce2f2a6d7c.zip
Improve order of things in BN_RECP_CTX_set()
+ some whitespace cosmetics
-rw-r--r--src/lib/libcrypto/bn/bn_recp.c7
1 files 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 @@
1/* $OpenBSD: bn_recp.c,v 1.24 2025/01/08 20:18:12 tb Exp $ */ 1/* $OpenBSD: bn_recp.c,v 1.25 2025/01/08 20:21:28 tb Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -101,9 +101,11 @@ BN_RECP_CTX_set(BN_RECP_CTX *recp, const BIGNUM *d, BN_CTX *ctx)
101{ 101{
102 if (!bn_copy(&recp->N, d)) 102 if (!bn_copy(&recp->N, d))
103 return 0; 103 return 0;
104 recp->num_bits = BN_num_bits(&recp->N);
105
104 BN_zero(&recp->Nr); 106 BN_zero(&recp->Nr);
105 recp->num_bits = BN_num_bits(d);
106 recp->shift = 0; 107 recp->shift = 0;
108
107 return 1; 109 return 1;
108} 110}
109 111
@@ -229,7 +231,6 @@ err:
229 return ret; 231 return ret;
230} 232}
231 233
232
233int 234int
234BN_mod_mul_reciprocal(BIGNUM *r, const BIGNUM *x, const BIGNUM *y, 235BN_mod_mul_reciprocal(BIGNUM *r, const BIGNUM *x, const BIGNUM *y,
235 BN_RECP_CTX *recp, BN_CTX *ctx) 236 BN_RECP_CTX *recp, BN_CTX *ctx)