diff options
| author | tb <> | 2023-02-19 15:45:14 +0000 |
|---|---|---|
| committer | tb <> | 2023-02-19 15:45:14 +0000 |
| commit | f2efef7d98518da71bf3a4a7b4ada6cbe6c77f5b (patch) | |
| tree | 7b3a27c892bc24e9352e86e35ea98d13e1bd35ae /src | |
| parent | 0b9113bf9e31f4dff7749b7c96c558ac5cf0332e (diff) | |
| download | openbsd-f2efef7d98518da71bf3a4a7b4ada6cbe6c77f5b.tar.gz openbsd-f2efef7d98518da71bf3a4a7b4ada6cbe6c77f5b.tar.bz2 openbsd-f2efef7d98518da71bf3a4a7b4ada6cbe6c77f5b.zip | |
Move BN_MONT_CTX back to bn_local.h for now. It's still used by bn_exp.c
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/libcrypto/bn/bn_local.h | 14 | ||||
| -rw-r--r-- | src/lib/libcrypto/bn/bn_mont.c | 14 |
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 336ad4ed20..d2c7a3983e 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.12 2023/02/19 13:27:49 jsing Exp $ */ | 1 | /* $OpenBSD: bn_local.h,v 1.13 2023/02/19 15:45:14 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 | * |
| @@ -127,6 +127,18 @@ struct bignum_st { | |||
| 127 | int flags; | 127 | int flags; |
| 128 | }; | 128 | }; |
| 129 | 129 | ||
| 130 | /* Used for montgomery multiplication */ | ||
| 131 | struct 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 | |||
| 130 | /* Used for reciprocal division/mod functions | 142 | /* Used for reciprocal division/mod functions |
| 131 | * It cannot be shared between threads | 143 | * It cannot be shared between threads |
| 132 | */ | 144 | */ |
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 @@ | |||
| 1 | /* $OpenBSD: bn_mont.c,v 1.41 2023/02/19 13:51:00 jsing Exp $ */ | 1 | /* $OpenBSD: bn_mont.c,v 1.42 2023/02/19 15:45:14 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 | * |
| @@ -124,18 +124,6 @@ | |||
| 124 | 124 | ||
| 125 | #define MONT_WORD /* use the faster word-based algorithm */ | 125 | #define MONT_WORD /* use the faster word-based algorithm */ |
| 126 | 126 | ||
| 127 | /* Used for montgomery multiplication */ | ||
| 128 | struct bn_mont_ctx_st { | ||
| 129 | int ri; /* number of bits in R */ | ||
| 130 | BIGNUM RR; /* used to convert to montgomery form */ | ||
| 131 | BIGNUM N; /* The modulus */ | ||
| 132 | BIGNUM Ni; /* R*(1/R mod N) - N*Ni = 1 | ||
| 133 | * (Ni is only stored for bignum algorithm) */ | ||
| 134 | BN_ULONG n0[2];/* least significant word(s) of Ni; | ||
| 135 | (type changed with 0.9.9, was "BN_ULONG n0;" before) */ | ||
| 136 | int flags; | ||
| 137 | }; | ||
| 138 | |||
| 139 | BN_MONT_CTX * | 127 | BN_MONT_CTX * |
| 140 | BN_MONT_CTX_new(void) | 128 | BN_MONT_CTX_new(void) |
| 141 | { | 129 | { |
