summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjsing <>2023-01-20 10:07:52 +0000
committerjsing <>2023-01-20 10:07:52 +0000
commitf51982659cdb6b0d0b26e0382390ef696868017f (patch)
tree2cc9ef09c2c6bdf815781f7a57aab455a209419b
parent61025822ea93f6f549e9f7d13b7360c49fd56ac1 (diff)
downloadopenbsd-f51982659cdb6b0d0b26e0382390ef696868017f.tar.gz
openbsd-f51982659cdb6b0d0b26e0382390ef696868017f.tar.bz2
openbsd-f51982659cdb6b0d0b26e0382390ef696868017f.zip
Replace BN_DIV3W with HAVE_BN_DIV_3_WORDS (in bn_arch.h).
ok tb@
-rw-r--r--src/lib/libcrypto/arch/mips64/Makefile.inc3
-rw-r--r--src/lib/libcrypto/bn/arch/mips64/bn_arch.h4
-rw-r--r--src/lib/libcrypto/bn/bn_div.c7
3 files changed, 8 insertions, 6 deletions
diff --git a/src/lib/libcrypto/arch/mips64/Makefile.inc b/src/lib/libcrypto/arch/mips64/Makefile.inc
index 3bdcfe0340..2d547f4a5c 100644
--- a/src/lib/libcrypto/arch/mips64/Makefile.inc
+++ b/src/lib/libcrypto/arch/mips64/Makefile.inc
@@ -1,4 +1,4 @@
1# $OpenBSD: Makefile.inc,v 1.6 2021/05/01 16:11:09 visa Exp $ 1# $OpenBSD: Makefile.inc,v 1.7 2023/01/20 10:07:52 jsing Exp $
2 2
3# mips64-specific libcrypto build rules 3# mips64-specific libcrypto build rules
4 4
@@ -10,7 +10,6 @@ SSLASM+= aes aes-mips aes-mips
10SRCS+= bf_enc.c 10SRCS+= bf_enc.c
11# bn 11# bn
12SSLASM+= bn mips bn-mips 12SSLASM+= bn mips bn-mips
13CFLAGS+= -DBN_DIV3W
14SSLASM+= bn mips-mont mips-mont 13SSLASM+= bn mips-mont mips-mont
15CFLAGS+= -DOPENSSL_BN_ASM_MONT 14CFLAGS+= -DOPENSSL_BN_ASM_MONT
16# camellia 15# camellia
diff --git a/src/lib/libcrypto/bn/arch/mips64/bn_arch.h b/src/lib/libcrypto/bn/arch/mips64/bn_arch.h
index 4d6571f9cb..6c6212c4a6 100644
--- a/src/lib/libcrypto/bn/arch/mips64/bn_arch.h
+++ b/src/lib/libcrypto/bn/arch/mips64/bn_arch.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: bn_arch.h,v 1.1 2023/01/20 10:04:34 jsing Exp $ */ 1/* $OpenBSD: bn_arch.h,v 1.2 2023/01/20 10:07:52 jsing Exp $ */
2/* 2/*
3 * Copyright (c) 2023 Joel Sing <jsing@openbsd.org> 3 * Copyright (c) 2023 Joel Sing <jsing@openbsd.org>
4 * 4 *
@@ -20,5 +20,7 @@
20 20
21#ifndef OPENSSL_NO_ASM 21#ifndef OPENSSL_NO_ASM
22 22
23#define HAVE_BN_DIV_3_WORDS
24
23#endif 25#endif
24#endif 26#endif
diff --git a/src/lib/libcrypto/bn/bn_div.c b/src/lib/libcrypto/bn/bn_div.c
index 47e491ec46..df4b7517d7 100644
--- a/src/lib/libcrypto/bn/bn_div.c
+++ b/src/lib/libcrypto/bn/bn_div.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bn_div.c,v 1.31 2023/01/18 05:29:48 jsing Exp $ */ 1/* $OpenBSD: bn_div.c,v 1.32 2023/01/20 10:07:52 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 *
@@ -63,11 +63,12 @@
63#include <openssl/bn.h> 63#include <openssl/bn.h>
64#include <openssl/err.h> 64#include <openssl/err.h>
65 65
66#include "bn_arch.h"
66#include "bn_local.h" 67#include "bn_local.h"
67 68
68BN_ULONG bn_div_3_words(const BN_ULONG *m, BN_ULONG d1, BN_ULONG d0); 69BN_ULONG bn_div_3_words(const BN_ULONG *m, BN_ULONG d1, BN_ULONG d0);
69 70
70#ifndef BN_DIV3W 71#ifndef HAVE_BN_DIV_3_WORDS
71 72
72#if !defined(OPENSSL_NO_ASM) && !defined(OPENSSL_NO_INLINE_ASM) 73#if !defined(OPENSSL_NO_ASM) && !defined(OPENSSL_NO_INLINE_ASM)
73# if defined(__GNUC__) && __GNUC__>=2 74# if defined(__GNUC__) && __GNUC__>=2
@@ -199,7 +200,7 @@ bn_div_3_words(const BN_ULONG *m, BN_ULONG d1, BN_ULONG d0)
199 200
200 return q; 201 return q;
201} 202}
202#endif /* !BN_DIV3W */ 203#endif /* !HAVE_BN_DIV_3_WORDS */
203 204
204/* 205/*
205 * BN_div_internal computes quotient := numerator / divisor, rounding towards 206 * BN_div_internal computes quotient := numerator / divisor, rounding towards