wolfcrypt/src/ge_operations.c and wolfssl/wolfcrypt/ge_operations.h: when ge_tobytes_nct and ge_tobytes have identical definitions, map the former to the latter using a macro and omit the latter definition, to avoid problematic R_ARM_THM_JUMP11 tail call.

This commit is contained in:
Daniel Pouzzner
2026-04-16 18:01:07 -05:00
parent 00b65a9e00
commit d218d3fbdd
2 changed files with 6 additions and 8 deletions
+3 -7
View File
@@ -10176,12 +10176,8 @@ void ge_tobytes(unsigned char *s,const ge_p2 *h)
s[31] ^= (unsigned char)((unsigned char)fe_isnegative(x) << 7);
}
#ifdef HAVE_ED25519_VERIFY
#ifndef CURVED25519_ASM_64BIT
#define fe_invert_nct fe_invert
#endif
/* ge tobytes */
#if defined(HAVE_ED25519_VERIFY) && defined(CURVED25519_ASM_64BIT)
/* ge tobytes_nct */
void ge_tobytes_nct(unsigned char *s,const ge_p2 *h)
{
ge recip;
@@ -10194,7 +10190,7 @@ void ge_tobytes_nct(unsigned char *s,const ge_p2 *h)
fe_tobytes(s,y);
s[31] ^= (unsigned char)((unsigned char)fe_isnegative(x) << 7);
}
#endif
#endif /* HAVE_ED25519_VERIFY && CURVED25519_ASM_64BIT */
#endif /* !ED25519_SMALL */
+3 -1
View File
@@ -85,11 +85,13 @@ WOLFSSL_LOCAL void sc_reduce(byte* s);
WOLFSSL_LOCAL void sc_muladd(byte* s, const byte* a, const byte* b,
const byte* c);
WOLFSSL_LOCAL void ge_tobytes(unsigned char *s,const ge_p2 *h);
#ifndef ED25519_SMALL
#ifdef HAVE_ED25519_VERIFY
#if !defined(ED25519_SMALL) && defined(CURVED25519_ASM_64BIT)
WOLFSSL_LOCAL void ge_tobytes_nct(unsigned char *s,const ge_p2 *h);
#else
#define ge_tobytes_nct ge_tobytes
#endif
#endif /* HAVE_ED25519_VERIFY */
#ifndef GE_P3_TOBYTES_IMPL
#define ge_p3_tobytes(s, h) ge_tobytes((s), (const ge_p2 *)(h))
#else