ML-DSA AVX512: Add new assembly - #11032
Conversation
|
wolfSSL-Fenrir-bot
left a comment
There was a problem hiding this comment.
Fenrir Automated Review — PR #11032
Scan targets checked: wolfcrypt-bugs, wolfcrypt-rs-bugs, wolfcrypt-src, wolfssl-bugs, wolfssl-src
Findings: 1
Medium (1)
mlkem_rej_uniform*_ins dispatch on AVX512F alone, not AVX512F+BW
File: wolfcrypt/src/wc_mlkem_poly.c:2327
Function: mlkem_rej_uniform_n_ins
Category: Logic errors
mlkem_rej_uniform_n_ins/mlkem_rej_uniform_ins gate the base AVX512 path with IS_INTEL_AVX512(cpuid_flags) instead of the USE_INTEL_AVX512 (F+BW) macro this PR introduced for exactly this purpose. The fallback mlkem_rej_uniform_n_avx512/mlkem_rej_uniform_avx512 routines execute vpshufb zmm..., an AVX512BW-only instruction, causing SIGILL on AVX512F-without-BW hardware. Every sibling dispatcher in this same file (mlkem_cbd_eta2_ins, mlkem_compress_10, etc.) correctly uses USE_INTEL_AVX512.
Recommendation: Change both if (IS_INTEL_AVX512(cpuid_flags)) guards to if (USE_INTEL_AVX512(cpuid_flags)) to match the rest of the file.
Referenced code: wolfcrypt/src/wc_mlkem_poly.c:2327-2331 (5 lines)
This review was generated automatically by Fenrir. Findings are non-blocking.
Add implementation of assembly code for AVX512F/BW and AVX512F/BW/VBMI. Improvements to AVX2 assembly. Check AVX512BW CPU id flag for base AVX512 assembly for ML-KEM.
Description
Add implementation of assembly code for AVX512F/BW and AVX512F/BW/VBMI.
Improvements to AVX2 assembly.
Check AVX512BW CPU id flag for base AVX512 assembly for ML-KEM.
Testing
Regression tested ML-DSA.