summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/bn/bn_mont.c
diff options
context:
space:
mode:
authorjsing <>2023-02-19 13:27:49 +0000
committerjsing <>2023-02-19 13:27:49 +0000
commitae840b7479382161225377e508db840c65d18cc2 (patch)
tree90152d6b6b064877ad2a883b1029eba27d3cf913 /src/lib/libcrypto/bn/bn_mont.c
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@
Diffstat (limited to 'src/lib/libcrypto/bn/bn_mont.c')
-rw-r--r--src/lib/libcrypto/bn/bn_mont.c14
1 files changed, 13 insertions, 1 deletions
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{