pq_crypto 0.6.5 → 0.6.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +233 -0
- data/README.md +16 -3
- data/SECURITY.md +46 -0
- data/ext/pqcrypto/extconf.rb +8 -1
- data/ext/pqcrypto/pq_externalmu.c +35 -0
- data/ext/pqcrypto/pqcrypto_native_api.h +91 -75
- data/ext/pqcrypto/pqcrypto_ruby_secure.c +97 -9
- data/ext/pqcrypto/pqcrypto_secure.c +95 -33
- data/ext/pqcrypto/pqcrypto_secure.h +66 -48
- data/ext/pqcrypto/pqcrypto_version.h +1 -1
- data/ext/pqcrypto/vendor/.vendored +7 -7
- data/ext/pqcrypto/vendor/mldsa-native/BUILDING.md +5 -2
- data/ext/pqcrypto/vendor/mldsa-native/LICENSE +21 -2
- data/ext/pqcrypto/vendor/mldsa-native/README.md +20 -7
- data/ext/pqcrypto/vendor/mldsa-native/RELEASE.md +160 -0
- data/ext/pqcrypto/vendor/mldsa-native/SECURITY.md +1 -1
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/README.md +2 -2
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/mldsa_native.c +85 -59
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/mldsa_native.h +292 -348
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/mldsa_native_asm.S +122 -76
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/mldsa_native_config.h +184 -86
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/cbmc.h +49 -4
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/common.h +49 -81
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/context.h +152 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/ct.h +25 -12
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/debug.c +2 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/debug.h +2 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/fips202x4.c +2 -2
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/keccakf1600.c +9 -11
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/aarch64/auto.h +19 -11
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/aarch64/src/keccak_f1600_x1_scalar_aarch64_asm.S +6 -4
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/aarch64/src/keccak_f1600_x1_v84a_aarch64_asm.S +7 -4
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/aarch64/src/keccak_f1600_x2_v84a_aarch64_asm.S +7 -4
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/aarch64/src/keccak_f1600_x4_v8a_scalar_hybrid_aarch64_asm.S +12 -9
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/aarch64/src/keccak_f1600_x4_v8a_v84a_scalar_hybrid_aarch64_asm.S +12 -9
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/aarch64/x1_scalar.h +1 -1
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/aarch64/x1_v84a.h +3 -2
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/aarch64/x2_v84a.h +3 -2
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/aarch64/x4_v8a_scalar.h +6 -1
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/aarch64/x4_v8a_v84a_scalar.h +3 -2
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/api.h +11 -11
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/armv81m/mve.h +9 -22
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/armv81m/src/keccak_f1600_x4_mve.S +8 -5
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/armv81m/src/keccak_f1600_x4_mve.c +1 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/armv81m/src/{state_extract_bytes_x4_mve.S → keccak_f1600_x4_state_extract_bytes_mve.S} +14 -14
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/armv81m/src/{state_xor_bytes_x4_mve.S → keccak_f1600_x4_state_xor_bytes_mve.S} +12 -12
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/auto.h +5 -4
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/x86_64/keccak_f1600_x4_avx2.h +2 -2
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/x86_64/src/fips202_native_x86_64.h +1 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/x86_64/src/keccak_f1600_x4_avx2_asm.S +36 -2
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/meta.h +62 -4
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/arith_native_aarch64.h +87 -54
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/{intt_aarch64_asm.S → mldsa_intt_aarch64_asm.S} +39 -6
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/{ntt_aarch64_asm.S → mldsa_ntt_aarch64_asm.S} +39 -6
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/{pointwise_montgomery_aarch64_asm.S → mldsa_pointwise_montgomery_aarch64_asm.S} +25 -3
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/{poly_caddq_aarch64_asm.S → mldsa_poly_caddq_aarch64_asm.S} +19 -3
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/{poly_chknorm_aarch64_asm.S → mldsa_poly_chknorm_aarch64_asm.S} +24 -3
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/{poly_decompose_32_aarch64_asm.S → mldsa_poly_decompose_32_aarch64_asm.S} +25 -3
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/{poly_decompose_88_aarch64_asm.S → mldsa_poly_decompose_88_aarch64_asm.S} +25 -3
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/{poly_use_hint_32_aarch64_asm.S → mldsa_poly_use_hint_32_aarch64_asm.S} +25 -3
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/{poly_use_hint_88_aarch64_asm.S → mldsa_poly_use_hint_88_aarch64_asm.S} +25 -3
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/{mld_polyvecl_pointwise_acc_montgomery_l4_aarch64_asm.S → mldsa_polyvecl_pointwise_acc_montgomery_l4_aarch64_asm.S} +31 -3
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/{mld_polyvecl_pointwise_acc_montgomery_l5_aarch64_asm.S → mldsa_polyvecl_pointwise_acc_montgomery_l5_aarch64_asm.S} +31 -3
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/{mld_polyvecl_pointwise_acc_montgomery_l7_aarch64_asm.S → mldsa_polyvecl_pointwise_acc_montgomery_l7_aarch64_asm.S} +31 -3
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/{polyz_unpack_17_aarch64_asm.S → mldsa_polyz_unpack_17_aarch64_asm.S} +31 -3
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/{polyz_unpack_19_aarch64_asm.S → mldsa_polyz_unpack_19_aarch64_asm.S} +31 -3
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/{rej_uniform_aarch64_asm.S → mldsa_rej_uniform_aarch64_asm.S} +48 -15
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/{rej_uniform_eta2_aarch64_asm.S → mldsa_rej_uniform_eta2_aarch64_asm.S} +42 -9
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/{rej_uniform_eta4_aarch64_asm.S → mldsa_rej_uniform_eta4_aarch64_asm.S} +42 -9
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/api.h +11 -3
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/meta.h +3 -2
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/meta.h +28 -28
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/arith_native_x86_64.h +171 -49
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/{intt_avx2_asm.S → mldsa_intt_avx2_asm.S} +23 -1
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/{ntt_avx2_asm.S → mldsa_ntt_avx2_asm.S} +23 -1
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/{nttunpack_avx2_asm.S → mldsa_nttunpack_avx2_asm.S} +17 -1
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/{pointwise_acc_l4_avx2_asm.S → mldsa_pointwise_acc_l4_avx2_asm.S} +37 -3
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/{pointwise_acc_l5_avx2_asm.S → mldsa_pointwise_acc_l5_avx2_asm.S} +37 -3
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/{pointwise_acc_l7_avx2_asm.S → mldsa_pointwise_acc_l7_avx2_asm.S} +37 -3
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/{pointwise_avx2_asm.S → mldsa_pointwise_avx2_asm.S} +31 -3
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/{poly_caddq_avx2_asm.S → mldsa_poly_caddq_avx2_asm.S} +18 -9
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/mldsa_poly_chknorm_avx2_asm.S +176 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/mldsa_poly_decompose_32_avx2_asm.S +490 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/mldsa_poly_decompose_88_avx2_asm.S +489 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/mldsa_poly_use_hint_32_avx2_asm.S +123 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/mldsa_poly_use_hint_88_avx2_asm.S +125 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/mldsa_polyz_unpack_17_avx2_asm.S +355 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/mldsa_polyz_unpack_19_avx2_asm.S +355 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/mldsa_rej_uniform_avx2_asm.S +132 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/mldsa_rej_uniform_eta2_avx2_asm.S +205 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/mldsa_rej_uniform_eta4_avx2_asm.S +176 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/packing.c +27 -36
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/packing.h +42 -8
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/params.h +93 -17
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/poly.c +74 -15
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/poly.h +97 -11
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/poly_kl.c +7 -38
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/poly_kl.h +49 -7
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/polyvec.c +16 -17
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/polyvec.h +26 -9
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/polyvec_lazy.c +3 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/polyvec_lazy.h +18 -19
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/reduce.h +15 -3
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/rounding.h +28 -6
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/sign.c +311 -246
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/sign.h +245 -240
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/sys.h +64 -5
- data/ext/pqcrypto/vendor/mlkem-native/BUILDING.md +5 -2
- data/ext/pqcrypto/vendor/mlkem-native/LICENSE +21 -3
- data/ext/pqcrypto/vendor/mlkem-native/README.md +2 -2
- data/ext/pqcrypto/vendor/mlkem-native/RELEASE.md +113 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/README.md +2 -2
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/mlkem_native.c +17 -27
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/mlkem_native.h +68 -151
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/mlkem_native_asm.S +17 -27
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/mlkem_native_config.h +46 -44
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/cbmc.h +25 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/common.h +37 -6
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/context.h +9 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/fips202.h +2 -2
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/keccakf1600.c +8 -8
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/aarch64/x1_scalar.h +1 -1
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/aarch64/x1_v84a.h +3 -3
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/aarch64/x2_v84a.h +3 -3
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/aarch64/x4_v8a_scalar.h +2 -2
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/aarch64/x4_v8a_v84a_scalar.h +3 -3
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/api.h +11 -11
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/armv81m/mve.h +3 -3
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/x86_64/keccak_f1600_x4_avx2.h +2 -2
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/indcpa.h +14 -11
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/kem.c +28 -11
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/kem.h +39 -14
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/meta.h +10 -10
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/meta.h +20 -20
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/sys.h +5 -5
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/verify.h +11 -10
- data/lib/pq_crypto/internal.rb +10 -0
- data/lib/pq_crypto/kem.rb +47 -5
- data/lib/pq_crypto/key.rb +14 -8
- data/lib/pq_crypto/pkcs8.rb +13 -5
- data/lib/pq_crypto/signature.rb +34 -9
- data/lib/pq_crypto/spki.rb +4 -2
- data/lib/pq_crypto/version.rb +1 -1
- data/lib/pq_crypto.rb +9 -0
- data/script/vendor_libs.rb +6 -6
- metadata +40 -38
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/poly_chknorm_avx2.c +0 -52
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/poly_decompose_32_avx2.c +0 -157
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/poly_decompose_88_avx2.c +0 -157
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/poly_use_hint_32_avx2.c +0 -103
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/poly_use_hint_88_avx2.c +0 -105
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/polyz_unpack_17_avx2.c +0 -94
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/polyz_unpack_19_avx2.c +0 -96
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/rej_uniform_avx2.c +0 -126
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/rej_uniform_eta2_avx2.c +0 -157
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/rej_uniform_eta4_avx2.c +0 -141
|
@@ -39,6 +39,21 @@
|
|
|
39
39
|
#define MLD_SYS_AARCH64
|
|
40
40
|
#endif
|
|
41
41
|
|
|
42
|
+
/* Check if the AArch64 compilation target supports NEON (Advanced SIMD).
|
|
43
|
+
*
|
|
44
|
+
* Some compilers also define __ARM_NEON__, but __ARM_NEON is the most reliable
|
|
45
|
+
* signal. Specifically, clang on Apple appears to keep __ARM_NEON__ set even if
|
|
46
|
+
* -march=armv8-a+nosimd is set.
|
|
47
|
+
*
|
|
48
|
+
* gcc 4.8 -- the first gcc version introducing Neon support -- sets neither
|
|
49
|
+
* __ARM_NEON nor __ARM_NEON__; in fact, there is no preprocessor signal that
|
|
50
|
+
* Neon is enabled. If you use gcc 4.8 and need Neon, you should set
|
|
51
|
+
* MLD_SYS_AARCH64_NEON manually. gcc 4.9 onwards do set __ARM_NEON.
|
|
52
|
+
*/
|
|
53
|
+
#if defined(MLD_SYS_AARCH64) && defined(__ARM_NEON)
|
|
54
|
+
#define MLD_SYS_AARCH64_NEON
|
|
55
|
+
#endif
|
|
56
|
+
|
|
42
57
|
/* Check if we're running on an AArch64 big endian system. */
|
|
43
58
|
#if defined(__AARCH64EB__)
|
|
44
59
|
#define MLD_SYS_AARCH64_EB
|
|
@@ -49,12 +64,13 @@
|
|
|
49
64
|
#define MLD_SYS_ARMV81M_MVE
|
|
50
65
|
#endif
|
|
51
66
|
|
|
52
|
-
|
|
67
|
+
/* Check if we're running on an x86_64 system. */
|
|
68
|
+
#if defined(__x86_64__) || defined(_M_X64) || defined(_M_AMD64)
|
|
53
69
|
#define MLD_SYS_X86_64
|
|
54
70
|
#if defined(__AVX2__)
|
|
55
71
|
#define MLD_SYS_X86_64_AVX2
|
|
56
72
|
#endif
|
|
57
|
-
#endif /* __x86_64__ */
|
|
73
|
+
#endif /* __x86_64__ || _M_X64 || _M_AMD64 */
|
|
58
74
|
|
|
59
75
|
#if defined(MLD_SYS_LITTLE_ENDIAN) && defined(__powerpc64__)
|
|
60
76
|
#define MLD_SYS_PPC64LE
|
|
@@ -153,6 +169,22 @@
|
|
|
153
169
|
#endif
|
|
154
170
|
#endif /* !MLD_ALWAYS_INLINE */
|
|
155
171
|
|
|
172
|
+
/*
|
|
173
|
+
* MLD_NOINLINE: Prevent inlining.
|
|
174
|
+
* - MSVC: __declspec(noinline)
|
|
175
|
+
* - GCC/Clang: __attribute__((noinline))
|
|
176
|
+
* - Other: empty
|
|
177
|
+
*/
|
|
178
|
+
#if !defined(MLD_NOINLINE)
|
|
179
|
+
#if defined(_MSC_VER)
|
|
180
|
+
#define MLD_NOINLINE __declspec(noinline)
|
|
181
|
+
#elif defined(__GNUC__) || defined(__clang__)
|
|
182
|
+
#define MLD_NOINLINE __attribute__((noinline))
|
|
183
|
+
#else
|
|
184
|
+
#define MLD_NOINLINE
|
|
185
|
+
#endif
|
|
186
|
+
#endif /* !MLD_NOINLINE */
|
|
187
|
+
|
|
156
188
|
#ifndef MLD_STATIC_TESTABLE
|
|
157
189
|
#define MLD_STATIC_TESTABLE static
|
|
158
190
|
#endif
|
|
@@ -185,7 +217,7 @@
|
|
|
185
217
|
#endif
|
|
186
218
|
|
|
187
219
|
|
|
188
|
-
/* New X86_64 CPUs support
|
|
220
|
+
/* New X86_64 CPUs support control-flow protection using the CET instructions.
|
|
189
221
|
* When enabled (through -fcf-protection=), all compilation units (including
|
|
190
222
|
* empty ones) need to support CET for this to work.
|
|
191
223
|
* For assembly, this means that source files need to signal support for
|
|
@@ -233,15 +265,42 @@
|
|
|
233
265
|
#define MLD_MUST_CHECK_RETURN_VALUE
|
|
234
266
|
#endif
|
|
235
267
|
|
|
268
|
+
/* The x86_64 assembly backend uses the SysV calling convention. On Windows,
|
|
269
|
+
* where the Microsoft x64 calling convention is the default, it can still be
|
|
270
|
+
* used with compilers that allow choosing the calling convention per
|
|
271
|
+
* function: GCC and Clang support __attribute__((sysv_abi)), which makes
|
|
272
|
+
* calls to the annotated function follow the SysV calling convention.
|
|
273
|
+
*
|
|
274
|
+
* MLD_SYSV_ABI_SUPPORTED signals that the toolchain can call SysV assembly
|
|
275
|
+
* routines; the x86_64 assembly backend is only enabled if it is defined.
|
|
276
|
+
* MLD_SYSV_ABI is the attribute carried by declarations of x86_64 assembly
|
|
277
|
+
* routines. Both macros can be set externally for toolchains offering an
|
|
278
|
+
* equivalent mechanism that is not recognized here. */
|
|
279
|
+
#if defined(MLD_SYS_X86_64) && !defined(MLD_SYSV_ABI_SUPPORTED)
|
|
280
|
+
#if !defined(MLD_SYS_WINDOWS) || defined(__GNUC__) || defined(__clang__)
|
|
281
|
+
#define MLD_SYSV_ABI_SUPPORTED
|
|
282
|
+
#endif
|
|
283
|
+
#endif
|
|
284
|
+
|
|
285
|
+
#if !defined(MLD_SYSV_ABI)
|
|
286
|
+
#if defined(MLD_SYS_WINDOWS) && defined(MLD_SYSV_ABI_SUPPORTED)
|
|
287
|
+
#define MLD_SYSV_ABI __attribute__((sysv_abi))
|
|
288
|
+
#else
|
|
289
|
+
#define MLD_SYSV_ABI
|
|
290
|
+
#endif
|
|
291
|
+
#endif /* !MLD_SYSV_ABI */
|
|
236
292
|
|
|
237
293
|
#if !defined(__ASSEMBLER__)
|
|
238
294
|
/* System capability enumeration */
|
|
239
295
|
typedef enum
|
|
240
296
|
{
|
|
241
297
|
/* x86_64 */
|
|
242
|
-
|
|
298
|
+
MLD_SYS_CAP_X86_64_AVX2,
|
|
243
299
|
/* AArch64 */
|
|
244
|
-
|
|
300
|
+
MLD_SYS_CAP_AARCH64_NEON,
|
|
301
|
+
MLD_SYS_CAP_AARCH64_SHA3,
|
|
302
|
+
/* Armv8.1-M */
|
|
303
|
+
MLD_SYS_CAP_ARMV81M_MVE
|
|
245
304
|
} mld_sys_cap;
|
|
246
305
|
|
|
247
306
|
#if !defined(MLD_CONFIG_CUSTOM_CAPABILITY_FUNC)
|
|
@@ -73,11 +73,14 @@ For detailed information on how to use the script, please refer to
|
|
|
73
73
|
|
|
74
74
|
You can also build **mlkem-native** on Windows using `nmake` and an MSVC compiler.
|
|
75
75
|
|
|
76
|
-
To build and run the tests
|
|
76
|
+
To build and run the tests, use the following `nmake` target:
|
|
77
77
|
```powershell
|
|
78
|
-
|
|
78
|
+
nmake /f .\Makefile.Microsoft_nmake quickcheck
|
|
79
79
|
```
|
|
80
80
|
|
|
81
|
+
This runs the functional, RNG-failure, allocation, ACVP, KAT and Wycheproof tests. The assembly backends are not yet
|
|
82
|
+
supported on Windows, so the tests are built for the C backend only.
|
|
83
|
+
|
|
81
84
|
# Checking the proofs
|
|
82
85
|
|
|
83
86
|
## CBMC
|
|
@@ -6,14 +6,32 @@ of the Apache-2.0 license OR the ISC license OR the MIT license.
|
|
|
6
6
|
These licenses are reproduced at the bottom of this file.
|
|
7
7
|
The copyright holders are indicated at the top of each file.
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
Files outside the library itself may carry different terms. Every file
|
|
10
|
+
states its own SPDX-License-Identifier, which determines the terms that
|
|
11
|
+
apply to it. In particular:
|
|
12
|
+
|
|
13
|
+
The code in test/notrandombytes/*, and its copies in
|
|
14
|
+
examples/*/test_only_rng/* and scripts/notrandombytes, is derived from
|
|
10
15
|
https://cr.yp.to/papers.html#surf and licensed under
|
|
11
16
|
LicenseRef-PD-hp OR CC0-1.0 OR 0BSD OR MIT-0 OR MIT.
|
|
12
17
|
It is only used for testing purposes.
|
|
13
18
|
|
|
14
|
-
The benchmarking code in test/hal
|
|
19
|
+
The benchmarking code in test/hal/* carries the
|
|
15
20
|
MIT license. It is only used for testing purposes.
|
|
16
21
|
|
|
22
|
+
The tiny_sha3 code in
|
|
23
|
+
examples/bring_your_own_fips202/custom_fips202/tiny_sha3/* and
|
|
24
|
+
examples/custom_backend/mlkem_native/src/fips202/native/custom/src/*
|
|
25
|
+
carries the MIT license. It is only used to demonstrate custom
|
|
26
|
+
FIPS-202 implementations.
|
|
27
|
+
|
|
28
|
+
The proofs in proofs/* are in part derived from Amazon Web Services
|
|
29
|
+
verification infrastructure. Individual files carry, among others,
|
|
30
|
+
Apache-2.0 OR ISC OR MIT-0, MIT-0, and MIT-0 AND Apache-2.0. None of the
|
|
31
|
+
proofs are part of the library.
|
|
32
|
+
|
|
33
|
+
Documentation is licensed under CC-BY-4.0.
|
|
34
|
+
|
|
17
35
|
```
|
|
18
36
|
Copyright (c) The mlkem-native project authors
|
|
19
37
|
Copyright (c) 2020 Dougall Johnson
|
|
@@ -39,7 +57,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
|
39
57
|
SOFTWARE.
|
|
40
58
|
```
|
|
41
59
|
|
|
42
|
-
The tiny_sha3 implementation in examples/custom_backend/mlkem_native/
|
|
60
|
+
The tiny_sha3 implementation in examples/custom_backend/mlkem_native/src/fips202/native/custom/src/
|
|
43
61
|
carries the MIT license. It is only used for testing purposes.
|
|
44
62
|
|
|
45
63
|
```
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
# mlkem-native
|
|
4
4
|
|
|
5
5
|

|
|
6
|
-

|
|
7
6
|

|
|
8
7
|

|
|
9
8
|
|
|
@@ -166,6 +165,8 @@ For CI benchmark results and historical performance data, see the [benchmarking
|
|
|
166
165
|
If you want to use mlkem-native, import [mlkem](mlkem) into your project's source tree and build using your favourite build system. See [mlkem](mlkem) for more information, and
|
|
167
166
|
[examples/basic](examples/basic) for a simple example. The build system provided in this repository is for development purposes only.
|
|
168
167
|
|
|
168
|
+
See [API-CONVENTIONS.md](API-CONVENTIONS.md) for conventions that apply to all public functions, such as return values, pointer validity, and the state of output buffers on error.
|
|
169
|
+
|
|
169
170
|
### Can I bring my own FIPS-202?
|
|
170
171
|
|
|
171
172
|
mlkem-native relies on and comes with an implementation of FIPS-202[^FIPS202]. If your library has its own FIPS-202 implementation, you
|
|
@@ -215,7 +216,6 @@ through the [PQCA Discord](https://discord.com/invite/xyVnwzfg5R). See also [CON
|
|
|
215
216
|
[^FIPS202]: National Institute of Standards and Technology: FIPS202 SHA-3 Standard: Permutation-Based Hash and Extendable-Output Functions, [https://csrc.nist.gov/pubs/fips/202/final](https://csrc.nist.gov/pubs/fips/202/final)
|
|
216
217
|
[^FIPS203]: National Institute of Standards and Technology: FIPS 203 Module-Lattice-Based Key-Encapsulation Mechanism Standard, [https://csrc.nist.gov/pubs/fips/203/final](https://csrc.nist.gov/pubs/fips/203/final)
|
|
217
218
|
[^HOL-Light]: John Harrison: HOL-Light Theorem Prover, [https://hol-light.github.io/](https://hol-light.github.io/)
|
|
218
|
-
[^HYBRID]: Becker, Kannwischer: Hybrid scalar/vector implementations of Keccak and SPHINCS+ on AArch64, [https://eprint.iacr.org/2022/1243](https://eprint.iacr.org/2022/1243)
|
|
219
219
|
[^KyberSlash]: Bernstein, Bhargavan, Bhasin, Chattopadhyay, Chia, Kannwischer, Kiefer, Paiva, Ravi, Tamvada: KyberSlash: Exploiting secret-dependent division timings in Kyber implementations, [https://kyberslash.cr.yp.to/papers.html](https://kyberslash.cr.yp.to/papers.html)
|
|
220
220
|
[^REF]: Bos, Ducas, Kiltz, Lepoint, Lyubashevsky, Schanck, Schwabe, Seiler, Stehlé: CRYSTALS-Kyber C reference implementation, [https://github.com/pq-crystals/kyber/tree/main/ref](https://github.com/pq-crystals/kyber/tree/main/ref)
|
|
221
221
|
[^SLOTHY_Paper]: Abdulrahman, Becker, Kannwischer, Klein: Fast and Clean: Auditable high-performance assembly via constraint solving, [https://eprint.iacr.org/2022/1303](https://eprint.iacr.org/2022/1303)
|
|
@@ -1,5 +1,118 @@
|
|
|
1
1
|
[//]: # (SPDX-License-Identifier: CC-BY-4.0)
|
|
2
2
|
|
|
3
|
+
mlkem-native v2.0.0
|
|
4
|
+
===================
|
|
5
|
+
|
|
6
|
+
Release notes
|
|
7
|
+
-------------
|
|
8
|
+
|
|
9
|
+
mlkem-native v2.0.0 is the second major release of mlkem-native. It follows
|
|
10
|
+
mlkem-native v1.3 and makes minor API changes: It removes the SUPERCOP `crypto_kem_*`
|
|
11
|
+
aliases and the legacy `MLK_CONFIG_API_*` path, splits the ambiguous `MLK_ERR_FAIL`
|
|
12
|
+
return code into specific error codes, and renames the FIPS-202 backend and
|
|
13
|
+
system-capability macros.
|
|
14
|
+
|
|
15
|
+
See the full change log here:
|
|
16
|
+
https://github.com/pq-code-package/mlkem-native/compare/v1.3.0...v2.0.0
|
|
17
|
+
|
|
18
|
+
Long-Term Support
|
|
19
|
+
-----------------
|
|
20
|
+
|
|
21
|
+
[`release/v1.3`](https://github.com/pq-code-package/mlkem-native/tree/release/v1.3) will
|
|
22
|
+
act as a support branch until February 2027 (inclusive). It will receive bugfixes, but no
|
|
23
|
+
new features. We do currently not plan to offer long-term support for mlkem-native v1.x beyond that timeframe.
|
|
24
|
+
|
|
25
|
+
If you are deploying mlkem-native v1.3 and expect to be unable to upgrade to
|
|
26
|
+
mlkem-native v2 by February 2027, please contact us to discuss a potential extension
|
|
27
|
+
of the support schedule.
|
|
28
|
+
|
|
29
|
+
Breaking changes since v1.3.0
|
|
30
|
+
-----------------------------
|
|
31
|
+
|
|
32
|
+
- Split the ambiguous `MLK_ERR_FAIL` return code into `MLK_ERR_INVALID_PK`
|
|
33
|
+
(`-4`), `MLK_ERR_INVALID_SK` (`-5`), and `MLK_ERR_PCT_FAIL` (`-6`), returned
|
|
34
|
+
respectively for a public key rejected by the FIPS 203 modulus check, a secret
|
|
35
|
+
key rejected by the hash check, and a failed keygen pairwise consistency test.
|
|
36
|
+
The codes `-1`..`-3` are unchanged; `MLK_ERR_FAIL` remains defined but is no
|
|
37
|
+
longer returned by any function. Integrators mapping return codes into their
|
|
38
|
+
own error space must handle the new values.
|
|
39
|
+
([#1852](https://github.com/pq-code-package/mlkem-native/pull/1852))
|
|
40
|
+
- Remove the SUPERCOP `crypto_kem_*` API aliases, the `MLK_CONFIG_NO_SUPERCOP`
|
|
41
|
+
option, and the `CRYPTO_{PUBLICKEY,SECRETKEY,CIPHERTEXT}BYTES`,
|
|
42
|
+
`CRYPTO_SYMBYTES` and `CRYPTO_BYTES` size constants. Consumers must use the
|
|
43
|
+
namespaced API (e.g. `mlkem_keypair`) and derive sizes from
|
|
44
|
+
`MLK_CONFIG_PARAMETER_SET`.
|
|
45
|
+
([#1857](https://github.com/pq-code-package/mlkem-native/pull/1857))
|
|
46
|
+
- Remove the legacy `MLK_CONFIG_API_*` configuration path. Configure builds
|
|
47
|
+
through the configuration file instead, renaming `MLK_CONFIG_API_PARAMETER_SET`
|
|
48
|
+
to `MLK_CONFIG_PARAMETER_SET`, `MLK_CONFIG_API_NAMESPACE_PREFIX` to
|
|
49
|
+
`MLK_CONFIG_NAMESPACE_PREFIX`, `MLK_CONFIG_API_CONSTANTS_ONLY` to
|
|
50
|
+
`MLK_CONFIG_CONSTANTS_ONLY`, and `MLK_CONFIG_API_QUALIFIER` to
|
|
51
|
+
`MLK_CONFIG_EXTERNAL_API_QUALIFIER`. For a multi-level build, set
|
|
52
|
+
`MLK_CONFIG_MULTILEVEL_BUILD`; the parameter set is now appended to the
|
|
53
|
+
namespace prefix automatically.
|
|
54
|
+
([#1853](https://github.com/pq-code-package/mlkem-native/pull/1853))
|
|
55
|
+
- Prefix the `mlk_sys_cap` enum values with their architecture:
|
|
56
|
+
`MLK_SYS_CAP_{AVX2,NEON,SHA3,MVE}` become
|
|
57
|
+
`MLK_SYS_CAP_{X86_64_AVX2,AARCH64_NEON,AARCH64_SHA3,ARMV81M_MVE}`. Custom
|
|
58
|
+
capability functions must use the new names.
|
|
59
|
+
([#1770](https://github.com/pq-code-package/mlkem-native/pull/1770))
|
|
60
|
+
- Rename the FIPS-202 backend function-support flags to the
|
|
61
|
+
`MLK_USE_NATIVE_<function>` convention used by the arithmetic backend:
|
|
62
|
+
`MLK_USE_FIPS202_X1_NATIVE` to `MLK_USE_NATIVE_FIPS202_X1`,
|
|
63
|
+
`MLK_USE_FIPS202_X4_NATIVE` to `MLK_USE_NATIVE_FIPS202_X4`,
|
|
64
|
+
`MLK_USE_FIPS202_X4_XOR_BYTES_NATIVE` to `MLK_USE_NATIVE_FIPS202_X4_XOR_BYTES`,
|
|
65
|
+
and `MLK_USE_FIPS202_X4_EXTRACT_BYTES_NATIVE` to
|
|
66
|
+
`MLK_USE_NATIVE_FIPS202_X4_EXTRACT_BYTES`. Custom FIPS-202 backends must rename
|
|
67
|
+
these flags accordingly.
|
|
68
|
+
([#1775](https://github.com/pq-code-package/mlkem-native/pull/1775))
|
|
69
|
+
|
|
70
|
+
What's New
|
|
71
|
+
----------
|
|
72
|
+
|
|
73
|
+
### Assurance
|
|
74
|
+
|
|
75
|
+
- Axiomatize the default `mlk_zeroize` in CBMC via a contract for its
|
|
76
|
+
zeroed-output postcondition, and configure the proofs with a failing custom
|
|
77
|
+
`mlk_zeroize` so they must rely on the contract rather than the concrete
|
|
78
|
+
implementation.
|
|
79
|
+
([#1850](https://github.com/pq-code-package/mlkem-native/pull/1850))
|
|
80
|
+
- Strengthen the top-level API contracts to check that output buffers are
|
|
81
|
+
zeroized or left unmodified on error.
|
|
82
|
+
([#1850](https://github.com/pq-code-package/mlkem-native/pull/1850))
|
|
83
|
+
|
|
84
|
+
### Configuration / API
|
|
85
|
+
|
|
86
|
+
- Add the error codes `MLK_ERR_INVALID_PK`, `MLK_ERR_INVALID_SK`, and
|
|
87
|
+
`MLK_ERR_PCT_FAIL`, distinguishing a rejected public key, a rejected secret
|
|
88
|
+
key, and a failed keygen self-test. `mlk_check_pct` maps a key-check rejection
|
|
89
|
+
of the freshly generated key to `MLK_ERR_PCT_FAIL` and passes platform
|
|
90
|
+
failures through unmodified.
|
|
91
|
+
([#1852](https://github.com/pq-code-package/mlkem-native/pull/1852))
|
|
92
|
+
|
|
93
|
+
### Testing
|
|
94
|
+
|
|
95
|
+
- Support the FIPS 203-tr1 encapDecap revision in the ACVP client, accepting a
|
|
96
|
+
decapsulation key supplied either as an expanded `dk` or as a `seed` (`d||z`)
|
|
97
|
+
to expand, with `keyFormat` inspected per group. mlkem-native now supports and
|
|
98
|
+
is tested against ACVP v1.1.0.43 in addition to the preceding two versions.
|
|
99
|
+
([#1811](https://github.com/pq-code-package/mlkem-native/pull/1811))
|
|
100
|
+
- Use runtime checks in the Wycheproof client instead of `assert`, which is
|
|
101
|
+
stripped under `python -O` and could report a mismatching vector as passing.
|
|
102
|
+
([#1840](https://github.com/pq-code-package/mlkem-native/pull/1840))
|
|
103
|
+
|
|
104
|
+
### Documentation
|
|
105
|
+
|
|
106
|
+
- Add `API-CONVENTIONS.md` describing the conventions shared by all public
|
|
107
|
+
functions: return values and the meaning of the `MLK_ERR_XXX` codes, pointer
|
|
108
|
+
validity, and the state of output buffers on error. Link it from `README.md`
|
|
109
|
+
and the `mlkem_native.h` preamble.
|
|
110
|
+
([#1843](https://github.com/pq-code-package/mlkem-native/pull/1843))
|
|
111
|
+
- Document the `MLK_ERR_RNG_FAIL` error returned by keygen.
|
|
112
|
+
([#1851](https://github.com/pq-code-package/mlkem-native/pull/1851))
|
|
113
|
+
- Clarify the scope and customization of `mlk_zeroize`.
|
|
114
|
+
([#1855](https://github.com/pq-code-package/mlkem-native/pull/1855))
|
|
115
|
+
|
|
3
116
|
mlkem-native v1.3.0
|
|
4
117
|
===================
|
|
5
118
|
|
|
@@ -8,7 +8,7 @@ This is the main source tree of mlkem-native.
|
|
|
8
8
|
|
|
9
9
|
To build a mlkem-native for a fixed parameter set (ML-KEM-512/768/1024), build the compilation in units in `src/*` separately, and link to an RNG and your application. See [examples/basic](../examples/basic) for a simple example.
|
|
10
10
|
|
|
11
|
-
Alternatively, you can use the auto-
|
|
11
|
+
Alternatively, you can use the auto-generated helper files [mlkem_native.c](mlkem_native.c) and [mlkem_native_asm.S](mlkem_native_asm.S), which bundle all *.c and *.S files together. See [examples/monolithic_build](../examples/monolithic_build) and [examples/monolithic_build_native](../examples/monolithic_build_native) for examples without and with native code.
|
|
12
12
|
|
|
13
13
|
## Configuration
|
|
14
14
|
|
|
@@ -20,4 +20,4 @@ The public API is defined in [mlkem_native.h](mlkem_native.h).
|
|
|
20
20
|
|
|
21
21
|
## Supporting multiple parameter sets
|
|
22
22
|
|
|
23
|
-
If you want to support multiple parameter sets, build the library once per parameter set you want to support. Set `MLK_CONFIG_MULTILEVEL_WITH_SHARED` for one of the builds, and `MLK_CONFIG_MULTILEVEL_NO_SHARED` for the others
|
|
23
|
+
If you want to support multiple parameter sets, build the library once per parameter set you want to support. Set `MLK_CONFIG_MULTILEVEL_BUILD` for all of these builds; this is what appends the parameter set to the namespace prefix, keeping the level-specific symbols apart. To avoid duplicating shared functionality, additionally set `MLK_CONFIG_MULTILEVEL_WITH_SHARED` for exactly one of the builds, and `MLK_CONFIG_MULTILEVEL_NO_SHARED` for the others. Finally, link with RNG and your application as before. This is demonstrated in the examples [examples/multilevel_build](../examples/multilevel_build), [examples/multilevel_build_native](../examples/multilevel_build_native), [examples/monolithic_build_multilevel](../examples/monolithic_build_multilevel) and [examples/monolithic_build_multilevel_native](../examples/monolithic_build_multilevel_native).
|
|
@@ -121,11 +121,6 @@
|
|
|
121
121
|
* Undefine macros from MLK_CONFIG_PARAMETER_SET-specific files
|
|
122
122
|
*/
|
|
123
123
|
/* mlkem/mlkem_native.h */
|
|
124
|
-
#undef CRYPTO_BYTES
|
|
125
|
-
#undef CRYPTO_CIPHERTEXTBYTES
|
|
126
|
-
#undef CRYPTO_PUBLICKEYBYTES
|
|
127
|
-
#undef CRYPTO_SECRETKEYBYTES
|
|
128
|
-
#undef CRYPTO_SYMBYTES
|
|
129
124
|
#undef MLKEM1024_BYTES
|
|
130
125
|
#undef MLKEM1024_CIPHERTEXTBYTES
|
|
131
126
|
#undef MLKEM1024_PUBLICKEYBYTES
|
|
@@ -152,17 +147,15 @@
|
|
|
152
147
|
#undef MLK_API_CONCAT
|
|
153
148
|
#undef MLK_API_CONCAT_
|
|
154
149
|
#undef MLK_API_CONCAT_UNDERSCORE
|
|
155
|
-
#undef MLK_API_LEGACY_CONFIG
|
|
156
150
|
#undef MLK_API_MUST_CHECK_RETURN_VALUE
|
|
157
151
|
#undef MLK_API_NAMESPACE
|
|
152
|
+
#undef MLK_API_NAMESPACE_PREFIX
|
|
158
153
|
#undef MLK_API_QUALIFIER
|
|
159
|
-
#undef MLK_CONFIG_API_CONSTANTS_ONLY
|
|
160
|
-
#undef MLK_CONFIG_API_NAMESPACE_PREFIX
|
|
161
|
-
#undef MLK_CONFIG_API_NO_SUPERCOP
|
|
162
|
-
#undef MLK_CONFIG_API_PARAMETER_SET
|
|
163
|
-
#undef MLK_CONFIG_API_QUALIFIER
|
|
164
154
|
#undef MLK_ERR_FAIL
|
|
155
|
+
#undef MLK_ERR_INVALID_PK
|
|
156
|
+
#undef MLK_ERR_INVALID_SK
|
|
165
157
|
#undef MLK_ERR_OUT_OF_MEMORY
|
|
158
|
+
#undef MLK_ERR_PCT_FAIL
|
|
166
159
|
#undef MLK_ERR_RNG_FAIL
|
|
167
160
|
#undef MLK_H
|
|
168
161
|
#undef MLK_MAX3_
|
|
@@ -184,13 +177,6 @@
|
|
|
184
177
|
#undef MLK_TOTAL_ALLOC_768_KEYPAIR
|
|
185
178
|
#undef MLK_TOTAL_ALLOC_768_KEYPAIR_NO_PCT
|
|
186
179
|
#undef MLK_TOTAL_ALLOC_768_KEYPAIR_PCT
|
|
187
|
-
#undef crypto_kem_check_pk
|
|
188
|
-
#undef crypto_kem_check_sk
|
|
189
|
-
#undef crypto_kem_dec
|
|
190
|
-
#undef crypto_kem_enc
|
|
191
|
-
#undef crypto_kem_enc_derand
|
|
192
|
-
#undef crypto_kem_keypair
|
|
193
|
-
#undef crypto_kem_keypair_derand
|
|
194
180
|
/* mlkem/src/common.h */
|
|
195
181
|
#undef MLK_ADD_PARAM_SET
|
|
196
182
|
#undef MLK_ALLOC
|
|
@@ -204,7 +190,10 @@
|
|
|
204
190
|
#undef MLK_CONCAT_
|
|
205
191
|
#undef MLK_EMPTY_CU
|
|
206
192
|
#undef MLK_ERR_FAIL
|
|
193
|
+
#undef MLK_ERR_INVALID_PK
|
|
194
|
+
#undef MLK_ERR_INVALID_SK
|
|
207
195
|
#undef MLK_ERR_OUT_OF_MEMORY
|
|
196
|
+
#undef MLK_ERR_PCT_FAIL
|
|
208
197
|
#undef MLK_ERR_RNG_FAIL
|
|
209
198
|
#undef MLK_EXTERNAL_API
|
|
210
199
|
#undef MLK_FIPS202X4_HEADER_FILE
|
|
@@ -313,6 +302,7 @@
|
|
|
313
302
|
#undef MLK_CONTEXT_PARAMETERS_2
|
|
314
303
|
#undef MLK_CONTEXT_PARAMETERS_3
|
|
315
304
|
#undef MLK_CONTEXT_PARAMETERS_4
|
|
305
|
+
#undef MLK_CONTEXT_UNUSED
|
|
316
306
|
/* mlkem/src/debug.h */
|
|
317
307
|
#undef MLK_DEBUG_H
|
|
318
308
|
#undef mlk_assert
|
|
@@ -466,23 +456,23 @@
|
|
|
466
456
|
/* mlkem/src/fips202/native/aarch64/x1_scalar.h */
|
|
467
457
|
#undef MLK_FIPS202_AARCH64_NEED_X1_SCALAR
|
|
468
458
|
#undef MLK_FIPS202_NATIVE_AARCH64_X1_SCALAR_H
|
|
469
|
-
#undef
|
|
459
|
+
#undef MLK_USE_NATIVE_FIPS202_X1
|
|
470
460
|
/* mlkem/src/fips202/native/aarch64/x1_v84a.h */
|
|
471
461
|
#undef MLK_FIPS202_AARCH64_NEED_X1_V84A
|
|
472
462
|
#undef MLK_FIPS202_NATIVE_AARCH64_X1_V84A_H
|
|
473
|
-
#undef
|
|
463
|
+
#undef MLK_USE_NATIVE_FIPS202_X1
|
|
474
464
|
/* mlkem/src/fips202/native/aarch64/x2_v84a.h */
|
|
475
465
|
#undef MLK_FIPS202_AARCH64_NEED_X2_V84A
|
|
476
466
|
#undef MLK_FIPS202_NATIVE_AARCH64_X2_V84A_H
|
|
477
|
-
#undef
|
|
467
|
+
#undef MLK_USE_NATIVE_FIPS202_X4
|
|
478
468
|
/* mlkem/src/fips202/native/aarch64/x4_v8a_scalar.h */
|
|
479
469
|
#undef MLK_FIPS202_AARCH64_NEED_X4_V8A_SCALAR_HYBRID
|
|
480
470
|
#undef MLK_FIPS202_NATIVE_AARCH64_X4_V8A_SCALAR_H
|
|
481
|
-
#undef
|
|
471
|
+
#undef MLK_USE_NATIVE_FIPS202_X4
|
|
482
472
|
/* mlkem/src/fips202/native/aarch64/x4_v8a_v84a_scalar.h */
|
|
483
473
|
#undef MLK_FIPS202_AARCH64_NEED_X4_V8A_V84A_SCALAR_HYBRID
|
|
484
474
|
#undef MLK_FIPS202_NATIVE_AARCH64_X4_V8A_V84A_SCALAR_H
|
|
485
|
-
#undef
|
|
475
|
+
#undef MLK_USE_NATIVE_FIPS202_X4
|
|
486
476
|
#endif /* MLK_SYS_AARCH64 */
|
|
487
477
|
#if defined(MLK_SYS_X86_64)
|
|
488
478
|
/*
|
|
@@ -491,7 +481,7 @@
|
|
|
491
481
|
/* mlkem/src/fips202/native/x86_64/keccak_f1600_x4_avx2.h */
|
|
492
482
|
#undef MLK_FIPS202_NATIVE_X86_64_KECCAK_F1600_X4_AVX2_H
|
|
493
483
|
#undef MLK_FIPS202_X86_64_NEED_X4_AVX2
|
|
494
|
-
#undef
|
|
484
|
+
#undef MLK_USE_NATIVE_FIPS202_X4
|
|
495
485
|
/* mlkem/src/fips202/native/x86_64/src/fips202_native_x86_64.h */
|
|
496
486
|
#undef MLK_FIPS202_NATIVE_X86_64_SRC_FIPS202_NATIVE_X86_64_H
|
|
497
487
|
#undef mlk_keccak_f1600_x4_avx2_asm
|
|
@@ -507,9 +497,9 @@
|
|
|
507
497
|
#undef MLK_FIPS202_ARMV81M_NEED_X4
|
|
508
498
|
#undef MLK_FIPS202_NATIVE_ARMV81M
|
|
509
499
|
#undef MLK_FIPS202_NATIVE_ARMV81M_MVE_H
|
|
510
|
-
#undef
|
|
511
|
-
#undef
|
|
512
|
-
#undef
|
|
500
|
+
#undef MLK_USE_NATIVE_FIPS202_X4
|
|
501
|
+
#undef MLK_USE_NATIVE_FIPS202_X4_EXTRACT_BYTES
|
|
502
|
+
#undef MLK_USE_NATIVE_FIPS202_X4_XOR_BYTES
|
|
513
503
|
#undef mlk_keccak_f1600_x4_native_impl
|
|
514
504
|
/* mlkem/src/fips202/native/armv81m/src/fips202_native_armv81m.h */
|
|
515
505
|
#undef MLK_FIPS202_NATIVE_ARMV81M_SRC_FIPS202_NATIVE_ARMV81M_H
|