Remove bn_sqr_words() on amd64.
authorjsing <jsing@openbsd.org>
Sat, 4 Feb 2023 14:00:18 +0000 (14:00 +0000)
committerjsing <jsing@openbsd.org>
Sat, 4 Feb 2023 14:00:18 +0000 (14:00 +0000)
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
lib/libcrypto/bn/arch/amd64/bn_arch.h

index dc3000f..be2badc 100644 (file)
@@ -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 <jsing@openbsd.org>
  *
@@ -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
index c41a844..6379030 100644 (file)
@@ -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 <jsing@openbsd.org>
  *
@@ -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