summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjsing <>2023-02-19 13:27:49 +0000
committerjsing <>2023-02-19 13:27:49 +0000
commitae840b7479382161225377e508db840c65d18cc2 (patch)
tree90152d6b6b064877ad2a883b1029eba27d3cf913
parent7440c5fbd9e9c40e46c20a80100dab9c467a2334 (diff)
downloadopenbsd-ae840b7479382161225377e508db840c65d18cc2.tar.gz
openbsd-ae840b7479382161225377e508db840c65d18cc2.tar.bz2
openbsd-ae840b7479382161225377e508db840c65d18cc2.zip
Move struct bn_mont_ctx_st from bn_local.h to bn_mont.c.
No code outside of bn_mont.c needs access to it. ok tb@
-rw-r--r--src/lib/libcrypto/bn/bn_local.h14
-rw-r--r--src/lib/libcrypto/bn/bn_mont.c14
2 files changed, 14 insertions, 14 deletions
diff --git a/src/lib/libcrypto/bn/bn_local.h b/src/lib/libcrypto/bn/bn_local.h
index 6d308218e7..336ad4ed20 100644
--- a/src/lib/libcrypto/bn/bn_local.h
+++ b/src/lib/libcrypto/bn/bn_local.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: bn_local.h,v 1.11 2023/02/17 05:30:20 jsing Exp $ */ 1/* $OpenBSD: bn_local.h,v 1.12 2023/02/19 13:27:49 jsing 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 *
@@ -127,18 +127,6 @@ struct bignum_st {
127 int flags; 127 int flags;
128}; 128};
129 129
130/* Used for montgomery multiplication */
131struct bn_mont_ctx_st {
132 int ri; /* number of bits in R */
133 BIGNUM RR; /* used to convert to montgomery form */
134 BIGNUM N; /* The modulus */
135 BIGNUM Ni; /* R*(1/R mod N) - N*Ni = 1
136 * (Ni is only stored for bignum algorithm) */
137 BN_ULONG n0[2];/* least significant word(s) of Ni;
138 (type changed with 0.9.9, was "BN_ULONG n0;" before) */
139 int flags;
140};
141
142/* Used for reciprocal division/mod functions 130/* Used for reciprocal division/mod functions
143 * It cannot be shared between threads 131 * It cannot be shared between threads
144 */ 132 */
diff --git a/src/lib/libcrypto/bn/bn_mont.c b/src/lib/libcrypto/bn/bn_mont.c
index 4f2d4548cc..cd75a1ec13 100644
--- a/src/lib/libcrypto/bn/bn_mont.c
+++ b/src/lib/libcrypto/bn/bn_mont.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bn_mont.c,v 1.37 2023/02/13 04:25:37 jsing Exp $ */ 1/* $OpenBSD: bn_mont.c,v 1.38 2023/02/19 13:27:49 jsing 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 *
@@ -123,6 +123,18 @@
123 123
124#define MONT_WORD /* use the faster word-based algorithm */ 124#define MONT_WORD /* use the faster word-based algorithm */
125 125
126/* Used for montgomery multiplication */
127struct bn_mont_ctx_st {
128 int ri; /* number of bits in R */
129 BIGNUM RR; /* used to convert to montgomery form */
130 BIGNUM N; /* The modulus */
131 BIGNUM Ni; /* R*(1/R mod N) - N*Ni = 1
132 * (Ni is only stored for bignum algorithm) */
133 BN_ULONG n0[2];/* least significant word(s) of Ni;
134 (type changed with 0.9.9, was "BN_ULONG n0;" before) */
135 int flags;
136};
137
126BN_MONT_CTX * 138BN_MONT_CTX *
127BN_MONT_CTX_new(void) 139BN_MONT_CTX_new(void)
128{ 140{