Skip to content

Commit 02fe611

Browse files
committed
ML-KEM assembly: AVX512F and AVX512VBMI.
New assembly for ML-KEM for Intel x64 machines that support AVX512 extensions. Update how much is added to the stack of others.
1 parent e6d86b4 commit 02fe611

10 files changed

Lines changed: 58823 additions & 495 deletions

File tree

.wolfssl_known_macro_extras

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -399,6 +399,7 @@ NO_ARDUINO_DEFAULT
399399
NO_ASM
400400
NO_ASN_OLD_TYPE_NAMES
401401
NO_AVX512_SUPPORT
402+
NO_AVX512_VBMI_SUPPORT
402403
NO_CAMELLIA_CBC
403404
NO_CERT
404405
NO_CERT_IN_TICKET

wolfcrypt/src/cpuid.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,12 @@
150150
if (cpuid_flag(7, 0, EBX, 29)) { new_cpuid_flags |= CPUID_SHA ; }
151151
if (cpuid_flag(7, 0, ECX, 9)) { new_cpuid_flags |= CPUID_VAES ; }
152152
if (cpuid_flag(7, 0, EBX, 16)) { new_cpuid_flags |= CPUID_AVX512; }
153+
if (cpuid_flag(7, 0, ECX, 1)) {
154+
new_cpuid_flags |= CPUID_AVX512_VBMI;
155+
}
156+
if (cpuid_flag(7, 0, ECX, 6)) {
157+
new_cpuid_flags |= CPUID_AVX512_VBMI2;
158+
}
153159
if (cpuid_is_intel()) { new_cpuid_flags |= CPUID_INTEL ; }
154160
if (cpuid_is_amd()) { new_cpuid_flags |= CPUID_AMD ; }
155161
(void)wolfSSL_Atomic_Uint_CompareExchange

0 commit comments

Comments
 (0)