diff --git a/wolfcrypt/src/ge_operations.c b/wolfcrypt/src/ge_operations.c index 3758552c15..7556594f4b 100644 --- a/wolfcrypt/src/ge_operations.c +++ b/wolfcrypt/src/ge_operations.c @@ -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 */ diff --git a/wolfssl/wolfcrypt/ge_operations.h b/wolfssl/wolfcrypt/ge_operations.h index 8496b959b1..0a18a7ebba 100644 --- a/wolfssl/wolfcrypt/ge_operations.h +++ b/wolfssl/wolfcrypt/ge_operations.h @@ -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