From edd4db8b24106490f82c1a694d4e2b35afe9c6cb Mon Sep 17 00:00:00 2001 From: jsing <> Date: Mon, 1 Sep 2025 15:33:23 +0000 Subject: Constify bn_mul_words(). --- src/lib/libcrypto/bn/arch/amd64/bn_arch.c | 5 +++-- src/lib/libcrypto/bn/bn_local.h | 5 +++-- src/lib/libcrypto/bn/bn_mul.c | 5 +++-- 3 files changed, 9 insertions(+), 6 deletions(-) (limited to 'src/lib') diff --git a/src/lib/libcrypto/bn/arch/amd64/bn_arch.c b/src/lib/libcrypto/bn/arch/amd64/bn_arch.c index 0fe6070efa..6c3888687b 100644 --- a/src/lib/libcrypto/bn/arch/amd64/bn_arch.c +++ b/src/lib/libcrypto/bn/arch/amd64/bn_arch.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bn_arch.c,v 1.16 2025/09/01 15:15:44 jsing Exp $ */ +/* $OpenBSD: bn_arch.c,v 1.17 2025/09/01 15:33:23 jsing Exp $ */ /* * Copyright (c) 2023 Joel Sing * @@ -128,7 +128,8 @@ bn_mul_comba8(BN_ULONG *rd, const BN_ULONG *ad, const BN_ULONG *bd) #ifdef HAVE_BN_MUL_WORDS void -bn_mul_words(BN_ULONG *r, BN_ULONG *a, int a_len, BN_ULONG *b, int b_len) +bn_mul_words(BN_ULONG *r, const BN_ULONG *a, int a_len, const BN_ULONG *b, + int b_len) { bignum_mul(a_len + b_len, (uint64_t *)r, a_len, (const uint64_t *)a, b_len, (const uint64_t *)b); diff --git a/src/lib/libcrypto/bn/bn_local.h b/src/lib/libcrypto/bn/bn_local.h index 0356c4c00f..0df4b7f32e 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.57 2025/08/31 09:33:30 jsing Exp $ */ +/* $OpenBSD: bn_local.h,v 1.58 2025/09/01 15:33:23 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -242,7 +242,8 @@ BN_ULONG bn_sub(BN_ULONG *r, int r_len, const BN_ULONG *a, int a_len, void bn_mul_comba4(BN_ULONG *r, const BN_ULONG *a, const BN_ULONG *b); void bn_mul_comba6(BN_ULONG *r, const BN_ULONG *a, const BN_ULONG *b); void bn_mul_comba8(BN_ULONG *r, const BN_ULONG *a, const BN_ULONG *b); -void bn_mul_words(BN_ULONG *r, BN_ULONG *a, int a_len, BN_ULONG *b, int b_len); +void bn_mul_words(BN_ULONG *r, const BN_ULONG *a, int a_len, const BN_ULONG *b, + int b_len); void bn_sqr_comba4(BN_ULONG *r, const BN_ULONG *a); void bn_sqr_comba6(BN_ULONG *r, const BN_ULONG *a); diff --git a/src/lib/libcrypto/bn/bn_mul.c b/src/lib/libcrypto/bn/bn_mul.c index 6ba05f2eba..383ba795dd 100644 --- a/src/lib/libcrypto/bn/bn_mul.c +++ b/src/lib/libcrypto/bn/bn_mul.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bn_mul.c,v 1.44 2025/08/30 07:54:27 jsing Exp $ */ +/* $OpenBSD: bn_mul.c,v 1.45 2025/09/01 15:33:23 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -323,7 +323,8 @@ bn_mulw_add_words(BN_ULONG *r, const BN_ULONG *a, int num, BN_ULONG w) #ifndef HAVE_BN_MUL_WORDS void -bn_mul_words(BN_ULONG *r, BN_ULONG *a, int a_len, BN_ULONG *b, int b_len) +bn_mul_words(BN_ULONG *r, const BN_ULONG *a, int a_len, const BN_ULONG *b, + int b_len) { BN_ULONG *rr; -- cgit v1.2.3-55-g6feb