From b7ade58c52dcd2affd08cd30ca8f8daf40d4b3c8 Mon Sep 17 00:00:00 2001 From: Sean Parkinson Date: Mon, 10 Nov 2025 19:58:16 +1000 Subject: [PATCH] SP label noinline: function inlined even when asked not to The label L_521_mont_reduce_9_nomask is therefore appearing more than once in the compiled code. Adding '%=' to the end of the label ensure it has a unique number appended to it even when inlined. --- wolfcrypt/src/sp_arm32.c | 3 --- wolfcrypt/src/sp_arm64.c | 4 ++-- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/wolfcrypt/src/sp_arm32.c b/wolfcrypt/src/sp_arm32.c index 8d3229b55..73221adb2 100644 --- a/wolfcrypt/src/sp_arm32.c +++ b/wolfcrypt/src/sp_arm32.c @@ -79921,7 +79921,6 @@ WC_OMIT_FRAME_POINTER static int sp_256_num_bits_8(const sp_digit* a) #else register byte* L_sp_256_num_bits_8_table_c = (byte*)&L_sp_256_num_bits_8_table; - #endif /* !WOLFSSL_NO_VAR_ASSIGN_REG */ __asm__ __volatile__ ( @@ -97962,7 +97961,6 @@ WC_OMIT_FRAME_POINTER static int sp_384_num_bits_12(const sp_digit* a) #else register byte* L_sp_384_num_bits_12_table_c = (byte*)&L_sp_384_num_bits_12_table; - #endif /* !WOLFSSL_NO_VAR_ASSIGN_REG */ __asm__ __volatile__ ( @@ -126513,7 +126511,6 @@ WC_OMIT_FRAME_POINTER static int sp_521_num_bits_17(const sp_digit* a) #else register byte* L_sp_521_num_bits_17_table_c = (byte*)&L_sp_521_num_bits_17_table; - #endif /* !WOLFSSL_NO_VAR_ASSIGN_REG */ __asm__ __volatile__ ( diff --git a/wolfcrypt/src/sp_arm64.c b/wolfcrypt/src/sp_arm64.c index 617b78bb6..71a31716d 100644 --- a/wolfcrypt/src/sp_arm64.c +++ b/wolfcrypt/src/sp_arm64.c @@ -71095,9 +71095,9 @@ SP_NOINLINE static void sp_521_mont_reduce_9(sp_digit* a, const sp_digit* m, "# mu = a[i] * mp\n\t" "mul x9, %[mp], x13\n\t" "cmp x4, #1\n\t" - "b.ne L_521_mont_reduce_9_nomask\n\t" + "b.ne L_521_mont_reduce_9_nomask_%=\n\t" "and x9, x9, #0x1ff\n\t" - "L_521_mont_reduce_9_nomask:\n\t" + "L_521_mont_reduce_9_nomask_%=:\n\t" "# a[i+0] += m[0] * mu\n\t" "ldp x10, x11, [%[m], 0]\n\t" "mul x7, x10, x9\n\t"