diff options
author | jsing <> | 2023-04-19 10:51:22 +0000 |
---|---|---|
committer | jsing <> | 2023-04-19 10:51:22 +0000 |
commit | 0954bbaddbf74f6f184f313822c63bf1b56695bd (patch) | |
tree | b572e3eea1eb6a5996c544ab694d76a6c2c83085 /src/lib/libcrypto/bn/bn_local.h | |
parent | 0aeb12748acb6b4c8e28de80f588e344c1dab0fe (diff) | |
download | openbsd-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_local.h')
-rw-r--r-- | src/lib/libcrypto/bn/bn_local.h | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/src/lib/libcrypto/bn/bn_local.h b/src/lib/libcrypto/bn/bn_local.h index 4912ae96f3..5e85dfc3de 100644 --- a/src/lib/libcrypto/bn/bn_local.h +++ b/src/lib/libcrypto/bn/bn_local.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: bn_local.h,v 1.18 2023/03/27 08:37:33 tb Exp $ */ | 1 | /* $OpenBSD: bn_local.h,v 1.19 2023/04/19 10:51:22 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 | * |
@@ -256,14 +256,6 @@ void bn_sqr_normal(BN_ULONG *r, const BN_ULONG *a, int n, BN_ULONG *tmp); | |||
256 | void bn_sqr_comba4(BN_ULONG *r, const BN_ULONG *a); | 256 | void bn_sqr_comba4(BN_ULONG *r, const BN_ULONG *a); |
257 | void bn_sqr_comba8(BN_ULONG *r, const BN_ULONG *a); | 257 | void bn_sqr_comba8(BN_ULONG *r, const BN_ULONG *a); |
258 | 258 | ||
259 | int bn_cmp_words(const BN_ULONG *a, const BN_ULONG *b, int n); | ||
260 | int bn_cmp_part_words(const BN_ULONG *a, const BN_ULONG *b, | ||
261 | int cl, int dl); | ||
262 | void bn_mul_recursive(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b, int n2, | ||
263 | int dna, int dnb, BN_ULONG *t); | ||
264 | void bn_mul_part_recursive(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b, | ||
265 | int n, int tna, int tnb, BN_ULONG *t); | ||
266 | void bn_sqr_recursive(BN_ULONG *r, const BN_ULONG *a, int n2, BN_ULONG *t); | ||
267 | int bn_mul_mont(BN_ULONG *rp, const BN_ULONG *ap, const BN_ULONG *bp, | 259 | int bn_mul_mont(BN_ULONG *rp, const BN_ULONG *ap, const BN_ULONG *bp, |
268 | const BN_ULONG *np, const BN_ULONG *n0, int num); | 260 | const BN_ULONG *np, const BN_ULONG *n0, int num); |
269 | 261 | ||