diff options
author | jsing <> | 2023-06-24 16:01:44 +0000 |
---|---|---|
committer | jsing <> | 2023-06-24 16:01:44 +0000 |
commit | 7d512d54bfa4ced3119d0fe31adc99aa92bbc6ea (patch) | |
tree | d032bf8af96bb9caac79fdb34b7d962c021ef65a /src/lib/libcrypto/bn/bn_local.h | |
parent | 9e7af2e933573c645b1fd326082f5705781bac2b (diff) | |
download | openbsd-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.h | 3 |
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); | |||
252 | void bn_mul_comba4(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b); | 252 | void bn_mul_comba4(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b); |
253 | void bn_mul_comba8(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b); | 253 | void bn_mul_comba8(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b); |
254 | 254 | ||
255 | 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); | 255 | void bn_sqr_comba4(BN_ULONG *r, const BN_ULONG *a); |
257 | void bn_sqr_comba8(BN_ULONG *r, const BN_ULONG *a); | 256 | void bn_sqr_comba8(BN_ULONG *r, const BN_ULONG *a); |
258 | 257 | ||