summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/bn/bn.h
diff options
context:
space:
mode:
authorjsing <>2023-04-19 10:51:22 +0000
committerjsing <>2023-04-19 10:51:22 +0000
commit0954bbaddbf74f6f184f313822c63bf1b56695bd (patch)
treeb572e3eea1eb6a5996c544ab694d76a6c2c83085 /src/lib/libcrypto/bn/bn.h
parent0aeb12748acb6b4c8e28de80f588e344c1dab0fe (diff)
downloadopenbsd-0954bbaddbf74f6f184f313822c63bf1b56695bd.tar.gz
openbsd-0954bbaddbf74f6f184f313822c63bf1b56695bd.tar.bz2
openbsd-0954bbaddbf74f6f184f313822c63bf1b56695bd.zip
unifdef BN_RECURSION
This removes a bunch of incomplete and scary code, which potentially leaks secrets and is not constant time. A performance gain is achieved on arm64 for sizes that we care about, while a minimal decrease in performance is noted for larger sizes on some other platforms. While we will potentially reimplement Karatsuba (or Toom-Cook) at a later date, it will be easier and safer to do it from a clean slate. ok tb@
Diffstat (limited to 'src/lib/libcrypto/bn/bn.h')
-rw-r--r--src/lib/libcrypto/bn/bn.h8
1 files changed, 1 insertions, 7 deletions
diff --git a/src/lib/libcrypto/bn/bn.h b/src/lib/libcrypto/bn/bn.h
index bb85ea442c..53b109bd8a 100644
--- a/src/lib/libcrypto/bn/bn.h
+++ b/src/lib/libcrypto/bn/bn.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: bn.h,v 1.61 2023/04/16 09:13:46 tb Exp $ */ 1/* $OpenBSD: bn.h,v 1.62 2023/04/19 10:51:22 jsing Exp $ */
2/* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -138,12 +138,6 @@
138extern "C" { 138extern "C" {
139#endif 139#endif
140 140
141#ifndef OPENSSL_SMALL_FOOTPRINT
142#define BN_MUL_COMBA
143#define BN_SQR_COMBA
144#define BN_RECURSION
145#endif
146
147/* This next option uses the C libraries (2 word)/(1 word) function. 141/* This next option uses the C libraries (2 word)/(1 word) function.
148 * If it is not defined, I use my C version (which is slower). 142 * If it is not defined, I use my C version (which is slower).
149 * The reason for this flag is that when the particular C compiler 143 * The reason for this flag is that when the particular C compiler