@@ -231,7 +231,8 @@ extern void poly1305_final_avx2(Poly1305* ctx, byte* mac);
231231 p [7 ] = (byte )(v >> 56 );
232232 }
233233#endif /* !WOLFSSL_ARMASM && !WOLFSSL_RISCV_ASM */
234- #else /* if not 64 bit then use 32 bit */
234+ /* if not 64 bit then use 32 bit */
235+ #elif !defined(WOLFSSL_ARMASM) || !defined(__thumb__)
235236
236237 static word32 U8TO32 (const byte * p )
237238 {
@@ -268,8 +269,8 @@ static WC_INLINE void u32tole64(const word32 inLe32, byte outLe64[8])
268269}
269270
270271
271- #if (!defined(WOLFSSL_ARMASM ) || !defined(__aarch64__ ) ) && \
272- !defined(WOLFSSL_RISCV_ASM )
272+ #if (!defined(WOLFSSL_ARMASM ) || ( !defined(__aarch64__ ) && \
273+ !defined(__thumb__ ))) && !defined( WOLFSSL_RISCV_ASM )
273274/*
274275This local function operates on a message with a given number of bytes
275276with a given ctx pointer to a Poly1305 structure.
@@ -788,7 +789,8 @@ int wc_Poly1305Final(Poly1305* ctx, byte* mac)
788789
789790 return 0 ;
790791}
791- #endif /* (!WOLFSSL_ARMASM || !__aarch64__) && !WOLFSSL_RISCV_ASM */
792+ #endif /* (!WOLFSSL_ARMASM || (!__aarch64__ && !__thumb__)) &&
793+ * !WOLFSSL_RISCV_ASM */
792794
793795
794796int wc_Poly1305Update (Poly1305 * ctx , const byte * m , word32 bytes )
@@ -883,8 +885,8 @@ int wc_Poly1305Update(Poly1305* ctx, const byte* m, word32 bytes)
883885 /* process full blocks */
884886 if (bytes >= POLY1305_BLOCK_SIZE ) {
885887 size_t want = ((size_t )bytes & ~((size_t )POLY1305_BLOCK_SIZE - 1 ));
886- #if (!defined(WOLFSSL_ARMASM ) || !defined(__aarch64__ ) ) && \
887- !defined(WOLFSSL_RISCV_ASM )
888+ #if (!defined(WOLFSSL_ARMASM ) || ( !defined(__aarch64__ ) && \
889+ !defined(__thumb__ ))) && !defined( WOLFSSL_RISCV_ASM )
888890 int ret ;
889891 ret = poly1305_blocks (ctx , m , want );
890892 if (ret != 0 )
0 commit comments