From 8b5dce85fbfacb84014c49a717e78c08c906b81a Mon Sep 17 00:00:00 2001 From: jsing Date: Fri, 20 Jan 2023 10:07:52 +0000 Subject: [PATCH] Replace BN_DIV3W with HAVE_BN_DIV_3_WORDS (in bn_arch.h). ok tb@ --- lib/libcrypto/arch/mips64/Makefile.inc | 3 +-- lib/libcrypto/bn/arch/mips64/bn_arch.h | 4 +++- lib/libcrypto/bn/bn_div.c | 7 ++++--- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/lib/libcrypto/arch/mips64/Makefile.inc b/lib/libcrypto/arch/mips64/Makefile.inc index 3bdcfe03408..2d547f4a5c7 100644 --- a/lib/libcrypto/arch/mips64/Makefile.inc +++ b/lib/libcrypto/arch/mips64/Makefile.inc @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile.inc,v 1.6 2021/05/01 16:11:09 visa Exp $ +# $OpenBSD: Makefile.inc,v 1.7 2023/01/20 10:07:52 jsing Exp $ # mips64-specific libcrypto build rules @@ -10,7 +10,6 @@ SSLASM+= aes aes-mips aes-mips SRCS+= bf_enc.c # bn SSLASM+= bn mips bn-mips -CFLAGS+= -DBN_DIV3W SSLASM+= bn mips-mont mips-mont CFLAGS+= -DOPENSSL_BN_ASM_MONT # camellia diff --git a/lib/libcrypto/bn/arch/mips64/bn_arch.h b/lib/libcrypto/bn/arch/mips64/bn_arch.h index 4d6571f9cb4..6c6212c4a6f 100644 --- a/lib/libcrypto/bn/arch/mips64/bn_arch.h +++ b/lib/libcrypto/bn/arch/mips64/bn_arch.h @@ -1,4 +1,4 @@ -/* $OpenBSD: bn_arch.h,v 1.1 2023/01/20 10:04:34 jsing Exp $ */ +/* $OpenBSD: bn_arch.h,v 1.2 2023/01/20 10:07:52 jsing Exp $ */ /* * Copyright (c) 2023 Joel Sing * @@ -20,5 +20,7 @@ #ifndef OPENSSL_NO_ASM +#define HAVE_BN_DIV_3_WORDS + #endif #endif diff --git a/lib/libcrypto/bn/bn_div.c b/lib/libcrypto/bn/bn_div.c index 47e491ec461..df4b7517d71 100644 --- a/lib/libcrypto/bn/bn_div.c +++ b/lib/libcrypto/bn/bn_div.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bn_div.c,v 1.31 2023/01/18 05:29:48 jsing Exp $ */ +/* $OpenBSD: bn_div.c,v 1.32 2023/01/20 10:07:52 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -63,11 +63,12 @@ #include #include +#include "bn_arch.h" #include "bn_local.h" BN_ULONG bn_div_3_words(const BN_ULONG *m, BN_ULONG d1, BN_ULONG d0); -#ifndef BN_DIV3W +#ifndef HAVE_BN_DIV_3_WORDS #if !defined(OPENSSL_NO_ASM) && !defined(OPENSSL_NO_INLINE_ASM) # if defined(__GNUC__) && __GNUC__>=2 @@ -199,7 +200,7 @@ bn_div_3_words(const BN_ULONG *m, BN_ULONG d1, BN_ULONG d0) return q; } -#endif /* !BN_DIV3W */ +#endif /* !HAVE_BN_DIV_3_WORDS */ /* * BN_div_internal computes quotient := numerator / divisor, rounding towards -- 2.20.1