From 1d0c918a38c78ec3773c9dc7cc40f2f3a245c81e Mon Sep 17 00:00:00 2001 From: jsing Date: Sat, 4 Feb 2023 14:00:18 +0000 Subject: [PATCH] Remove bn_sqr_words() on amd64. s2n-bignum's bignum_sqr() is not the same as bn_sqr_words() (which only computes a partial result, unlike the former). This went unnoticed since bn_sqr() is called directly on amd64, hence bn_sqr_words() is currently unused. --- lib/libcrypto/bn/arch/amd64/bn_arch.c | 10 +--------- lib/libcrypto/bn/arch/amd64/bn_arch.h | 3 +-- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/lib/libcrypto/bn/arch/amd64/bn_arch.c b/lib/libcrypto/bn/arch/amd64/bn_arch.c index dc3000fe8bd..be2badc8a8a 100644 --- a/lib/libcrypto/bn/arch/amd64/bn_arch.c +++ b/lib/libcrypto/bn/arch/amd64/bn_arch.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bn_arch.c,v 1.3 2023/02/02 18:39:26 jsing Exp $ */ +/* $OpenBSD: bn_arch.c,v 1.4 2023/02/04 14:00:18 jsing Exp $ */ /* * Copyright (c) 2023 Joel Sing * @@ -118,11 +118,3 @@ bn_sqr_comba8(BN_ULONG *rd, const BN_ULONG *ad) bignum_sqr_8_16_alt((uint64_t *)rd, (uint64_t *)ad); } #endif - -#ifdef HAVE_BN_SQR_WORDS -void -bn_sqr_words(BN_ULONG *rd, const BN_ULONG *ad, int num) -{ - bignum_sqr(num, (uint64_t *)rd, num, (uint64_t *)ad); -} -#endif diff --git a/lib/libcrypto/bn/arch/amd64/bn_arch.h b/lib/libcrypto/bn/arch/amd64/bn_arch.h index c41a84409b6..637903077a0 100644 --- a/lib/libcrypto/bn/arch/amd64/bn_arch.h +++ b/lib/libcrypto/bn/arch/amd64/bn_arch.h @@ -1,4 +1,4 @@ -/* $OpenBSD: bn_arch.h,v 1.10 2023/02/02 18:39:26 jsing Exp $ */ +/* $OpenBSD: bn_arch.h,v 1.11 2023/02/04 14:00:18 jsing Exp $ */ /* * Copyright (c) 2023 Joel Sing * @@ -35,7 +35,6 @@ #define HAVE_BN_SQR #define HAVE_BN_SQR_COMBA4 #define HAVE_BN_SQR_COMBA8 -#define HAVE_BN_SQR_WORDS #define HAVE_BN_SUB #define HAVE_BN_SUB_WORDS -- 2.20.1