@@ -99,7 +99,7 @@ static int mlkem_get_noise_eta2_c(MLKEM_PRF_T* prf, sword16* p,
9999#endif
100100
101101/* Declared in wc_mlkem.c to stop compiler optimizer from simplifying. */
102- extern volatile sword16 mlkem_opt_blocker ;
102+ extern sword16 wc_mlkem_opt_blocker ( void ) ;
103103
104104#if defined(USE_INTEL_SPEEDUP ) || (defined(__aarch64__ ) && \
105105 defined(WOLFSSL_ARMASM ))
@@ -126,7 +126,7 @@ static cpuid_flags_t cpuid_flags = WC_CPUID_INITIALIZER;
126126 * f is the normalizer = 2^k % m.
127127 * 16-bit value cast to sword32 in use.
128128 */
129- #define MLKEM_F ((1ULL << 32) % MLKEM_Q)
129+ #define MLKEM_F (((word64)1 << 32) % MLKEM_Q)
130130
131131/* Number of bytes in an output block of SHA-3-128 */
132132#define SHA3_128_BYTES (WC_SHA3_128_COUNT * 8)
@@ -5758,8 +5758,8 @@ void mlkem_decompress_5(sword16* p, const byte* b)
57585758/* Convert bit from byte to 0 or (MLKEM_Q + 1) / 2.
57595759 *
57605760 * Constant time implementation.
5761- * XOR in mlkem_opt_blocker to ensure optimizer doesn't know what will be ANDed
5762- * with MLKEM_Q_1_HALF and can't optimize to non-constant time code.
5761+ * XOR in wc_mlkem_opt_blocker() to ensure optimizer doesn't know what will be
5762+ * ANDed with MLKEM_Q_1_HALF and can't optimize to non-constant time code.
57635763 *
57645764 * FIPS 203, Algorithm 6: ByteDecode_d(B)
57655765 *
@@ -5770,7 +5770,7 @@ void mlkem_decompress_5(sword16* p, const byte* b)
57705770 */
57715771#define FROM_MSG_BIT (p , msg , i , j ) \
57725772 ((p)[8 * (i) + (j)] = (((sword16)0 - (sword16)(((msg)[i] >> (j)) & 1)) ^ \
5773- mlkem_opt_blocker ) & MLKEM_Q_1_HALF)
5773+ wc_mlkem_opt_blocker() ) & MLKEM_Q_1_HALF)
57745774
57755775/* Convert message to polynomial.
57765776 *
0 commit comments