From 66beef8bfe83b33a0c5aaad6a85d57cca57cd62f Mon Sep 17 00:00:00 2001 From: tb <> Date: Sat, 23 Nov 2024 07:37:21 +0000 Subject: Drop bn is zero special case This is a corner case that isn't really of interest. We're making a few calculations that don't really hurt, but it's super cheap, so one more complication bites the dust. ok jsing --- src/lib/libcrypto/ec/ec_mult.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'src') diff --git a/src/lib/libcrypto/ec/ec_mult.c b/src/lib/libcrypto/ec/ec_mult.c index 382174a367..c33a033805 100644 --- a/src/lib/libcrypto/ec/ec_mult.c +++ b/src/lib/libcrypto/ec/ec_mult.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ec_mult.c,v 1.49 2024/11/23 07:33:26 tb Exp $ */ +/* $OpenBSD: ec_mult.c,v 1.50 2024/11/23 07:37:21 tb Exp $ */ /* * Originally written by Bodo Moeller and Nils Larsch for the OpenSSL project. */ @@ -111,9 +111,6 @@ ec_compute_wNAF(const BIGNUM *bn, signed char **out_wNAF, size_t *out_wNAF_len, wbits = ec_window_bits(bn); len = 1 << (wbits - 1); - if (BN_is_zero(bn)) - goto done; - sign = BN_is_negative(bn) ? -1 : 1; bit = 1 << wbits; @@ -150,7 +147,6 @@ ec_compute_wNAF(const BIGNUM *bn, signed char **out_wNAF, size_t *out_wNAF_len, window += bit * BN_is_bit_set(bn, i + wbits + 1); } - done: *out_wNAF = wNAF; wNAF = NULL; *out_wNAF_len = wNAF_len; -- cgit v1.2.3-55-g6feb