From f2efef7d98518da71bf3a4a7b4ada6cbe6c77f5b Mon Sep 17 00:00:00 2001 From: tb <> Date: Sun, 19 Feb 2023 15:45:14 +0000 Subject: Move BN_MONT_CTX back to bn_local.h for now. It's still used by bn_exp.c --- src/lib/libcrypto/bn/bn_local.h | 14 +++++++++++++- src/lib/libcrypto/bn/bn_mont.c | 14 +------------- 2 files changed, 14 insertions(+), 14 deletions(-) (limited to 'src/lib') diff --git a/src/lib/libcrypto/bn/bn_local.h b/src/lib/libcrypto/bn/bn_local.h index 336ad4ed20..d2c7a3983e 100644 --- a/src/lib/libcrypto/bn/bn_local.h +++ b/src/lib/libcrypto/bn/bn_local.h @@ -1,4 +1,4 @@ -/* $OpenBSD: bn_local.h,v 1.12 2023/02/19 13:27:49 jsing Exp $ */ +/* $OpenBSD: bn_local.h,v 1.13 2023/02/19 15:45:14 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -127,6 +127,18 @@ struct bignum_st { int flags; }; +/* Used for montgomery multiplication */ +struct bn_mont_ctx_st { + int ri; /* number of bits in R */ + BIGNUM RR; /* used to convert to montgomery form */ + BIGNUM N; /* The modulus */ + BIGNUM Ni; /* R*(1/R mod N) - N*Ni = 1 + * (Ni is only stored for bignum algorithm) */ + BN_ULONG n0[2];/* least significant word(s) of Ni; + (type changed with 0.9.9, was "BN_ULONG n0;" before) */ + int flags; +}; + /* Used for reciprocal division/mod functions * It cannot be shared between threads */ diff --git a/src/lib/libcrypto/bn/bn_mont.c b/src/lib/libcrypto/bn/bn_mont.c index cae8569b8d..89df675459 100644 --- a/src/lib/libcrypto/bn/bn_mont.c +++ b/src/lib/libcrypto/bn/bn_mont.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bn_mont.c,v 1.41 2023/02/19 13:51:00 jsing Exp $ */ +/* $OpenBSD: bn_mont.c,v 1.42 2023/02/19 15:45:14 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -124,18 +124,6 @@ #define MONT_WORD /* use the faster word-based algorithm */ -/* Used for montgomery multiplication */ -struct bn_mont_ctx_st { - int ri; /* number of bits in R */ - BIGNUM RR; /* used to convert to montgomery form */ - BIGNUM N; /* The modulus */ - BIGNUM Ni; /* R*(1/R mod N) - N*Ni = 1 - * (Ni is only stored for bignum algorithm) */ - BN_ULONG n0[2];/* least significant word(s) of Ni; - (type changed with 0.9.9, was "BN_ULONG n0;" before) */ - int flags; -}; - BN_MONT_CTX * BN_MONT_CTX_new(void) { -- cgit v1.2.3-55-g6feb