summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/bn/bn_local.h
diff options
context:
space:
mode:
authorjsing <>2023-06-24 16:01:44 +0000
committerjsing <>2023-06-24 16:01:44 +0000
commit7d512d54bfa4ced3119d0fe31adc99aa92bbc6ea (patch)
treed032bf8af96bb9caac79fdb34b7d962c021ef65a /src/lib/libcrypto/bn/bn_local.h
parent9e7af2e933573c645b1fd326082f5705781bac2b (diff)
downloadopenbsd-7d512d54bfa4ced3119d0fe31adc99aa92bbc6ea.tar.gz
openbsd-7d512d54bfa4ced3119d0fe31adc99aa92bbc6ea.tar.bz2
openbsd-7d512d54bfa4ced3119d0fe31adc99aa92bbc6ea.zip
Rewrite and simplify bn_sqr()/bn_sqr_normal().
Rework bn_sqr()/bn_sqr_normal() so that it is less convoluted and more readable. Instead of recomputing values that the caller has already computed, pass it as an argument. Avoid branching and remove duplication of variables. Consistently use a_len and r_len naming for lengths. ok tb@
Diffstat (limited to 'src/lib/libcrypto/bn/bn_local.h')
-rw-r--r--src/lib/libcrypto/bn/bn_local.h3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/lib/libcrypto/bn/bn_local.h b/src/lib/libcrypto/bn/bn_local.h
index c86e4d032b..17f5447bec 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.23 2023/06/21 07:41:55 jsing Exp $ */ 1/* $OpenBSD: bn_local.h,v 1.24 2023/06/24 16:01:43 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 *
@@ -252,7 +252,6 @@ void bn_mul_normal(BN_ULONG *r, BN_ULONG *a, int na, BN_ULONG *b, int nb);
252void bn_mul_comba4(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b); 252void bn_mul_comba4(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b);
253void bn_mul_comba8(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b); 253void bn_mul_comba8(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b);
254 254
255void bn_sqr_normal(BN_ULONG *r, const BN_ULONG *a, int n, BN_ULONG *tmp);
256void bn_sqr_comba4(BN_ULONG *r, const BN_ULONG *a); 255void bn_sqr_comba4(BN_ULONG *r, const BN_ULONG *a);
257void bn_sqr_comba8(BN_ULONG *r, const BN_ULONG *a); 256void bn_sqr_comba8(BN_ULONG *r, const BN_ULONG *a);
258 257