From bb11cbb827cae01ad8929c5c40a3dd254cac08f6 Mon Sep 17 00:00:00 2001 From: jsing <> Date: Wed, 1 Feb 2023 06:23:13 +0000 Subject: 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. --- src/lib/libcrypto/bn/bn_mont.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') 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 @@ -/* $OpenBSD: bn_mont.c,v 1.35 2023/02/01 04:48:08 jsing Exp $ */ +/* $OpenBSD: bn_mont.c,v 1.36 2023/02/01 06:23:13 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -121,6 +121,8 @@ #include "bn_local.h" +#define MONT_WORD /* use the faster word-based algorithm */ + BN_MONT_CTX * BN_MONT_CTX_new(void) { @@ -394,8 +396,6 @@ bn_mul_mont(BN_ULONG *rp, const BN_ULONG *ap, const BN_ULONG *bp, #endif /* !OPENSSL_BN_ASM_MONT */ #endif /* OPENSSL_NO_ASM */ -#define MONT_WORD /* use the faster word-based algorithm */ - #ifdef MONT_WORD static int BN_from_montgomery_word(BIGNUM *ret, BIGNUM *r, BN_MONT_CTX *mont); #endif -- cgit v1.2.3-55-g6feb