From: jsing Date: Wed, 1 Feb 2023 06:23:13 +0000 (+0000) Subject: Pull the MONT_WORD define to the top. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=3bc7216240bf3fd013a9b146cf0d2b188b9c0063;p=openbsd 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. --- diff --git a/lib/libcrypto/bn/bn_mont.c b/lib/libcrypto/bn/bn_mont.c index 4ddf7285c79..6e3d3fa0c89 100644 --- a/lib/libcrypto/bn/bn_mont.c +++ b/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