From d901433999c4548b33732a6ab5a2a3ce5c417e18 Mon Sep 17 00:00:00 2001 From: Sean Parkinson Date: Thu, 27 Apr 2023 09:41:31 +1000 Subject: [PATCH] SP int ARMv6: clz not available, correct #if Checking for architecture less than 7 to use clz instruction when clz is only guaranteed to be available in 7 or more. Reverse logic. --- wolfcrypt/src/sp_int.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wolfcrypt/src/sp_int.c b/wolfcrypt/src/sp_int.c index 5c2f7d1c8..35c31db54 100644 --- a/wolfcrypt/src/sp_int.c +++ b/wolfcrypt/src/sp_int.c @@ -1245,7 +1245,7 @@ static WC_INLINE sp_int_digit sp_div_word(sp_int_digit hi, sp_int_digit lo, : [a] "r" (va), [b] "r" (vb), [c] "r" (vc) \ : "cc" \ ) -#if defined(WOLFSSL_SP_ARM_ARCH) && (WOLFSSL_SP_ARM_ARCH < 7) +#if defined(WOLFSSL_SP_ARM_ARCH) && (WOLFSSL_SP_ARM_ARCH >= 7) /* Count leading zeros - instruction only available on ARMv7 and newer. */ #define SP_ASM_LZCNT(va, vn) \ __asm__ __volatile__ ( \