diff options
author | jsing <> | 2023-02-01 06:23:13 +0000 |
---|---|---|
committer | jsing <> | 2023-02-01 06:23:13 +0000 |
commit | bb11cbb827cae01ad8929c5c40a3dd254cac08f6 (patch) | |
tree | 9415275c01c24b6ca64bb2bfab06c59feebbb3fd /src | |
parent | 3b7e8a39d43d629102d8215e0831c31b5a6d3a75 (diff) | |
download | openbsd-bb11cbb827cae01ad8929c5c40a3dd254cac08f6.tar.gz openbsd-bb11cbb827cae01ad8929c5c40a3dd254cac08f6.tar.bz2 openbsd-bb11cbb827cae01ad8929c5c40a3dd254cac08f6.zip |
Pull the MONT_WORD define to the top.
Reordering functions with defines hiding in the middle leads to fun
outcomes... and apparently the non-MONT_WORD code is broken, at least on
aarch64.
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/libcrypto/bn/bn_mont.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/lib/libcrypto/bn/bn_mont.c b/src/lib/libcrypto/bn/bn_mont.c index 4ddf7285c7..6e3d3fa0c8 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.35 2023/02/01 04:48:08 jsing Exp $ */ | 1 | /* $OpenBSD: bn_mont.c,v 1.36 2023/02/01 06:23:13 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 | * |
@@ -121,6 +121,8 @@ | |||
121 | 121 | ||
122 | #include "bn_local.h" | 122 | #include "bn_local.h" |
123 | 123 | ||
124 | #define MONT_WORD /* use the faster word-based algorithm */ | ||
125 | |||
124 | BN_MONT_CTX * | 126 | BN_MONT_CTX * |
125 | BN_MONT_CTX_new(void) | 127 | BN_MONT_CTX_new(void) |
126 | { | 128 | { |
@@ -394,8 +396,6 @@ bn_mul_mont(BN_ULONG *rp, const BN_ULONG *ap, const BN_ULONG *bp, | |||
394 | #endif /* !OPENSSL_BN_ASM_MONT */ | 396 | #endif /* !OPENSSL_BN_ASM_MONT */ |
395 | #endif /* OPENSSL_NO_ASM */ | 397 | #endif /* OPENSSL_NO_ASM */ |
396 | 398 | ||
397 | #define MONT_WORD /* use the faster word-based algorithm */ | ||
398 | |||
399 | #ifdef MONT_WORD | 399 | #ifdef MONT_WORD |
400 | static int BN_from_montgomery_word(BIGNUM *ret, BIGNUM *r, BN_MONT_CTX *mont); | 400 | static int BN_from_montgomery_word(BIGNUM *ret, BIGNUM *r, BN_MONT_CTX *mont); |
401 | #endif | 401 | #endif |