From 9283c4361ce1f1a39a1f03c588c3d1a3da64025e Mon Sep 17 00:00:00 2001 From: jsing <> Date: Sun, 7 Sep 2025 05:21:29 +0000 Subject: Re-enable bn_sqr_words() assembly. This is now only on amd64. --- src/lib/libcrypto/bn/bn_local.h | 4 ++-- src/lib/libcrypto/bn/bn_mod_words.c | 4 ++-- src/lib/libcrypto/bn/bn_sqr.c | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/lib/libcrypto/bn/bn_local.h b/src/lib/libcrypto/bn/bn_local.h index 853757d289..a7d61f1b03 100644 --- a/src/lib/libcrypto/bn/bn_local.h +++ b/src/lib/libcrypto/bn/bn_local.h @@ -1,4 +1,4 @@ -/* $OpenBSD: bn_local.h,v 1.59 2025/09/02 14:18:38 jsing Exp $ */ +/* $OpenBSD: bn_local.h,v 1.60 2025/09/07 05:21:29 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -248,7 +248,7 @@ void bn_mul_words(BN_ULONG *r, const BN_ULONG *a, int a_len, const BN_ULONG *b, void bn_sqr_comba4(BN_ULONG *r, const BN_ULONG *a); void bn_sqr_comba6(BN_ULONG *r, const BN_ULONG *a); void bn_sqr_comba8(BN_ULONG *r, const BN_ULONG *a); -void bn_sqr_words_nonasm(BN_ULONG *r, const BN_ULONG *a, int a_len); +void bn_sqr_words(BN_ULONG *r, const BN_ULONG *a, int a_len); int bn_mul_mont(BN_ULONG *rp, const BN_ULONG *ap, const BN_ULONG *bp, const BN_ULONG *np, const BN_ULONG *n0, int num); diff --git a/src/lib/libcrypto/bn/bn_mod_words.c b/src/lib/libcrypto/bn/bn_mod_words.c index 1a2fe70b4e..f368e074db 100644 --- a/src/lib/libcrypto/bn/bn_mod_words.c +++ b/src/lib/libcrypto/bn/bn_mod_words.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bn_mod_words.c,v 1.6 2025/09/02 14:18:38 jsing Exp $ */ +/* $OpenBSD: bn_mod_words.c,v 1.7 2025/09/07 05:21:29 jsing Exp $ */ /* * Copyright (c) 2024 Joel Sing * @@ -103,7 +103,7 @@ bn_mod_sqr_words(BN_ULONG *r, const BN_ULONG *a, const BN_ULONG *m, } else if (n == 8) { bn_sqr_comba8(t, a); } else { - bn_sqr_words_nonasm(t, a, n); + bn_sqr_words(t, a, n); } bn_montgomery_reduce_words(r, t, m, m0, n); } diff --git a/src/lib/libcrypto/bn/bn_sqr.c b/src/lib/libcrypto/bn/bn_sqr.c index ec9d5130a4..27e08bdf13 100644 --- a/src/lib/libcrypto/bn/bn_sqr.c +++ b/src/lib/libcrypto/bn/bn_sqr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bn_sqr.c,v 1.41 2025/09/02 14:18:38 jsing Exp $ */ +/* $OpenBSD: bn_sqr.c,v 1.42 2025/09/07 05:21:29 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -203,7 +203,7 @@ bn_sqr_comba8(BN_ULONG *r, const BN_ULONG *a) } #endif -#ifndef HAVE_BN_SQR_WORDS_NONASM +#ifndef HAVE_BN_SQR_WORDS /* * bn_sqr_add_words() computes (r[i*2+1]:r[i*2]) = (r[i*2+1]:r[i*2]) + a[i] * a[i]. */ @@ -244,7 +244,7 @@ bn_sqr_add_words(BN_ULONG *r, const BN_ULONG *a, int n) * bn_sqr_words() computes r[] = a[] * a[]. */ void -bn_sqr_words_nonasm(BN_ULONG *r, const BN_ULONG *a, int a_len) +bn_sqr_words(BN_ULONG *r, const BN_ULONG *a, int a_len) { const BN_ULONG *ap; BN_ULONG *rp; @@ -298,7 +298,7 @@ bn_sqr_words_nonasm(BN_ULONG *r, const BN_ULONG *a, int a_len) static int bn_sqr(BIGNUM *r, const BIGNUM *a, BN_CTX *ctx) { - bn_sqr_words_nonasm(r->d, a->d, a->top); + bn_sqr_words(r->d, a->d, a->top); return 1; } -- cgit v1.2.3-55-g6feb