From 3aecf6f31ef0dadc8dc1e4dabc9d291abe553aaa Mon Sep 17 00:00:00 2001 From: Daniele Lacamera Date: Fri, 10 Jul 2026 07:20:10 +0200 Subject: [PATCH] fe_operations: declare asm curve25519_base to fix strict-C build curve25519.c calls curve25519_base() on the CURVED25519_X64 / aarch64 ARMASM path, but the function is only defined in assembly and had no C prototype in any header, so a strict C compiler (implicit-declaration as error) failed to build that configuration. Declare it alongside the sibling curve25519() prototype under the same guard. --- wolfssl/wolfcrypt/fe_operations.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/wolfssl/wolfcrypt/fe_operations.h b/wolfssl/wolfcrypt/fe_operations.h index 65d0e1c904..97e1f1610d 100644 --- a/wolfssl/wolfcrypt/fe_operations.h +++ b/wolfssl/wolfcrypt/fe_operations.h @@ -112,6 +112,13 @@ WOLFSSL_LOCAL int curve25519_nb(byte * q, const byte * n, const byte * p, WOLFSSL_LOCAL void fe_init(void); WOLFSSL_LOCAL int curve25519(byte * q, const byte * n, const byte * p); +#if defined(CURVED25519_X64) || (defined(WOLFSSL_ARMASM) && defined(__aarch64__)) +/* Fixed-base scalar multiply provided by the x64/aarch64 assembly + * (fe_x25519_asm.S, armv8-curve25519); declared here as no other header + * prototypes it, which otherwise breaks a strict C (implicit-declaration) + * build of curve25519.c. */ +WOLFSSL_LOCAL int curve25519_base(byte * q, const byte * n); +#endif #ifdef WOLFSSL_CURVE25519_BLINDING WOLFSSL_LOCAL int curve25519_blind(byte* q, const byte* n, const byte* mask, const byte* p, const byte* rz);