diff options
| author | tb <> | 2025-01-08 20:21:28 +0000 |
|---|---|---|
| committer | tb <> | 2025-01-08 20:21:28 +0000 |
| commit | 5eda5e9155502d3f84e351050563569c99460c35 (patch) | |
| tree | 8f67f83480c6ebfa5245ae3e1aaefb9fd108e9c4 /src | |
| parent | 7aee52d999a79ef88ee7819f874b474a0be08bee (diff) | |
| download | openbsd-5eda5e9155502d3f84e351050563569c99460c35.tar.gz openbsd-5eda5e9155502d3f84e351050563569c99460c35.tar.bz2 openbsd-5eda5e9155502d3f84e351050563569c99460c35.zip | |
Improve order of things in BN_RECP_CTX_set()
+ some whitespace cosmetics
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/libcrypto/bn/bn_recp.c | 7 |
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 | |||
| 233 | int | 234 | int |
| 234 | BN_mod_mul_reciprocal(BIGNUM *r, const BIGNUM *x, const BIGNUM *y, | 235 | BN_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) |
