pq_crypto 0.6.7 → 0.6.9
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 +20 -0
- data/README.md +1 -3
- data/ext/pqcrypto/pqcrypto_ruby_secure.c +41 -11
- data/ext/pqcrypto/pqcrypto_secure.c +501 -296
- data/ext/pqcrypto/pqcrypto_version.h +1 -1
- data/ext/pqcrypto/vendor/.vendored +7 -7
- data/ext/pqcrypto/vendor/mldsa-native/BUILDING.md +71 -0
- data/ext/pqcrypto/vendor/mldsa-native/README.md +26 -11
- data/ext/pqcrypto/vendor/mldsa-native/RELEASE.md +77 -150
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/mldsa_native.c +93 -40
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/mldsa_native.h +74 -59
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/mldsa_native_asm.S +106 -40
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/mldsa_native_config.h +94 -92
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/capability.h +31 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/cbmc.h +55 -4
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/common.h +30 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/context.h +1 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/debug.c +1 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/fips202.h +1 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/aarch64/src/keccak_f1600_x1_scalar_aarch64_asm.S +5 -2
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/aarch64/src/keccak_f1600_x1_v84a_aarch64_asm.S +4 -4
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/aarch64/src/keccak_f1600_x2_v84a_aarch64_asm.S +4 -4
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/aarch64/src/keccak_f1600_x4_v8a_scalar_hybrid_aarch64_asm.S +8 -3
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/aarch64/src/keccak_f1600_x4_v8a_v84a_scalar_hybrid_aarch64_asm.S +8 -4
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/armv81m/mve.h +12 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/armv81m/src/keccak_f1600_x4_mve.S +4 -2
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/armv81m/src/keccak_f1600_x4_state_extract_bytes_mve.S +37 -19
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/armv81m/src/keccak_f1600_x4_state_xor_bytes_mve.S +37 -19
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/auto.h +3 -8
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/x86_64/auto.h +53 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/x86_64/keccak_f1600_x1_avx512.h +38 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/x86_64/keccak_f1600_x4_avx512.h +38 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/x86_64/src/fips202_native_x86_64.h +24 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/x86_64/src/keccak_f1600_x1_avx512_asm.S +574 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/x86_64/src/keccak_f1600_x4_avx2_asm.S +46 -18
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/x86_64/src/keccak_f1600_x4_avx512_asm.S +679 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/x86_64/src/keccakf1600_constants.c +13 -4
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/meta.h +6 -4
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/arith_native_aarch64.h +5 -6
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/mldsa_intt_aarch64_asm.S +4 -2
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/mldsa_ntt_aarch64_asm.S +4 -2
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/mldsa_pointwise_montgomery_aarch64_asm.S +6 -4
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/mldsa_poly_caddq_aarch64_asm.S +4 -2
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/mldsa_poly_chknorm_aarch64_asm.S +6 -4
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/mldsa_poly_decompose_32_aarch64_asm.S +4 -3
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/mldsa_poly_decompose_88_aarch64_asm.S +4 -3
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/mldsa_poly_use_hint_32_aarch64_asm.S +4 -3
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/mldsa_poly_use_hint_88_aarch64_asm.S +4 -3
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/mldsa_polyvecl_pointwise_acc_montgomery_l4_aarch64_asm.S +4 -2
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/mldsa_polyvecl_pointwise_acc_montgomery_l5_aarch64_asm.S +4 -2
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/mldsa_polyvecl_pointwise_acc_montgomery_l7_aarch64_asm.S +4 -2
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/mldsa_polyz_unpack_17_aarch64_asm.S +5 -3
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/mldsa_polyz_unpack_19_aarch64_asm.S +5 -3
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/mldsa_rej_uniform_aarch64_asm.S +110 -120
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/mldsa_rej_uniform_eta2_aarch64_asm.S +109 -101
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/mldsa_rej_uniform_eta4_aarch64_asm.S +97 -93
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/api.h +1 -9
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/meta.h +4 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/rv32im/fastmul.h +74 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/rv32im/slowmul.h +77 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/rv32im/src/arith_native_rv32im.h +124 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/rv32im/src/mldsa_intt_rv32im_asm.S +331 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/rv32im/src/mldsa_intt_rv32im_slowmul_asm.S +381 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/rv32im/src/mldsa_ntt_rv32im_asm.S +304 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/rv32im/src/mldsa_ntt_rv32im_slowmul_asm.S +351 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/rv32im/src/mldsa_poly_pointwise_montgomery_rv32im_asm.S +139 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/rv32im/src/rv32im_zetas.c +118 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/meta.h +6 -5
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/arith_native_x86_64.h +2 -3
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/mldsa_intt_avx2_asm.S +5 -3
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/mldsa_ntt_avx2_asm.S +5 -3
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/mldsa_nttunpack_avx2_asm.S +5 -3
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/mldsa_pointwise_acc_l4_avx2_asm.S +6 -3
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/mldsa_pointwise_acc_l5_avx2_asm.S +6 -3
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/mldsa_pointwise_acc_l7_avx2_asm.S +6 -3
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/mldsa_pointwise_avx2_asm.S +5 -3
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/mldsa_poly_caddq_avx2_asm.S +5 -3
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/mldsa_poly_chknorm_avx2_asm.S +7 -5
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/mldsa_poly_decompose_32_avx2_asm.S +69 -67
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/mldsa_poly_decompose_88_avx2_asm.S +69 -67
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/mldsa_poly_use_hint_32_avx2_asm.S +12 -16
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/mldsa_poly_use_hint_88_avx2_asm.S +14 -18
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/mldsa_polyz_unpack_17_avx2_asm.S +6 -3
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/mldsa_polyz_unpack_19_avx2_asm.S +6 -3
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/mldsa_rej_uniform_avx2_asm.S +5 -3
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/mldsa_rej_uniform_eta2_avx2_asm.S +5 -3
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/mldsa_rej_uniform_eta4_avx2_asm.S +5 -3
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/packing.c +23 -27
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/packing.h +21 -42
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/params.h +28 -1
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/poly.c +87 -28
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/poly.h +61 -3
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/poly_kl.c +23 -19
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/poly_kl.h +30 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/polyvec.c +55 -107
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/polyvec.h +67 -107
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/polyvec_lazy.c +16 -24
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/polyvec_lazy.h +27 -21
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/reduce.h +8 -8
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/sign.c +191 -119
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/sign.h +6 -3
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/sys.h +16 -42
- data/ext/pqcrypto/vendor/mlkem-native/BUILDING.md +72 -0
- data/ext/pqcrypto/vendor/mlkem-native/README.md +9 -5
- data/ext/pqcrypto/vendor/mlkem-native/RELEASE.md +64 -312
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/mlkem_native.c +77 -34
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/mlkem_native.h +41 -13
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/mlkem_native_asm.S +89 -33
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/mlkem_native_config.h +50 -46
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/capability.h +30 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/common.h +30 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/compress.c +1 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/compress.h +4 -5
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/debug.c +1 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/fips202.c +15 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/fips202.h +23 -8
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/fips202x4.c +11 -3
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/fips202x4.h +7 -1
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/keccakf1600.c +8 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/keccakf1600.h +8 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/aarch64/src/keccak_f1600_x1_scalar_aarch64_asm.S +5 -2
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/aarch64/src/keccak_f1600_x1_v84a_aarch64_asm.S +4 -4
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/aarch64/src/keccak_f1600_x2_v84a_aarch64_asm.S +4 -4
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/aarch64/src/keccak_f1600_x4_v8a_scalar_hybrid_aarch64_asm.S +8 -3
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/aarch64/src/keccak_f1600_x4_v8a_v84a_scalar_hybrid_aarch64_asm.S +8 -4
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/armv81m/src/keccak_f1600_x4_mve.S +4 -2
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/armv81m/src/keccak_f1600_x4_state_extract_bytes_mve.S +37 -19
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/armv81m/src/keccak_f1600_x4_state_xor_bytes_mve.S +37 -19
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/auto.h +2 -2
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/x86_64/auto.h +47 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/x86_64/keccak_f1600_x1_avx512.h +37 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/x86_64/keccak_f1600_x4_avx512.h +37 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/x86_64/src/fips202_native_x86_64.h +24 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/x86_64/src/keccak_f1600_x1_avx512_asm.S +573 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/x86_64/src/keccak_f1600_x4_avx2_asm.S +46 -18
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/x86_64/src/keccak_f1600_x4_avx512_asm.S +678 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/x86_64/src/keccakf1600_constants.c +13 -4
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/indcpa.c +1 -2
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/kem.c +7 -5
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/kem.h +29 -5
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/meta.h +156 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/arith_native_aarch64.h +137 -3
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/compress_d5_table.c +43 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/decompress_d10_table.c +50 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/decompress_d11_table.c +53 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/decompress_d4_table.c +44 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/decompress_d5_table.c +53 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/mlkem_intt_aarch64_asm.S +5 -3
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/mlkem_ntt_aarch64_asm.S +4 -2
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/mlkem_poly_compress_d10_aarch64_asm.S +439 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/mlkem_poly_compress_d11_aarch64_asm.S +452 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/mlkem_poly_compress_d4_aarch64_asm.S +106 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/mlkem_poly_compress_d5_aarch64_asm.S +124 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/mlkem_poly_decompress_d10_aarch64_asm.S +108 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/mlkem_poly_decompress_d11_aarch64_asm.S +116 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/mlkem_poly_decompress_d4_aarch64_asm.S +93 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/mlkem_poly_decompress_d5_aarch64_asm.S +104 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/mlkem_poly_frombytes_aarch64_asm.S +84 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/mlkem_poly_mulcache_compute_aarch64_asm.S +4 -2
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/mlkem_poly_reduce_aarch64_asm.S +4 -2
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/mlkem_poly_tobytes_aarch64_asm.S +5 -3
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/mlkem_poly_tomont_aarch64_asm.S +4 -3
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/mlkem_polyvec_basemul_acc_montgomery_cached_k2_aarch64_asm.S +4 -2
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/mlkem_polyvec_basemul_acc_montgomery_cached_k3_aarch64_asm.S +4 -2
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/mlkem_polyvec_basemul_acc_montgomery_cached_k4_aarch64_asm.S +4 -2
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/mlkem_rej_uniform_aarch64_asm.S +112 -104
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/api.h +0 -1
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/meta.h +2 -2
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/ppc64le/README.md +2 -2
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/ppc64le/meta.h +16 -21
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/ppc64le/src/arith_native_ppc64le.h +1 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/ppc64le/src/consts.c +2 -2
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/ppc64le/src/mlkem_intt_ppc_asm.S +6 -5
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/ppc64le/src/mlkem_ntt_ppc_asm.S +6 -5
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/ppc64le/src/mlkem_poly_tomont_ppc_asm.S +6 -5
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/ppc64le/src/mlkem_reduce_ppc_asm.S +6 -5
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/riscv64/src/rv64v_debug.c +5 -4
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/riscv64/src/rv64v_debug.h +2 -2
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/riscv64/src/rv64v_poly.c +1 -1
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/arith_native_x86_64.h +5 -5
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/mlkem_intt_avx2_asm.S +36 -33
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/mlkem_ntt_avx2_asm.S +67 -65
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/mlkem_nttfrombytes_avx2_asm.S +8 -5
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/mlkem_ntttobytes_avx2_asm.S +6 -3
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/mlkem_nttunpack_avx2_asm.S +5 -3
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/mlkem_poly_compress_d10_avx2_asm.S +7 -5
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/mlkem_poly_compress_d11_avx2_asm.S +7 -4
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/mlkem_poly_compress_d4_avx2_asm.S +7 -5
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/mlkem_poly_compress_d5_avx2_asm.S +7 -4
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/mlkem_poly_decompress_d10_avx2_asm.S +7 -4
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/mlkem_poly_decompress_d11_avx2_asm.S +6 -4
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/mlkem_poly_decompress_d4_avx2_asm.S +7 -4
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/mlkem_poly_decompress_d5_avx2_asm.S +6 -4
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/mlkem_poly_mulcache_compute_avx2_asm.S +5 -3
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/mlkem_polyvec_basemul_acc_montgomery_cached_k2_avx2_asm.S +118 -115
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/mlkem_polyvec_basemul_acc_montgomery_cached_k3_avx2_asm.S +174 -171
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/mlkem_polyvec_basemul_acc_montgomery_cached_k4_avx2_asm.S +230 -227
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/mlkem_reduce_avx2_asm.S +17 -15
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/mlkem_rej_uniform_avx2_asm.S +7 -6
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/mlkem_tomont_avx2_asm.S +5 -3
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/poly_k.c +4 -9
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/poly_k.h +1 -1
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/sys.h +31 -44
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/verify.h +1 -1
- data/lib/pq_crypto/internal.rb +10 -0
- data/lib/pq_crypto/kem.rb +5 -10
- data/lib/pq_crypto/pkcs8/der.rb +26 -11
- data/lib/pq_crypto/pkcs8/private_key_choice.rb +21 -25
- data/lib/pq_crypto/signature.rb +28 -40
- data/lib/pq_crypto/spki.rb +36 -23
- data/lib/pq_crypto/version.rb +1 -1
- data/script/vendor_libs.rb +6 -6
- metadata +36 -1
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
backend=PQ Code Package native only
|
|
3
3
|
pqclean=removed
|
|
4
4
|
mlkem_native_repo=https://github.com/pq-code-package/mlkem-native.git
|
|
5
|
-
mlkem_native_ref=v2.
|
|
6
|
-
mlkem_native_commit=
|
|
7
|
-
mlkem_native_tree_sha256=
|
|
5
|
+
mlkem_native_ref=v2.1.0
|
|
6
|
+
mlkem_native_commit=4d69d6b0358e678e3a694ea1bb8404a41770f68e
|
|
7
|
+
mlkem_native_tree_sha256=0fb0b44188f63d42ca0049bd66bee26187d0317fa28489eb6b6c9ce30ef97dff
|
|
8
8
|
mldsa_native_repo=https://github.com/pq-code-package/mldsa-native.git
|
|
9
|
-
mldsa_native_ref=v2.
|
|
10
|
-
mldsa_native_commit=
|
|
11
|
-
mldsa_native_tree_sha256=
|
|
12
|
-
manifest_sha256=
|
|
9
|
+
mldsa_native_ref=v2.1.0
|
|
10
|
+
mldsa_native_commit=c9999d77599a9f0f0281ad745ad59a83f177b22c
|
|
11
|
+
mldsa_native_tree_sha256=b00aa86111dc66fe8bad91ddf083817677d4d3685fcf6eac70e6572d96dc907f
|
|
12
|
+
manifest_sha256=0bab79fb620e4823bbdab55d01032e24eb94e30bcf13814369151915920c4951
|
|
@@ -37,6 +37,16 @@ make run_acvp
|
|
|
37
37
|
|
|
38
38
|
The resulting binaries can be found in `test/build` (their full path is printed by `make`).
|
|
39
39
|
|
|
40
|
+
To check that the assembled byte code in the final libraries match the machine code that the
|
|
41
|
+
[HOL Light Proofs](proofs/hol_light) reason about, use
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
make CHECK_BINARY=1 # with any target, e.g. `make test CHECK_BINARY=1`
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
This checks each library and binary as `make` builds it, and fails on a mismatch. Files that
|
|
48
|
+
are already built are not checked again; use `scripts/check-binary FILE ...` for those.
|
|
49
|
+
|
|
40
50
|
For benchmarking, specify the cycle counting method. Currently, **mldsa-native** is supporting NO, PERF, PMU, and MAC:
|
|
41
51
|
* `NO` means that no cycle counting will be used; this can be used to confirm that benchmarks compile fine.
|
|
42
52
|
* `PERF` uses the `perf` kernel module for cycle counting. Does not work on Apple platforms.
|
|
@@ -66,6 +76,67 @@ will compile and run functionality tests. Similarly,
|
|
|
66
76
|
|
|
67
77
|
will compile and run benchmarks, using PERF for cycle counting (`-c PERF`) and running as root (`-r`).
|
|
68
78
|
|
|
79
|
+
On Linux, `./scripts/tests` builds with `CHECK_BINARY=1`, described above, if readelf and
|
|
80
|
+
`python3` with PyYAML are available; `--no-check-binary` turns this off.
|
|
81
|
+
|
|
82
|
+
#### Test platforms
|
|
83
|
+
|
|
84
|
+
The `--platform` option supplies non-empty cross-compilation and execution
|
|
85
|
+
settings, or selects the platform Makefile. It does not change which tests run.
|
|
86
|
+
Empty low-level options and profile values that are not specified preserve the
|
|
87
|
+
existing environment. The `native` profile adds no compile or run overrides.
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
# Native host
|
|
91
|
+
./scripts/tests func
|
|
92
|
+
|
|
93
|
+
# GNU/Linux AArch64 under QEMU user mode
|
|
94
|
+
nix develop .#cross-aarch64 --command \
|
|
95
|
+
./scripts/tests func --platform linux/aarch64
|
|
96
|
+
|
|
97
|
+
# No-MMU AArch64 QEMU virt machine
|
|
98
|
+
nix develop .#cross-aarch64-embedded --command \
|
|
99
|
+
./scripts/tests func --platform baremetal/aarch64-virt
|
|
100
|
+
|
|
101
|
+
# AVR under simavr
|
|
102
|
+
nix develop .#cross-avr --command \
|
|
103
|
+
./scripts/tests func --platform baremetal/avr --opt=no_opt
|
|
104
|
+
|
|
105
|
+
# Zephyr on the default QEMU board
|
|
106
|
+
nix develop .#zephyr --command \
|
|
107
|
+
./scripts/tests func --platform zephyr
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
Available profiles:
|
|
111
|
+
|
|
112
|
+
| Platform | Nix shell | Execution environment |
|
|
113
|
+
| -------- | --------- | --------------------- |
|
|
114
|
+
| `native` | `default` | Inherited environment (normally the current host) |
|
|
115
|
+
| `linux/x86_64` | `cross-x86_64` or `cross` | QEMU user mode |
|
|
116
|
+
| `linux/x86_64-no-avx2` | `cross-x86_64` or `cross` | QEMU Snowridge, no AVX2 |
|
|
117
|
+
| `linux/aarch64` | `cross-aarch64` or `cross` | QEMU user mode |
|
|
118
|
+
| `linux/aarch64_be` | `cross-aarch64_be` or `cross` | QEMU user mode |
|
|
119
|
+
| `linux/ppc64le` | `cross-ppc64le` or `cross` | QEMU user mode |
|
|
120
|
+
| `linux/riscv64-rvv128` | `cross-riscv64` or `cross` | QEMU RVV, VLEN=128 |
|
|
121
|
+
| `linux/riscv64-rvv256` | `cross-riscv64` or `cross` | QEMU RVV, VLEN=256 |
|
|
122
|
+
| `linux/riscv64-rvv512` | `cross-riscv64` or `cross` | QEMU RVV, VLEN=512 |
|
|
123
|
+
| `linux/riscv64-rvv1024` | `cross-riscv64` or `cross` | QEMU RVV, VLEN=1024 |
|
|
124
|
+
| `linux/riscv32` | `cross-riscv32` or `cross` | QEMU user mode |
|
|
125
|
+
| `baremetal/aarch64-virt` | `cross-aarch64-embedded` | QEMU system emulation |
|
|
126
|
+
| `baremetal/avr` | `cross-avr` | simavr |
|
|
127
|
+
| `zephyr` | `zephyr` | Zephyr under QEMU or on supported hardware |
|
|
128
|
+
|
|
129
|
+
Explicit non-empty `--cross-prefix` and `--exec-wrapper` values override
|
|
130
|
+
profile values; empty values are treated like omitted options. `--cflags` and
|
|
131
|
+
`--ldflags` extend profile values. Bare-metal and Zephyr profiles select
|
|
132
|
+
their existing platform Makefile, which supplies toolchain, linker, and runtime
|
|
133
|
+
defaults.
|
|
134
|
+
|
|
135
|
+
The standalone example Makefiles do not consume platform Makefiles. The
|
|
136
|
+
`examples` command, and `all` unless passed `--no-examples`, therefore reject
|
|
137
|
+
bare-metal, Zephyr, and explicit `--extra-makefile` configurations. Prefix-based
|
|
138
|
+
Linux profiles remain supported.
|
|
139
|
+
|
|
69
140
|
For detailed information on how to use the script, please refer to
|
|
70
141
|
`./scripts/tests --help`.
|
|
71
142
|
|
|
@@ -22,7 +22,7 @@ mldsa-native allows developers to support ML-DSA with minimal performance and ma
|
|
|
22
22
|
|
|
23
23
|
**Maintainability and Safety:** Memory safety, type safety and absence of various classes of timing leakage are automatically checked on every change, using a combination of static model checking (using CBMC) and dynamic instrumentation (using valgrind). This reduces review and maintenance burden and accelerates safe code delivery. See [Formal Verification](#formal-verification) and [Security](#security).
|
|
24
24
|
|
|
25
|
-
**Architecture Support:** Native backends are added under a unified interface, minimizing duplicated code and reasoning. mldsa-native comes with backends for AArch64 and
|
|
25
|
+
**Architecture Support:** Native backends are added under a unified interface, minimizing duplicated code and reasoning. mldsa-native comes with backends for AArch64, x86-64 (AVX2 and AVX-512 for FIPS-202), and RV32-IM, and an experimental backend for Armv8.1-M. See [Design](#design).
|
|
26
26
|
|
|
27
27
|
## Quickstart for Ubuntu
|
|
28
28
|
|
|
@@ -51,19 +51,28 @@ make test
|
|
|
51
51
|
mldsa-native is used in
|
|
52
52
|
- AWS' Cryptography library [AWS-LC](https://github.com/aws/aws-lc/)
|
|
53
53
|
- [libOQS](https://github.com/open-quantum-safe/liboqs/) of the Open Quantum Safe project
|
|
54
|
+
- [PyCryptodome](https://github.com/Legrandin/pycryptodome) - a self-contained Python package of low-level cryptographic primitives
|
|
55
|
+
- [TF-PSA-Crypto](https://github.com/Mbed-TLS/TF-PSA-Crypto) - the PSA Cryptography API implementation of Mbed TLS
|
|
54
56
|
- [Pavona](https://github.com/pavona/pavona) - a library of modular, tapeout-proven, and secure-by-default open silicon blocks
|
|
55
57
|
- [CHERIoT-PQC](https://github.com/CHERIoT-Platform/cheriot-pqc) — post-quantum cryptography support for the CHERIoT platform
|
|
56
58
|
|
|
57
59
|
## Formal Verification
|
|
58
60
|
|
|
59
|
-
We use the [C Bounded Model Checker (CBMC)](https://github.com/diffblue/cbmc) to prove absence of various classes of undefined behaviour in C, including out of bounds memory accesses and integer overflows. The proofs cover all C code in [mldsa/src/*](mldsa) and [mldsa/src/fips202/*](mldsa/src/fips202)
|
|
60
|
-
|
|
61
|
-
All AArch64 and x86_64 assembly
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
61
|
+
We use the [C Bounded Model Checker (CBMC)](https://github.com/diffblue/cbmc) to prove absence of various classes of undefined behaviour in C, including out of bounds memory accesses and integer overflows. The proofs cover all C code in [mldsa/src/*](mldsa) and [mldsa/src/fips202/*](mldsa/src/fips202), except for the Armv8.1-M backend and the debug code. See [proofs/cbmc](proofs/cbmc) for details.
|
|
62
|
+
|
|
63
|
+
All AArch64 and x86_64 assembly, and the RV32IM arithmetic backend, are
|
|
64
|
+
proved functionally correct and memory-safe at the object-code level using
|
|
65
|
+
[HOL-Light](https://hol-light.github.io/) and the
|
|
66
|
+
[s2n-bignum](https://github.com/awslabs/s2n-bignum) verification
|
|
67
|
+
infrastructure. All routines are additionally proved to have
|
|
68
|
+
secret-independent timing, with the rejection samplers as special cases. The
|
|
69
|
+
matrix sampler `rej_uniform` operates on public data only and is deliberately
|
|
70
|
+
variable-time. The secret-vector samplers `rej_uniform_eta{2,4}` are proved to
|
|
71
|
+
have secret-independent timing: their event trace depends only on the public
|
|
72
|
+
pointers and on which candidates are accepted or rejected, never on the
|
|
73
|
+
accepted coefficient values. That reject pattern is safe to leak, being
|
|
74
|
+
statistically independent of those values. See
|
|
75
|
+
[proofs/hol_light](proofs/hol_light) for details.
|
|
67
76
|
|
|
68
77
|
Finally, [proofs/isabelle](proofs/isabelle/compress) contains proofs in [Isabelle/HOL](https://isabelle.in.tum.de/) of the correctness of
|
|
69
78
|
different approaches for computing the scalar decomposition routines used in ML-DSA. Those are still experimental and do not yet operate
|
|
@@ -77,11 +86,14 @@ pointwise-multiplication assembly; see its [README](proofs/isabelle/neon_ntt/REA
|
|
|
77
86
|
|
|
78
87
|
All assembly in mldsa-native is constant-time in the sense that it is free of secret-dependent control flow, memory access,
|
|
79
88
|
and instructions that are commonly variable-time, thwarting most timing side channels. C code is hardened against compiler-introduced
|
|
80
|
-
timing side channels through suitable barriers and constant-time patterns.
|
|
89
|
+
timing side channels through suitable barriers and constant-time patterns. The C code assumes constant-time 32x32->32 and 32x32->64 multiplication,
|
|
90
|
+
which some targets do not provide, e.g., cores without a hardware multiplier or with early-terminating multiply instructions.
|
|
81
91
|
|
|
82
92
|
Absence of secret-dependent branches, memory-access patterns and variable-latency instructions is also tested using `valgrind`
|
|
83
93
|
with various combinations of compilers and compilation options.
|
|
84
94
|
|
|
95
|
+
**Stack zeroization.** mldsa-native zeroizes intermediate buffers before returning, but this does not eliminate leakage of secret data on the stack. If you need bullet-proof zeroization of the stack, you need to consider additional measures; see [API conventions](API-CONVENTIONS.md#secret-data-left-on-the-stack).
|
|
96
|
+
|
|
85
97
|
**Other attacks.** mldsa-native targets resistance against timing side-channels only. Other attack classes, such as power and electromagnetic side-channels, microarchitectural side-channels (e.g. speculative execution), or fault-injection attacks, are currently out of scope.
|
|
86
98
|
|
|
87
99
|
## Design
|
|
@@ -96,8 +108,11 @@ mldsa-native currently offers the following backends:
|
|
|
96
108
|
|
|
97
109
|
* Default portable C backend
|
|
98
110
|
* 64-bit Arm backend (using Neon)
|
|
99
|
-
* 64-bit Intel/AMD backend (using AVX2)
|
|
111
|
+
* 64-bit Intel/AMD backend (using AVX2; AVX-512 for FIPS-202)
|
|
100
112
|
* 32-bit Armv8.1-M backend (using Helium/MVE). This is still experimental and disabled by default.
|
|
113
|
+
* 32-bit RISC-V backend (RV32-IM, base integer + M-extension only). The
|
|
114
|
+
fast-multiplier profile is selected by default when native arithmetic is
|
|
115
|
+
enabled; a shift/add profile is also available.
|
|
101
116
|
|
|
102
117
|
If you'd like contribute new backends, please reach out!
|
|
103
118
|
|
|
@@ -1,160 +1,87 @@
|
|
|
1
1
|
[//]: # (SPDX-License-Identifier: CC-BY-4.0)
|
|
2
2
|
|
|
3
|
-
mldsa-native v2.
|
|
3
|
+
mldsa-native v2.1.0
|
|
4
4
|
===================
|
|
5
5
|
|
|
6
6
|
Release notes
|
|
7
7
|
-------------
|
|
8
8
|
|
|
9
|
-
v2.
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
9
|
+
mldsa-native v2.1.0 adds further backends, reduces RAM usage, and
|
|
10
|
+
strengthens the trust anchor for its verification artifacts.
|
|
11
|
+
|
|
12
|
+
See the [full change log](https://github.com/pq-code-package/mldsa-native/compare/v2.0.0...42e60d0f4d912306b436f5258c6cdc5aeed1b29e)
|
|
13
|
+
and the [v2.0.0 release notes](https://github.com/pq-code-package/mldsa-native/blob/v2.0.0/RELEASE.md).
|
|
14
|
+
|
|
15
|
+
Backends
|
|
16
|
+
--------
|
|
17
|
+
|
|
18
|
+
- **32-bit RISC-V.** A new ML-DSA arithmetic backend supports RV32IM.
|
|
19
|
+
Constant-time operation requires data-independent multiplication latency.
|
|
20
|
+
See the [RV32IM backend guide](dev/riscv32/README.md).
|
|
21
|
+
([#1119](https://github.com/pq-code-package/mldsa-native/pull/1119),
|
|
22
|
+
[#1426](https://github.com/pq-code-package/mldsa-native/pull/1426))
|
|
23
|
+
- **x86_64.** A new FIPS 202 backend accelerates Keccak on AVX-512 targets.
|
|
24
|
+
If a custom runtime check rejects AVX-512, the AVX-512 routines fall back
|
|
25
|
+
to C. If you require a portable build applying AVX-512, AVX2 or C backend
|
|
26
|
+
as applicable to the host, you currently need to write custom dispatch logic.
|
|
27
|
+
In CI benchmarks of optimized ML-DSA-87 builds on EC2 c7a, c7i, c8a,
|
|
28
|
+
and c8i, AVX-512 reduced cycle counts by 22–29% for key generation,
|
|
29
|
+
15–19% for signing, and 18–27% for verification. The gains vary by CPU.
|
|
30
|
+
([#1584](https://github.com/pq-code-package/mldsa-native/pull/1584))
|
|
31
|
+
- **AArch64.** The Neon backend has faster rejection sampling. Across
|
|
32
|
+
optimized ML-DSA-87 benchmarks on Graviton2 through Graviton5, the sampler
|
|
33
|
+
update cut cycle counts by 3.0–4.5% for key generation, 1.1–1.5% for
|
|
34
|
+
signing, and 2.2–3.3% for verification.
|
|
35
|
+
([#1582](https://github.com/pq-code-package/mldsa-native/pull/1582))
|
|
36
|
+
|
|
37
|
+
See the [CI benchmarks](https://pq-code-package.github.io/mldsa-native/dev/bench/)
|
|
38
|
+
for the full results.
|
|
39
|
+
|
|
40
|
+
RAM usage
|
|
28
41
|
---------
|
|
29
42
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
of
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
context string longer than 255 bytes). The previously existing codes keep their values, but callers matching on
|
|
72
|
-
`MLD_ERR_FAIL` must be updated; it is no longer externally observable.
|
|
73
|
-
([#1309](https://github.com/pq-code-package/mldsa-native/pull/1309))
|
|
74
|
-
- **Legacy header-time configuration removed.** The deprecated `MLD_CONFIG_API_*` macros
|
|
75
|
-
(`MLD_CONFIG_API_PARAMETER_SET`, `MLD_CONFIG_API_NAMESPACE_PREFIX`, `MLD_CONFIG_API_NO_SUPERCOP`,
|
|
76
|
-
`MLD_CONFIG_API_CONSTANTS_ONLY`, `MLD_CONFIG_API_QUALIFIER`) were removed in favour of configuring through the
|
|
77
|
-
[config file](mldsa/mldsa_native_config.h) (`MLD_CONFIG_PARAMETER_SET`, `MLD_CONFIG_NAMESPACE_PREFIX`,
|
|
78
|
-
`MLD_CONFIG_CONSTANTS_ONLY`, `MLD_CONFIG_EXTERNAL_API_QUALIFIER`). For multi-level builds, set
|
|
79
|
-
`MLD_CONFIG_MULTILEVEL_BUILD` and do not bake the 44/65/87 suffix into the namespace prefix; the security level is
|
|
80
|
-
now appended automatically. ([#1206](https://github.com/pq-code-package/mldsa-native/pull/1206),
|
|
81
|
-
[#1270](https://github.com/pq-code-package/mldsa-native/pull/1270))
|
|
82
|
-
- **FIPS-202 backend flags renamed to the `MLD_USE_NATIVE_*` convention.** Custom FIPS-202 backends must rename the
|
|
83
|
-
flags they define: `MLD_USE_FIPS202_X1_NATIVE` -> `MLD_USE_NATIVE_FIPS202_X1`, `MLD_USE_FIPS202_X4_NATIVE` ->
|
|
84
|
-
`MLD_USE_NATIVE_FIPS202_X4`, `MLD_USE_FIPS202_X4_XOR_BYTES_NATIVE` -> `MLD_USE_NATIVE_FIPS202_X4_XOR_BYTES`, and
|
|
85
|
-
`MLD_USE_FIPS202_X4_EXTRACT_BYTES_NATIVE` -> `MLD_USE_NATIVE_FIPS202_X4_EXTRACT_BYTES`. Default builds are
|
|
86
|
-
unaffected. ([#1207](https://github.com/pq-code-package/mldsa-native/pull/1207))
|
|
87
|
-
- **Capability enum values prefixed with the architecture.** `mld_sys_cap` values were renamed
|
|
88
|
-
(`MLD_SYS_CAP_AVX2` -> `MLD_SYS_CAP_X86_64_AVX2`, `MLD_SYS_CAP_SHA3` -> `MLD_SYS_CAP_AARCH64_SHA3`,
|
|
89
|
-
`MLD_SYS_CAP_MVE` -> `MLD_SYS_CAP_ARMV81M_MVE`). This affects integrators with custom native backends or a custom
|
|
90
|
-
capability-check function. ([#1208](https://github.com/pq-code-package/mldsa-native/pull/1208))
|
|
91
|
-
- **Minimum FIPS 204 signing-attempt bound raised from 814 to 821.** Builds that set
|
|
92
|
-
`MLD_CONFIG_MAX_SIGNING_ATTEMPTS` explicitly must now use a value of at least 821; 814 through 820 no longer compile.
|
|
93
|
-
The [FIPS 204 errata](https://csrc.nist.gov/files/pubs/fips/204/final/docs/fips-204-potential-updates.xlsx) revises
|
|
94
|
-
the Repetitions row of Table 1 to 4.36 / 5.14 / 3.91 and, with it, the minimum loop-iteration limit for
|
|
95
|
-
`ML-DSA.Sign_internal` in Table 3 from 814 to 821.
|
|
96
|
-
([#1349](https://github.com/pq-code-package/mldsa-native/pull/1349))
|
|
97
|
-
|
|
98
|
-
We hope these simplifications make integrations easier for the majority of consumers. Moving forward, APIs and
|
|
99
|
-
configuration options not marked as experimental are guaranteed to be stable until a new major version (`v3`) is
|
|
100
|
-
released; additional APIs and configuration options may be introduced at any time.
|
|
101
|
-
|
|
102
|
-
If the breaking changes above cause any issues for your application, please
|
|
103
|
-
[open a GitHub issue](https://github.com/pq-code-package/mldsa-native/issues). If your application could benefit from
|
|
104
|
-
additional APIs or configuration options, please open an issue as well.
|
|
105
|
-
|
|
106
|
-
What's New
|
|
107
|
-
----------
|
|
108
|
-
|
|
109
|
-
### Restartable and bounded signing for real-time systems
|
|
110
|
-
|
|
111
|
-
ML-DSA signing is a rejection-sampling loop: it draws a candidate signature and retries until one passes the
|
|
112
|
-
bounds checks. The number of attempts is not known in advance, so a single signing call has an *unbounded* worst-case
|
|
113
|
-
runtime.
|
|
114
|
-
For environments with strict timing requirements that is a problem: a signing call cannot be allowed to run for an
|
|
115
|
-
arbitrary number of iterations before returning control to the caller.
|
|
116
|
-
|
|
117
|
-
mldsa-native addresses this with three optional, independent **signing hooks** around the rejection-sampling loop,
|
|
118
|
-
enabled with `MLD_CONFIG_SIGN_HOOK_ATTEMPT`, `MLD_CONFIG_SIGN_HOOK_RESUME` and `MLD_CONFIG_SIGN_HOOK_FINISH`. The
|
|
119
|
-
attempt hook runs before each attempt and may **pause** the operation; signing then returns the new
|
|
120
|
-
`MLD_ERR_SIGNING_PAUSED` code instead of iterating further. At the start of the next call the resume hook is queried
|
|
121
|
-
for the attempt to restart from (the one the attempt hook recorded when it paused), so signing continues exactly where
|
|
122
|
-
it left off; the finish hook fires with the succeeding attempt once a signature is found. The split, resumed run
|
|
123
|
-
produces exactly the same signature as a single uninterrupted call.
|
|
124
|
-
|
|
125
|
-
To bound per-call runtime, the attempt hook pauses once a per-call budget is spent, and the caller re-invokes signing
|
|
126
|
-
in a loop until it completes.
|
|
127
|
-
|
|
128
|
-
For concurrent or interleaved signers, hold the resume state per caller by enabling `MLD_CONFIG_CONTEXT_PARAMETER`
|
|
129
|
-
instead of a global; each API function then forwards a context argument to the hooks. A complete example is in
|
|
130
|
-
[examples/restartable_sign](examples/restartable_sign).
|
|
131
|
-
([#1237](https://github.com/pq-code-package/mldsa-native/pull/1237))
|
|
132
|
-
|
|
133
|
-
This feature is experimental: its scope, configuration and hook signatures may change, including after v2.
|
|
134
|
-
We would love to hear your feedback on this feature.
|
|
135
|
-
|
|
136
|
-
### API and configuration
|
|
137
|
-
|
|
138
|
-
- **`MLD_SYS_AARCH64_FAST_SHA3`** opts non-Apple AArch64 cores with fast SHA3 instructions into the SHA3-instruction
|
|
139
|
-
path. ([#1254](https://github.com/pq-code-package/mldsa-native/pull/1254))
|
|
140
|
-
|
|
141
|
-
### Platforms and testing
|
|
142
|
-
|
|
143
|
-
- **Windows MSVC** test support (KAT, Wycheproof, allocation-failure and RNG-failure tests).
|
|
144
|
-
([#1247](https://github.com/pq-code-package/mldsa-native/pull/1247))
|
|
145
|
-
- **AVR baremetal / 16-bit** platform support. ([#1158](https://github.com/pq-code-package/mldsa-native/pull/1158))
|
|
146
|
-
- **Zephyr** hardware and QEMU test platforms, including NUCLEO-N657X0-Q.
|
|
147
|
-
([#1259](https://github.com/pq-code-package/mldsa-native/pull/1259),
|
|
148
|
-
[#1269](https://github.com/pq-code-package/mldsa-native/pull/1269))
|
|
149
|
-
- **ABI checker** for AArch64, x86_64 (SysV) and Armv8.1-M+MVE.
|
|
150
|
-
([#1195](https://github.com/pq-code-package/mldsa-native/pull/1195))
|
|
151
|
-
|
|
152
|
-
### Documentation
|
|
153
|
-
|
|
154
|
-
- **FIPS 204 references** annotated throughout the code and expanded in the documentation, mapping the implementation
|
|
155
|
-
to [the standard](https://csrc.nist.gov/pubs/fips/204/final).
|
|
156
|
-
- **[API-CONVENTIONS.md](API-CONVENTIONS.md)** documents the conventions shared by all public functions: return
|
|
157
|
-
values, pointer validity (all pointers are assumed valid and non-NULL, except a pointer paired with a length, which
|
|
158
|
-
may be NULL when that length is `0`), and the state of output buffers on error (left either unchanged or fully
|
|
159
|
-
zeroized, never holding partially computed data).
|
|
43
|
+
Key generation, public-key recovery, and signing use less RAM. The table
|
|
44
|
+
compares large allocations in low-memory builds (`MLD_CONFIG_REDUCE_RAM`)
|
|
45
|
+
between v2.0.0 and v2.1.0, in decimal kilobytes. liboqs now uses this mode
|
|
46
|
+
with `OQS_MEMOPT_BUILD`.
|
|
47
|
+
([#1410](https://github.com/pq-code-package/mldsa-native/pull/1410),
|
|
48
|
+
[#1345](https://github.com/pq-code-package/mldsa-native/pull/1345),
|
|
49
|
+
[#1529](https://github.com/pq-code-package/mldsa-native/pull/1529))
|
|
50
|
+
|
|
51
|
+
| Parameter set | Key generation without PCT | Public-key recovery | Signing |
|
|
52
|
+
| --- | ---: | ---: | ---: |
|
|
53
|
+
| ML-DSA-44 | 11.6 → 7.5 kB | 13.2 → 10.1 kB | 13.1 → 9.8 kB |
|
|
54
|
+
| ML-DSA-65 | 14.7 → 8.5 kB | 17.1 → 11.9 kB | 17.2 → 11.9 kB |
|
|
55
|
+
| ML-DSA-87 | 18.8 → 10.6 kB | 22.0 → 14.8 kB | 21.3 → 14.2 kB |
|
|
56
|
+
|
|
57
|
+
Total stack usage also includes other local allocations. See
|
|
58
|
+
[mldsa_native.h](mldsa/mldsa_native.h).
|
|
59
|
+
|
|
60
|
+
Trust
|
|
61
|
+
-----
|
|
62
|
+
|
|
63
|
+
With new proofs being primarily written by AI, the soundness of verification
|
|
64
|
+
is of increasing importance.
|
|
65
|
+
|
|
66
|
+
v2.1 introduces proof capture and replay using [HOLTrace](https://holtrace.cr.yp.to/)
|
|
67
|
+
to remove the need to review and trust HOL Light proof scripts. In particular, this
|
|
68
|
+
detects proof scripts that cheat by adding new axioms, bypassing the kernel, or using
|
|
69
|
+
non-standard definitions.
|
|
70
|
+
|
|
71
|
+
See [hol_trace/README.md](proofs/hol_light/hol_trace/README.md)
|
|
72
|
+
and [SOUNDNESS.md](SOUNDNESS.md) for details.
|
|
73
|
+
([#1551](https://github.com/pq-code-package/mldsa-native/pull/1551))
|
|
74
|
+
|
|
75
|
+
CBMC now checks 211 of 218 64-bit proof harnesses with at least two distinct
|
|
76
|
+
solvers. This reduces reliance on any single solver. See
|
|
77
|
+
[SOUNDNESS.md](SOUNDNESS.md#cbmc-proofs-discharged-by-a-single-solver)
|
|
78
|
+
for the risks of single-solver proofs.
|
|
79
|
+
([#1423](https://github.com/pq-code-package/mldsa-native/pull/1423),
|
|
80
|
+
[issue #1527](https://github.com/pq-code-package/mldsa-native/issues/1527))
|
|
81
|
+
|
|
82
|
+
Bug fixes
|
|
83
|
+
---------
|
|
160
84
|
|
|
85
|
+
- **AArch64 alignment.** Fixed alignment faults in the rejection samplers on
|
|
86
|
+
targets that require aligned accesses.
|
|
87
|
+
([#1582](https://github.com/pq-code-package/mldsa-native/pull/1582))
|