pq_crypto 0.6.8 → 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 +11 -0
- data/README.md +1 -3
- 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/version.rb +1 -1
- data/script/vendor_libs.rb +6 -6
- metadata +36 -1
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) The mlkem-native project authors
|
|
3
|
+
* SPDX-License-Identifier: Apache-2.0 OR ISC OR MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/* References
|
|
7
|
+
* ==========
|
|
8
|
+
*
|
|
9
|
+
* - [FIPS203]
|
|
10
|
+
* FIPS 203 Module-Lattice-Based Key-Encapsulation Mechanism Standard
|
|
11
|
+
* National Institute of Standards and Technology
|
|
12
|
+
* https://csrc.nist.gov/pubs/fips/203/final
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
/*yaml
|
|
16
|
+
Name: poly_decompress_d10_aarch64_asm
|
|
17
|
+
Description: Decompression of a polynomial from 10 bits per coefficient
|
|
18
|
+
Signature: void mlk_poly_decompress_d10_aarch64_asm(int16_t r[256], const uint8_t a[320], const uint8_t table[80])
|
|
19
|
+
ABI:
|
|
20
|
+
Architecture: aarch64
|
|
21
|
+
CallingConvention: AAPCS64
|
|
22
|
+
Features: [NEON]
|
|
23
|
+
x0:
|
|
24
|
+
type: buffer
|
|
25
|
+
size_bytes: 512
|
|
26
|
+
permissions: write-only
|
|
27
|
+
c_parameter: int16_t r[256]
|
|
28
|
+
description: Output polynomial
|
|
29
|
+
x1:
|
|
30
|
+
type: buffer
|
|
31
|
+
size_bytes: 320
|
|
32
|
+
permissions: read-only
|
|
33
|
+
c_parameter: const uint8_t a[320]
|
|
34
|
+
description: Input compressed polynomial
|
|
35
|
+
x2:
|
|
36
|
+
type: buffer
|
|
37
|
+
size_bytes: 80
|
|
38
|
+
permissions: read-only
|
|
39
|
+
c_parameter: const uint8_t table[80]
|
|
40
|
+
description: Constants (index, shift, mask and multiplier vectors)
|
|
41
|
+
Stack:
|
|
42
|
+
bytes: 0
|
|
43
|
+
*/
|
|
44
|
+
|
|
45
|
+
#include "../../../common.h"
|
|
46
|
+
#if defined(MLK_SYS_AARCH64_NEON) && \
|
|
47
|
+
defined(MLK_ARITH_BACKEND_AARCH64) && \
|
|
48
|
+
!defined(MLK_CONFIG_MULTILEVEL_NO_SHARED) && \
|
|
49
|
+
!defined(MLK_CONFIG_NO_DECAPS_API) && \
|
|
50
|
+
(defined(MLK_CONFIG_MULTILEVEL_WITH_SHARED) || MLKEM_K == 2 || MLKEM_K == 3)
|
|
51
|
+
|
|
52
|
+
/*
|
|
53
|
+
* WARNING: This file is auto-derived from the mlkem-native source file
|
|
54
|
+
* dev/aarch64_opt/src/mlkem_poly_decompress_d10_aarch64_asm.S using scripts/simpasm. Do not modify it directly.
|
|
55
|
+
*/
|
|
56
|
+
|
|
57
|
+
.text
|
|
58
|
+
.balign 4
|
|
59
|
+
.global MLK_ASM_NAMESPACE(poly_decompress_d10_aarch64_asm)
|
|
60
|
+
MLK_ASM_FN_SYMBOL(poly_decompress_d10_aarch64_asm)
|
|
61
|
+
|
|
62
|
+
.cfi_startproc
|
|
63
|
+
ld1 { v16.16b, v17.16b, v18.16b, v19.16b }, [x2], #64
|
|
64
|
+
ld1 { v20.16b }, [x2]
|
|
65
|
+
mov x3, #0x8 // =8
|
|
66
|
+
|
|
67
|
+
Lmlk_poly_decompress_d10_loop_start:
|
|
68
|
+
add x4, x1, #0xa
|
|
69
|
+
add x5, x1, #0x14
|
|
70
|
+
add x6, x1, #0x18
|
|
71
|
+
ld1 { v0.16b }, [x1]
|
|
72
|
+
ld1 { v1.16b }, [x4]
|
|
73
|
+
ld1 { v2.16b }, [x5]
|
|
74
|
+
ld1 { v3.16b }, [x6]
|
|
75
|
+
add x1, x1, #0x28
|
|
76
|
+
tbl v4.16b, { v0.16b }, v16.16b
|
|
77
|
+
ushl v4.8h, v4.8h, v18.8h
|
|
78
|
+
and v4.16b, v4.16b, v19.16b
|
|
79
|
+
tbl v5.16b, { v1.16b }, v16.16b
|
|
80
|
+
ushl v5.8h, v5.8h, v18.8h
|
|
81
|
+
and v5.16b, v5.16b, v19.16b
|
|
82
|
+
tbl v6.16b, { v2.16b }, v16.16b
|
|
83
|
+
ushl v6.8h, v6.8h, v18.8h
|
|
84
|
+
and v6.16b, v6.16b, v19.16b
|
|
85
|
+
tbl v7.16b, { v3.16b }, v17.16b
|
|
86
|
+
ushl v7.8h, v7.8h, v18.8h
|
|
87
|
+
and v7.16b, v7.16b, v19.16b
|
|
88
|
+
sqrdmulh v4.8h, v4.8h, v20.8h
|
|
89
|
+
sqrdmulh v5.8h, v5.8h, v20.8h
|
|
90
|
+
sqrdmulh v6.8h, v6.8h, v20.8h
|
|
91
|
+
sqrdmulh v7.8h, v7.8h, v20.8h
|
|
92
|
+
stp q4, q5, [x0], #0x40
|
|
93
|
+
stp q6, q7, [x0, #-0x20]
|
|
94
|
+
subs x3, x3, #0x1
|
|
95
|
+
cbnz x3, Lmlk_poly_decompress_d10_loop_start
|
|
96
|
+
ret
|
|
97
|
+
.cfi_endproc
|
|
98
|
+
|
|
99
|
+
MLK_ASM_FN_SIZE(poly_decompress_d10_aarch64_asm)
|
|
100
|
+
|
|
101
|
+
#endif /* MLK_SYS_AARCH64_NEON && MLK_ARITH_BACKEND_AARCH64 && \
|
|
102
|
+
!MLK_CONFIG_MULTILEVEL_NO_SHARED && !MLK_CONFIG_NO_DECAPS_API && \
|
|
103
|
+
(MLK_CONFIG_MULTILEVEL_WITH_SHARED || MLKEM_K == 2 || MLKEM_K == 3) \
|
|
104
|
+
*/
|
|
105
|
+
|
|
106
|
+
#if defined(__ELF__)
|
|
107
|
+
.section .note.GNU-stack,"",%progbits
|
|
108
|
+
#endif
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) The mlkem-native project authors
|
|
3
|
+
* SPDX-License-Identifier: Apache-2.0 OR ISC OR MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/* References
|
|
7
|
+
* ==========
|
|
8
|
+
*
|
|
9
|
+
* - [FIPS203]
|
|
10
|
+
* FIPS 203 Module-Lattice-Based Key-Encapsulation Mechanism Standard
|
|
11
|
+
* National Institute of Standards and Technology
|
|
12
|
+
* https://csrc.nist.gov/pubs/fips/203/final
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
/*yaml
|
|
16
|
+
Name: poly_decompress_d11_aarch64_asm
|
|
17
|
+
Description: Decompression of a polynomial from 11 bits per coefficient
|
|
18
|
+
Signature: void mlk_poly_decompress_d11_aarch64_asm(int16_t r[256], const uint8_t a[352], const uint8_t table[112])
|
|
19
|
+
ABI:
|
|
20
|
+
Architecture: aarch64
|
|
21
|
+
CallingConvention: AAPCS64
|
|
22
|
+
Features: [NEON]
|
|
23
|
+
x0:
|
|
24
|
+
type: buffer
|
|
25
|
+
size_bytes: 512
|
|
26
|
+
permissions: write-only
|
|
27
|
+
c_parameter: int16_t r[256]
|
|
28
|
+
description: Output polynomial
|
|
29
|
+
x1:
|
|
30
|
+
type: buffer
|
|
31
|
+
size_bytes: 352
|
|
32
|
+
permissions: read-only
|
|
33
|
+
c_parameter: const uint8_t a[352]
|
|
34
|
+
description: Input compressed polynomial
|
|
35
|
+
x2:
|
|
36
|
+
type: buffer
|
|
37
|
+
size_bytes: 112
|
|
38
|
+
permissions: read-only
|
|
39
|
+
c_parameter: const uint8_t table[112]
|
|
40
|
+
description: Constants (index, shift, mask and multiplier vectors)
|
|
41
|
+
Stack:
|
|
42
|
+
bytes: 0
|
|
43
|
+
*/
|
|
44
|
+
|
|
45
|
+
#include "../../../common.h"
|
|
46
|
+
#if defined(MLK_SYS_AARCH64_NEON) && \
|
|
47
|
+
defined(MLK_ARITH_BACKEND_AARCH64) && \
|
|
48
|
+
!defined(MLK_CONFIG_MULTILEVEL_NO_SHARED) && \
|
|
49
|
+
!defined(MLK_CONFIG_NO_DECAPS_API) && \
|
|
50
|
+
(defined(MLK_CONFIG_MULTILEVEL_WITH_SHARED) || MLKEM_K == 4)
|
|
51
|
+
|
|
52
|
+
/*
|
|
53
|
+
* WARNING: This file is auto-derived from the mlkem-native source file
|
|
54
|
+
* dev/aarch64_opt/src/mlkem_poly_decompress_d11_aarch64_asm.S using scripts/simpasm. Do not modify it directly.
|
|
55
|
+
*/
|
|
56
|
+
|
|
57
|
+
.text
|
|
58
|
+
.balign 4
|
|
59
|
+
.global MLK_ASM_NAMESPACE(poly_decompress_d11_aarch64_asm)
|
|
60
|
+
MLK_ASM_FN_SYMBOL(poly_decompress_d11_aarch64_asm)
|
|
61
|
+
|
|
62
|
+
.cfi_startproc
|
|
63
|
+
ld1 { v24.16b, v25.16b, v26.16b, v27.16b }, [x2], #64
|
|
64
|
+
ld1 { v28.16b, v29.16b }, [x2], #32
|
|
65
|
+
ld1 { v30.16b }, [x2]
|
|
66
|
+
mov x3, #0x8 // =8
|
|
67
|
+
|
|
68
|
+
Lmlk_poly_decompress_d11_loop_start:
|
|
69
|
+
add x4, x1, #0xb
|
|
70
|
+
add x5, x1, #0x16
|
|
71
|
+
add x6, x1, #0x1c
|
|
72
|
+
ld1 { v0.16b }, [x1]
|
|
73
|
+
ld1 { v1.16b }, [x4]
|
|
74
|
+
ld1 { v2.16b }, [x5]
|
|
75
|
+
ld1 { v3.16b }, [x6]
|
|
76
|
+
add x1, x1, #0x2c
|
|
77
|
+
tbl v4.16b, { v0.16b }, v24.16b
|
|
78
|
+
tbl v16.16b, { v0.16b }, v25.16b
|
|
79
|
+
ushl v4.8h, v4.8h, v28.8h
|
|
80
|
+
sli v4.8h, v16.8h, #0xc
|
|
81
|
+
and v4.16b, v4.16b, v29.16b
|
|
82
|
+
tbl v5.16b, { v1.16b }, v24.16b
|
|
83
|
+
tbl v17.16b, { v1.16b }, v25.16b
|
|
84
|
+
ushl v5.8h, v5.8h, v28.8h
|
|
85
|
+
sli v5.8h, v17.8h, #0xc
|
|
86
|
+
and v5.16b, v5.16b, v29.16b
|
|
87
|
+
tbl v6.16b, { v2.16b }, v24.16b
|
|
88
|
+
tbl v18.16b, { v2.16b }, v25.16b
|
|
89
|
+
ushl v6.8h, v6.8h, v28.8h
|
|
90
|
+
sli v6.8h, v18.8h, #0xc
|
|
91
|
+
and v6.16b, v6.16b, v29.16b
|
|
92
|
+
tbl v7.16b, { v3.16b }, v26.16b
|
|
93
|
+
tbl v19.16b, { v3.16b }, v27.16b
|
|
94
|
+
ushl v7.8h, v7.8h, v28.8h
|
|
95
|
+
sli v7.8h, v19.8h, #0xc
|
|
96
|
+
and v7.16b, v7.16b, v29.16b
|
|
97
|
+
sqrdmulh v4.8h, v4.8h, v30.8h
|
|
98
|
+
sqrdmulh v5.8h, v5.8h, v30.8h
|
|
99
|
+
sqrdmulh v6.8h, v6.8h, v30.8h
|
|
100
|
+
sqrdmulh v7.8h, v7.8h, v30.8h
|
|
101
|
+
stp q4, q5, [x0], #0x40
|
|
102
|
+
stp q6, q7, [x0, #-0x20]
|
|
103
|
+
subs x3, x3, #0x1
|
|
104
|
+
cbnz x3, Lmlk_poly_decompress_d11_loop_start
|
|
105
|
+
ret
|
|
106
|
+
.cfi_endproc
|
|
107
|
+
|
|
108
|
+
MLK_ASM_FN_SIZE(poly_decompress_d11_aarch64_asm)
|
|
109
|
+
|
|
110
|
+
#endif /* MLK_SYS_AARCH64_NEON && MLK_ARITH_BACKEND_AARCH64 && \
|
|
111
|
+
!MLK_CONFIG_MULTILEVEL_NO_SHARED && !MLK_CONFIG_NO_DECAPS_API && \
|
|
112
|
+
(MLK_CONFIG_MULTILEVEL_WITH_SHARED || MLKEM_K == 4) */
|
|
113
|
+
|
|
114
|
+
#if defined(__ELF__)
|
|
115
|
+
.section .note.GNU-stack,"",%progbits
|
|
116
|
+
#endif
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) The mlkem-native project authors
|
|
3
|
+
* SPDX-License-Identifier: Apache-2.0 OR ISC OR MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/* References
|
|
7
|
+
* ==========
|
|
8
|
+
*
|
|
9
|
+
* - [FIPS203]
|
|
10
|
+
* FIPS 203 Module-Lattice-Based Key-Encapsulation Mechanism Standard
|
|
11
|
+
* National Institute of Standards and Technology
|
|
12
|
+
* https://csrc.nist.gov/pubs/fips/203/final
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
/*yaml
|
|
16
|
+
Name: poly_decompress_d4_aarch64_asm
|
|
17
|
+
Description: Decompression of a polynomial from 4 bits per coefficient
|
|
18
|
+
Signature: void mlk_poly_decompress_d4_aarch64_asm(int16_t r[256], const uint8_t a[128], const uint8_t table[32])
|
|
19
|
+
ABI:
|
|
20
|
+
Architecture: aarch64
|
|
21
|
+
CallingConvention: AAPCS64
|
|
22
|
+
Features: [NEON]
|
|
23
|
+
x0:
|
|
24
|
+
type: buffer
|
|
25
|
+
size_bytes: 512
|
|
26
|
+
permissions: write-only
|
|
27
|
+
c_parameter: int16_t r[256]
|
|
28
|
+
description: Output polynomial
|
|
29
|
+
x1:
|
|
30
|
+
type: buffer
|
|
31
|
+
size_bytes: 128
|
|
32
|
+
permissions: read-only
|
|
33
|
+
c_parameter: const uint8_t a[128]
|
|
34
|
+
description: Input compressed polynomial
|
|
35
|
+
x2:
|
|
36
|
+
type: buffer
|
|
37
|
+
size_bytes: 32
|
|
38
|
+
permissions: read-only
|
|
39
|
+
c_parameter: const uint8_t table[32]
|
|
40
|
+
description: Lookup table for Decompress_4
|
|
41
|
+
Stack:
|
|
42
|
+
bytes: 0
|
|
43
|
+
*/
|
|
44
|
+
|
|
45
|
+
#include "../../../common.h"
|
|
46
|
+
#if defined(MLK_SYS_AARCH64_NEON) && \
|
|
47
|
+
defined(MLK_ARITH_BACKEND_AARCH64) && \
|
|
48
|
+
!defined(MLK_CONFIG_MULTILEVEL_NO_SHARED) && \
|
|
49
|
+
!defined(MLK_CONFIG_NO_DECAPS_API) && \
|
|
50
|
+
(defined(MLK_CONFIG_MULTILEVEL_WITH_SHARED) || MLKEM_K == 2 || MLKEM_K == 3)
|
|
51
|
+
|
|
52
|
+
/*
|
|
53
|
+
* WARNING: This file is auto-derived from the mlkem-native source file
|
|
54
|
+
* dev/aarch64_opt/src/mlkem_poly_decompress_d4_aarch64_asm.S using scripts/simpasm. Do not modify it directly.
|
|
55
|
+
*/
|
|
56
|
+
|
|
57
|
+
.text
|
|
58
|
+
.balign 4
|
|
59
|
+
.global MLK_ASM_NAMESPACE(poly_decompress_d4_aarch64_asm)
|
|
60
|
+
MLK_ASM_FN_SYMBOL(poly_decompress_d4_aarch64_asm)
|
|
61
|
+
|
|
62
|
+
.cfi_startproc
|
|
63
|
+
ld1 { v17.16b, v18.16b }, [x2]
|
|
64
|
+
movi v19.16b, #0xf
|
|
65
|
+
mov x3, #0x8 // =8
|
|
66
|
+
|
|
67
|
+
Lmlk_poly_decompress_d4_loop_start:
|
|
68
|
+
ld1 { v0.16b }, [x1], #16
|
|
69
|
+
and v1.16b, v0.16b, v19.16b
|
|
70
|
+
ushr v2.16b, v0.16b, #0x4
|
|
71
|
+
zip1 v3.16b, v1.16b, v2.16b
|
|
72
|
+
zip2 v16.16b, v1.16b, v2.16b
|
|
73
|
+
tbl v4.16b, { v17.16b }, v3.16b
|
|
74
|
+
tbl v5.16b, { v18.16b }, v3.16b
|
|
75
|
+
tbl v6.16b, { v17.16b }, v16.16b
|
|
76
|
+
tbl v7.16b, { v18.16b }, v16.16b
|
|
77
|
+
st2 { v4.16b, v5.16b }, [x0], #32
|
|
78
|
+
st2 { v6.16b, v7.16b }, [x0], #32
|
|
79
|
+
subs x3, x3, #0x1
|
|
80
|
+
cbnz x3, Lmlk_poly_decompress_d4_loop_start
|
|
81
|
+
ret
|
|
82
|
+
.cfi_endproc
|
|
83
|
+
|
|
84
|
+
MLK_ASM_FN_SIZE(poly_decompress_d4_aarch64_asm)
|
|
85
|
+
|
|
86
|
+
#endif /* MLK_SYS_AARCH64_NEON && MLK_ARITH_BACKEND_AARCH64 && \
|
|
87
|
+
!MLK_CONFIG_MULTILEVEL_NO_SHARED && !MLK_CONFIG_NO_DECAPS_API && \
|
|
88
|
+
(MLK_CONFIG_MULTILEVEL_WITH_SHARED || MLKEM_K == 2 || MLKEM_K == 3) \
|
|
89
|
+
*/
|
|
90
|
+
|
|
91
|
+
#if defined(__ELF__)
|
|
92
|
+
.section .note.GNU-stack,"",%progbits
|
|
93
|
+
#endif
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) The mlkem-native project authors
|
|
3
|
+
* SPDX-License-Identifier: Apache-2.0 OR ISC OR MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/* References
|
|
7
|
+
* ==========
|
|
8
|
+
*
|
|
9
|
+
* - [FIPS203]
|
|
10
|
+
* FIPS 203 Module-Lattice-Based Key-Encapsulation Mechanism Standard
|
|
11
|
+
* National Institute of Standards and Technology
|
|
12
|
+
* https://csrc.nist.gov/pubs/fips/203/final
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
/*yaml
|
|
16
|
+
Name: poly_decompress_d5_aarch64_asm
|
|
17
|
+
Description: Decompression of a polynomial from 5 bits per coefficient
|
|
18
|
+
Signature: void mlk_poly_decompress_d5_aarch64_asm(int16_t r[256], const uint8_t a[160], const uint8_t table[112])
|
|
19
|
+
ABI:
|
|
20
|
+
Architecture: aarch64
|
|
21
|
+
CallingConvention: AAPCS64
|
|
22
|
+
Features: [NEON]
|
|
23
|
+
x0:
|
|
24
|
+
type: buffer
|
|
25
|
+
size_bytes: 512
|
|
26
|
+
permissions: write-only
|
|
27
|
+
c_parameter: int16_t r[256]
|
|
28
|
+
description: Output polynomial
|
|
29
|
+
x1:
|
|
30
|
+
type: buffer
|
|
31
|
+
size_bytes: 160
|
|
32
|
+
permissions: read-only
|
|
33
|
+
c_parameter: const uint8_t a[160]
|
|
34
|
+
description: Input compressed polynomial
|
|
35
|
+
x2:
|
|
36
|
+
type: buffer
|
|
37
|
+
size_bytes: 112
|
|
38
|
+
permissions: read-only
|
|
39
|
+
c_parameter: const uint8_t table[112]
|
|
40
|
+
description: Constants (index, shift, mask and multiplier vectors)
|
|
41
|
+
Stack:
|
|
42
|
+
bytes: 0
|
|
43
|
+
*/
|
|
44
|
+
|
|
45
|
+
#include "../../../common.h"
|
|
46
|
+
#if defined(MLK_SYS_AARCH64_NEON) && \
|
|
47
|
+
defined(MLK_ARITH_BACKEND_AARCH64) && \
|
|
48
|
+
!defined(MLK_CONFIG_MULTILEVEL_NO_SHARED) && \
|
|
49
|
+
!defined(MLK_CONFIG_NO_DECAPS_API) && \
|
|
50
|
+
(defined(MLK_CONFIG_MULTILEVEL_WITH_SHARED) || MLKEM_K == 4)
|
|
51
|
+
|
|
52
|
+
/*
|
|
53
|
+
* WARNING: This file is auto-derived from the mlkem-native source file
|
|
54
|
+
* dev/aarch64_opt/src/mlkem_poly_decompress_d5_aarch64_asm.S using scripts/simpasm. Do not modify it directly.
|
|
55
|
+
*/
|
|
56
|
+
|
|
57
|
+
.text
|
|
58
|
+
.balign 4
|
|
59
|
+
.global MLK_ASM_NAMESPACE(poly_decompress_d5_aarch64_asm)
|
|
60
|
+
MLK_ASM_FN_SYMBOL(poly_decompress_d5_aarch64_asm)
|
|
61
|
+
|
|
62
|
+
.cfi_startproc
|
|
63
|
+
ld1 { v16.16b, v17.16b, v18.16b, v19.16b }, [x2], #64
|
|
64
|
+
ld1 { v20.16b, v21.16b }, [x2], #32
|
|
65
|
+
ld1 { v22.16b }, [x2]
|
|
66
|
+
mov x3, #0x8 // =8
|
|
67
|
+
|
|
68
|
+
Lmlk_poly_decompress_d5_loop_start:
|
|
69
|
+
add x4, x1, #0x4
|
|
70
|
+
ld1 { v0.16b }, [x1]
|
|
71
|
+
ld1 { v1.16b }, [x4]
|
|
72
|
+
add x1, x1, #0x14
|
|
73
|
+
tbl v2.16b, { v0.16b }, v16.16b
|
|
74
|
+
ushl v2.8h, v2.8h, v20.8h
|
|
75
|
+
and v2.16b, v2.16b, v21.16b
|
|
76
|
+
tbl v3.16b, { v0.16b }, v17.16b
|
|
77
|
+
ushl v3.8h, v3.8h, v20.8h
|
|
78
|
+
and v3.16b, v3.16b, v21.16b
|
|
79
|
+
tbl v4.16b, { v0.16b }, v18.16b
|
|
80
|
+
ushl v4.8h, v4.8h, v20.8h
|
|
81
|
+
and v4.16b, v4.16b, v21.16b
|
|
82
|
+
tbl v5.16b, { v1.16b }, v19.16b
|
|
83
|
+
ushl v5.8h, v5.8h, v20.8h
|
|
84
|
+
and v5.16b, v5.16b, v21.16b
|
|
85
|
+
sqrdmulh v2.8h, v2.8h, v22.8h
|
|
86
|
+
sqrdmulh v3.8h, v3.8h, v22.8h
|
|
87
|
+
sqrdmulh v4.8h, v4.8h, v22.8h
|
|
88
|
+
sqrdmulh v5.8h, v5.8h, v22.8h
|
|
89
|
+
stp q2, q3, [x0], #0x40
|
|
90
|
+
stp q4, q5, [x0, #-0x20]
|
|
91
|
+
subs x3, x3, #0x1
|
|
92
|
+
cbnz x3, Lmlk_poly_decompress_d5_loop_start
|
|
93
|
+
ret
|
|
94
|
+
.cfi_endproc
|
|
95
|
+
|
|
96
|
+
MLK_ASM_FN_SIZE(poly_decompress_d5_aarch64_asm)
|
|
97
|
+
|
|
98
|
+
#endif /* MLK_SYS_AARCH64_NEON && MLK_ARITH_BACKEND_AARCH64 && \
|
|
99
|
+
!MLK_CONFIG_MULTILEVEL_NO_SHARED && !MLK_CONFIG_NO_DECAPS_API && \
|
|
100
|
+
(MLK_CONFIG_MULTILEVEL_WITH_SHARED || MLKEM_K == 4) */
|
|
101
|
+
|
|
102
|
+
#if defined(__ELF__)
|
|
103
|
+
.section .note.GNU-stack,"",%progbits
|
|
104
|
+
#endif
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) The mlkem-native project authors
|
|
3
|
+
* SPDX-License-Identifier: Apache-2.0 OR ISC OR MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/* References
|
|
7
|
+
* ==========
|
|
8
|
+
*
|
|
9
|
+
* - [FIPS203]
|
|
10
|
+
* FIPS 203 Module-Lattice-Based Key-Encapsulation Mechanism Standard
|
|
11
|
+
* National Institute of Standards and Technology
|
|
12
|
+
* https://csrc.nist.gov/pubs/fips/203/final
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
/*yaml
|
|
16
|
+
Name: poly_frombytes_aarch64_asm
|
|
17
|
+
Description: Convert byte representation to polynomial
|
|
18
|
+
Signature: void mlk_poly_frombytes_aarch64_asm(int16_t r[256], const uint8_t a[384])
|
|
19
|
+
ABI:
|
|
20
|
+
Architecture: aarch64
|
|
21
|
+
CallingConvention: AAPCS64
|
|
22
|
+
Features: [NEON]
|
|
23
|
+
x0:
|
|
24
|
+
type: buffer
|
|
25
|
+
size_bytes: 512
|
|
26
|
+
permissions: write-only
|
|
27
|
+
c_parameter: int16_t r[256]
|
|
28
|
+
description: Output polynomial
|
|
29
|
+
x1:
|
|
30
|
+
type: buffer
|
|
31
|
+
size_bytes: 384
|
|
32
|
+
permissions: read-only
|
|
33
|
+
c_parameter: const uint8_t a[384]
|
|
34
|
+
description: Input byte array
|
|
35
|
+
Stack:
|
|
36
|
+
bytes: 0
|
|
37
|
+
*/
|
|
38
|
+
|
|
39
|
+
#include "../../../common.h"
|
|
40
|
+
#if defined(MLK_SYS_AARCH64_NEON) && \
|
|
41
|
+
defined(MLK_ARITH_BACKEND_AARCH64) && \
|
|
42
|
+
!defined(MLK_CONFIG_MULTILEVEL_NO_SHARED) && \
|
|
43
|
+
(!defined(MLK_CONFIG_NO_ENCAPS_API) || \
|
|
44
|
+
!defined(MLK_CONFIG_NO_DECAPS_API))
|
|
45
|
+
|
|
46
|
+
/*
|
|
47
|
+
* WARNING: This file is auto-derived from the mlkem-native source file
|
|
48
|
+
* dev/aarch64_opt/src/mlkem_poly_frombytes_aarch64_asm.S using scripts/simpasm. Do not modify it directly.
|
|
49
|
+
*/
|
|
50
|
+
|
|
51
|
+
.text
|
|
52
|
+
.balign 4
|
|
53
|
+
.global MLK_ASM_NAMESPACE(poly_frombytes_aarch64_asm)
|
|
54
|
+
MLK_ASM_FN_SYMBOL(poly_frombytes_aarch64_asm)
|
|
55
|
+
|
|
56
|
+
.cfi_startproc
|
|
57
|
+
movi v16.16b, #0xf
|
|
58
|
+
mov x2, #0x8 // =8
|
|
59
|
+
|
|
60
|
+
Lmlk_poly_frombytes_loop_start:
|
|
61
|
+
ld3 { v0.16b, v1.16b, v2.16b }, [x1], #48
|
|
62
|
+
and v3.16b, v1.16b, v16.16b
|
|
63
|
+
zip1 v4.16b, v0.16b, v3.16b
|
|
64
|
+
zip2 v6.16b, v0.16b, v3.16b
|
|
65
|
+
zip1 v5.16b, v1.16b, v2.16b
|
|
66
|
+
zip2 v7.16b, v1.16b, v2.16b
|
|
67
|
+
ushr v5.8h, v5.8h, #0x4
|
|
68
|
+
ushr v7.8h, v7.8h, #0x4
|
|
69
|
+
st2 { v4.8h, v5.8h }, [x0], #32
|
|
70
|
+
st2 { v6.8h, v7.8h }, [x0], #32
|
|
71
|
+
subs x2, x2, #0x1
|
|
72
|
+
cbnz x2, Lmlk_poly_frombytes_loop_start
|
|
73
|
+
ret
|
|
74
|
+
.cfi_endproc
|
|
75
|
+
|
|
76
|
+
MLK_ASM_FN_SIZE(poly_frombytes_aarch64_asm)
|
|
77
|
+
|
|
78
|
+
#endif /* MLK_SYS_AARCH64_NEON && MLK_ARITH_BACKEND_AARCH64 && \
|
|
79
|
+
!MLK_CONFIG_MULTILEVEL_NO_SHARED && (!MLK_CONFIG_NO_ENCAPS_API || \
|
|
80
|
+
!MLK_CONFIG_NO_DECAPS_API) */
|
|
81
|
+
|
|
82
|
+
#if defined(__ELF__)
|
|
83
|
+
.section .note.GNU-stack,"",%progbits
|
|
84
|
+
#endif
|
|
@@ -40,7 +40,8 @@
|
|
|
40
40
|
*/
|
|
41
41
|
|
|
42
42
|
#include "../../../common.h"
|
|
43
|
-
#if defined(
|
|
43
|
+
#if defined(MLK_SYS_AARCH64_NEON) && \
|
|
44
|
+
defined(MLK_ARITH_BACKEND_AARCH64) && !defined(MLK_CONFIG_MULTILEVEL_NO_SHARED)
|
|
44
45
|
|
|
45
46
|
/*
|
|
46
47
|
* WARNING: This file is auto-derived from the mlkem-native source file
|
|
@@ -123,7 +124,8 @@ Lmlk_poly_mulcache_compute_loop_start:
|
|
|
123
124
|
|
|
124
125
|
MLK_ASM_FN_SIZE(poly_mulcache_compute_aarch64_asm)
|
|
125
126
|
|
|
126
|
-
#endif /* MLK_ARITH_BACKEND_AARCH64 &&
|
|
127
|
+
#endif /* MLK_SYS_AARCH64_NEON && MLK_ARITH_BACKEND_AARCH64 && \
|
|
128
|
+
!MLK_CONFIG_MULTILEVEL_NO_SHARED */
|
|
127
129
|
|
|
128
130
|
#if defined(__ELF__)
|
|
129
131
|
.section .note.GNU-stack,"",%progbits
|
data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/mlkem_poly_reduce_aarch64_asm.S
CHANGED
|
@@ -22,7 +22,8 @@
|
|
|
22
22
|
*/
|
|
23
23
|
|
|
24
24
|
#include "../../../common.h"
|
|
25
|
-
#if defined(
|
|
25
|
+
#if defined(MLK_SYS_AARCH64_NEON) && \
|
|
26
|
+
defined(MLK_ARITH_BACKEND_AARCH64) && !defined(MLK_CONFIG_MULTILEVEL_NO_SHARED)
|
|
26
27
|
|
|
27
28
|
/*
|
|
28
29
|
* WARNING: This file is auto-derived from the mlkem-native source file
|
|
@@ -146,7 +147,8 @@ Lmlk_poly_reduce_loop_start:
|
|
|
146
147
|
|
|
147
148
|
MLK_ASM_FN_SIZE(poly_reduce_aarch64_asm)
|
|
148
149
|
|
|
149
|
-
#endif /* MLK_ARITH_BACKEND_AARCH64 &&
|
|
150
|
+
#endif /* MLK_SYS_AARCH64_NEON && MLK_ARITH_BACKEND_AARCH64 && \
|
|
151
|
+
!MLK_CONFIG_MULTILEVEL_NO_SHARED */
|
|
150
152
|
|
|
151
153
|
#if defined(__ELF__)
|
|
152
154
|
.section .note.GNU-stack,"",%progbits
|
data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/mlkem_poly_tobytes_aarch64_asm.S
CHANGED
|
@@ -28,7 +28,8 @@
|
|
|
28
28
|
*/
|
|
29
29
|
|
|
30
30
|
#include "../../../common.h"
|
|
31
|
-
#if defined(
|
|
31
|
+
#if defined(MLK_SYS_AARCH64_NEON) && \
|
|
32
|
+
defined(MLK_ARITH_BACKEND_AARCH64) && \
|
|
32
33
|
!defined(MLK_CONFIG_MULTILEVEL_NO_SHARED) && \
|
|
33
34
|
(!defined(MLK_CONFIG_NO_KEYPAIR_API) || \
|
|
34
35
|
!defined(MLK_CONFIG_NO_ENCAPS_API))
|
|
@@ -116,8 +117,9 @@ Lmlk_poly_tobytes_loop_start:
|
|
|
116
117
|
|
|
117
118
|
MLK_ASM_FN_SIZE(poly_tobytes_aarch64_asm)
|
|
118
119
|
|
|
119
|
-
#endif /*
|
|
120
|
-
(!MLK_CONFIG_NO_KEYPAIR_API ||
|
|
120
|
+
#endif /* MLK_SYS_AARCH64_NEON && MLK_ARITH_BACKEND_AARCH64 && \
|
|
121
|
+
!MLK_CONFIG_MULTILEVEL_NO_SHARED && (!MLK_CONFIG_NO_KEYPAIR_API || \
|
|
122
|
+
!MLK_CONFIG_NO_ENCAPS_API) */
|
|
121
123
|
|
|
122
124
|
#if defined(__ELF__)
|
|
123
125
|
.section .note.GNU-stack,"",%progbits
|
data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/mlkem_poly_tomont_aarch64_asm.S
CHANGED
|
@@ -22,7 +22,8 @@
|
|
|
22
22
|
*/
|
|
23
23
|
|
|
24
24
|
#include "../../../common.h"
|
|
25
|
-
#if defined(
|
|
25
|
+
#if defined(MLK_SYS_AARCH64_NEON) && \
|
|
26
|
+
defined(MLK_ARITH_BACKEND_AARCH64) && \
|
|
26
27
|
!defined(MLK_CONFIG_MULTILEVEL_NO_SHARED) && \
|
|
27
28
|
!defined(MLK_CONFIG_NO_KEYPAIR_API)
|
|
28
29
|
|
|
@@ -94,8 +95,8 @@ Lmlk_poly_tomont_loop:
|
|
|
94
95
|
|
|
95
96
|
MLK_ASM_FN_SIZE(poly_tomont_aarch64_asm)
|
|
96
97
|
|
|
97
|
-
#endif /*
|
|
98
|
-
!MLK_CONFIG_NO_KEYPAIR_API */
|
|
98
|
+
#endif /* MLK_SYS_AARCH64_NEON && MLK_ARITH_BACKEND_AARCH64 && \
|
|
99
|
+
!MLK_CONFIG_MULTILEVEL_NO_SHARED && !MLK_CONFIG_NO_KEYPAIR_API */
|
|
99
100
|
|
|
100
101
|
#if defined(__ELF__)
|
|
101
102
|
.section .note.GNU-stack,"",%progbits
|
|
@@ -52,7 +52,8 @@
|
|
|
52
52
|
/* Re-implementation of asymmetric base multiplication following @[NeonNTT] */
|
|
53
53
|
|
|
54
54
|
#include "../../../common.h"
|
|
55
|
-
#if defined(
|
|
55
|
+
#if defined(MLK_SYS_AARCH64_NEON) && \
|
|
56
|
+
defined(MLK_ARITH_BACKEND_AARCH64) && !defined(MLK_CONFIG_MULTILEVEL_NO_SHARED) && (defined(MLK_CONFIG_MULTILEVEL_WITH_SHARED) || MLKEM_K == 2)
|
|
56
57
|
|
|
57
58
|
/*
|
|
58
59
|
* WARNING: This file is auto-derived from the mlkem-native source file
|
|
@@ -256,7 +257,8 @@ Lmlk_polyvec_basemul_acc_montgomery_cached_k2_loop_start:
|
|
|
256
257
|
MLK_ASM_FN_SIZE(polyvec_basemul_acc_montgomery_cached_k2_aarch64_asm)
|
|
257
258
|
|
|
258
259
|
|
|
259
|
-
#endif /*
|
|
260
|
+
#endif /* MLK_SYS_AARCH64_NEON && MLK_ARITH_BACKEND_AARCH64 && \
|
|
261
|
+
!MLK_CONFIG_MULTILEVEL_NO_SHARED && \
|
|
260
262
|
(MLK_CONFIG_MULTILEVEL_WITH_SHARED || MLKEM_K == 2) */
|
|
261
263
|
|
|
262
264
|
#if defined(__ELF__)
|
|
@@ -52,7 +52,8 @@
|
|
|
52
52
|
/* Re-implementation of asymmetric base multiplication following @[NeonNTT] */
|
|
53
53
|
|
|
54
54
|
#include "../../../common.h"
|
|
55
|
-
#if defined(
|
|
55
|
+
#if defined(MLK_SYS_AARCH64_NEON) && \
|
|
56
|
+
defined(MLK_ARITH_BACKEND_AARCH64) && !defined(MLK_CONFIG_MULTILEVEL_NO_SHARED) && (defined(MLK_CONFIG_MULTILEVEL_WITH_SHARED) || MLKEM_K == 3)
|
|
56
57
|
|
|
57
58
|
/*
|
|
58
59
|
* WARNING: This file is auto-derived from the mlkem-native source file
|
|
@@ -309,7 +310,8 @@ Lmlk_polyvec_basemul_acc_montgomery_cached_k3_loop_start:
|
|
|
309
310
|
|
|
310
311
|
MLK_ASM_FN_SIZE(polyvec_basemul_acc_montgomery_cached_k3_aarch64_asm)
|
|
311
312
|
|
|
312
|
-
#endif /*
|
|
313
|
+
#endif /* MLK_SYS_AARCH64_NEON && MLK_ARITH_BACKEND_AARCH64 && \
|
|
314
|
+
!MLK_CONFIG_MULTILEVEL_NO_SHARED && \
|
|
313
315
|
(MLK_CONFIG_MULTILEVEL_WITH_SHARED || MLKEM_K == 3) */
|
|
314
316
|
|
|
315
317
|
#if defined(__ELF__)
|
|
@@ -52,7 +52,8 @@
|
|
|
52
52
|
/* Re-implementation of asymmetric base multiplication following @[NeonNTT] */
|
|
53
53
|
|
|
54
54
|
#include "../../../common.h"
|
|
55
|
-
#if defined(
|
|
55
|
+
#if defined(MLK_SYS_AARCH64_NEON) && \
|
|
56
|
+
defined(MLK_ARITH_BACKEND_AARCH64) && !defined(MLK_CONFIG_MULTILEVEL_NO_SHARED) && (defined(MLK_CONFIG_MULTILEVEL_WITH_SHARED) || MLKEM_K == 4)
|
|
56
57
|
|
|
57
58
|
/*
|
|
58
59
|
* WARNING: This file is auto-derived from the mlkem-native source file
|
|
@@ -363,7 +364,8 @@ Lmlk_polyvec_basemul_acc_montgomery_cached_k4_loop_start:
|
|
|
363
364
|
|
|
364
365
|
MLK_ASM_FN_SIZE(polyvec_basemul_acc_montgomery_cached_k4_aarch64_asm)
|
|
365
366
|
|
|
366
|
-
#endif /*
|
|
367
|
+
#endif /* MLK_SYS_AARCH64_NEON && MLK_ARITH_BACKEND_AARCH64 && \
|
|
368
|
+
!MLK_CONFIG_MULTILEVEL_NO_SHARED && \
|
|
367
369
|
(MLK_CONFIG_MULTILEVEL_WITH_SHARED || MLKEM_K == 4) */
|
|
368
370
|
|
|
369
371
|
#if defined(__ELF__)
|