pq_crypto 0.4.2 → 0.5.0
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 +25 -0
- data/GET_STARTED.md +21 -16
- data/README.md +26 -0
- data/SECURITY.md +22 -16
- data/ext/pqcrypto/extconf.rb +148 -99
- data/ext/pqcrypto/mldsa_api.h +1 -118
- data/ext/pqcrypto/mlkem_api.h +1 -42
- data/ext/pqcrypto/pq_externalmu.c +88 -216
- data/ext/pqcrypto/pqcrypto_native_api.h +129 -0
- data/ext/pqcrypto/pqcrypto_ruby_secure.c +0 -3
- data/ext/pqcrypto/pqcrypto_secure.c +135 -117
- data/ext/pqcrypto/pqcrypto_secure.h +1 -42
- data/ext/pqcrypto/pqcrypto_version.h +1 -1
- data/ext/pqcrypto/randombytes.h +9 -0
- data/ext/pqcrypto/vendor/.vendored +10 -5
- data/ext/pqcrypto/vendor/mldsa-native/BUILDING.md +105 -0
- data/ext/pqcrypto/vendor/mldsa-native/LICENSE +286 -0
- data/ext/pqcrypto/vendor/mldsa-native/META.yml +24 -0
- data/ext/pqcrypto/vendor/mldsa-native/README.md +221 -0
- data/ext/pqcrypto/vendor/mldsa-native/SECURITY.md +8 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/mldsa_native.c +721 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/mldsa_native.h +975 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/mldsa_native_asm.S +724 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/mldsa_native_config.h +723 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/cbmc.h +166 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/common.h +321 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/ct.c +21 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/ct.h +385 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/debug.c +73 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/debug.h +130 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/fips202.c +277 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/fips202.h +244 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/fips202x4.c +182 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/fips202x4.h +117 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/keccakf1600.c +438 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/keccakf1600.h +105 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/aarch64/auto.h +71 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/aarch64/src/fips202_native_aarch64.h +62 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/aarch64/src/keccak_f1600_x1_scalar_asm.S +376 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/aarch64/src/keccak_f1600_x1_v84a_asm.S +204 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/aarch64/src/keccak_f1600_x2_v84a_asm.S +259 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/aarch64/src/keccak_f1600_x4_v8a_scalar_hybrid_asm.S +1077 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/aarch64/src/keccak_f1600_x4_v8a_v84a_scalar_hybrid_asm.S +987 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/aarch64/src/keccakf1600_round_constants.c +41 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/aarch64/x1_scalar.h +26 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/aarch64/x1_v84a.h +35 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/aarch64/x2_v84a.h +37 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/aarch64/x4_v8a_scalar.h +27 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/aarch64/x4_v8a_v84a_scalar.h +36 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/api.h +69 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/armv81m/README.md +10 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/armv81m/mve.h +32 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/armv81m/src/fips202_native_armv81m.h +20 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/armv81m/src/keccak_f1600_x4_mve.S +638 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/armv81m/src/keccak_f1600_x4_mve.c +136 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/armv81m/src/keccakf1600_round_constants.c +52 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/auto.h +29 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/x86_64/src/KeccakP_1600_times4_SIMD256.c +488 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/x86_64/src/KeccakP_1600_times4_SIMD256.h +16 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/x86_64/xkcp.h +31 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/meta.h +247 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/aarch64_zetas.c +231 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/arith_native_aarch64.h +150 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/intt.S +753 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/mld_polyvecl_pointwise_acc_montgomery_l4.S +129 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/mld_polyvecl_pointwise_acc_montgomery_l5.S +145 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/mld_polyvecl_pointwise_acc_montgomery_l7.S +177 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/ntt.S +653 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/pointwise_montgomery.S +79 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/poly_caddq_asm.S +53 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/poly_chknorm_asm.S +55 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/poly_decompose_32_asm.S +85 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/poly_decompose_88_asm.S +85 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/poly_use_hint_32_asm.S +102 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/poly_use_hint_88_asm.S +110 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/polyz_unpack_17_asm.S +72 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/polyz_unpack_19_asm.S +69 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/polyz_unpack_table.c +40 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/rej_uniform_asm.S +189 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/rej_uniform_eta2_asm.S +135 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/rej_uniform_eta4_asm.S +128 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/rej_uniform_eta_table.c +543 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/rej_uniform_table.c +62 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/api.h +649 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/meta.h +23 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/meta.h +315 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/arith_native_x86_64.h +124 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/consts.c +157 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/consts.h +27 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/intt.S +2311 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/ntt.S +2383 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/nttunpack.S +239 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/pointwise.S +131 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/pointwise_acc_l4.S +139 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/pointwise_acc_l5.S +155 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/pointwise_acc_l7.S +187 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/poly_caddq_avx2.c +61 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/poly_chknorm_avx2.c +52 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/poly_decompose_32_avx2.c +155 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/poly_decompose_88_avx2.c +155 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/poly_use_hint_32_avx2.c +102 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/poly_use_hint_88_avx2.c +104 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/polyz_unpack_17_avx2.c +91 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/polyz_unpack_19_avx2.c +93 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/rej_uniform_avx2.c +126 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/rej_uniform_eta2_avx2.c +155 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/rej_uniform_eta4_avx2.c +139 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/rej_uniform_table.c +160 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/packing.c +293 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/packing.h +224 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/params.h +77 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/poly.c +991 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/poly.h +393 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/poly_kl.c +946 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/poly_kl.h +360 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/polyvec.c +877 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/polyvec.h +725 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/randombytes.h +26 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/reduce.h +139 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/rounding.h +249 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/sign.c +1511 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/sign.h +806 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/symmetric.h +68 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/sys.h +268 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/zetas.inc +55 -0
- data/ext/pqcrypto/vendor/mlkem-native/BUILDING.md +104 -0
- data/ext/pqcrypto/vendor/mlkem-native/LICENSE +294 -0
- data/ext/pqcrypto/vendor/mlkem-native/META.yml +30 -0
- data/ext/pqcrypto/vendor/mlkem-native/README.md +223 -0
- data/ext/pqcrypto/vendor/mlkem-native/RELEASE.md +86 -0
- data/ext/pqcrypto/vendor/mlkem-native/SECURITY.md +8 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/README.md +23 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/mlkem_native.c +660 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/mlkem_native.h +538 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/mlkem_native_asm.S +681 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/mlkem_native_config.h +709 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/cbmc.h +174 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/common.h +274 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/compress.c +717 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/compress.h +688 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/debug.c +64 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/debug.h +128 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/fips202.c +251 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/fips202.h +158 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/fips202x4.c +208 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/fips202x4.h +80 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/keccakf1600.c +463 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/keccakf1600.h +98 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/aarch64/auto.h +70 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/aarch64/src/fips202_native_aarch64.h +69 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/aarch64/src/keccak_f1600_x1_scalar_asm.S +375 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/aarch64/src/keccak_f1600_x1_v84a_asm.S +203 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/aarch64/src/keccak_f1600_x2_v84a_asm.S +258 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/aarch64/src/keccak_f1600_x4_v8a_scalar_hybrid_asm.S +1076 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/aarch64/src/keccak_f1600_x4_v8a_v84a_scalar_hybrid_asm.S +986 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/aarch64/src/keccakf1600_round_constants.c +46 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/aarch64/x1_scalar.h +25 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/aarch64/x1_v84a.h +34 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/aarch64/x2_v84a.h +35 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/aarch64/x4_v8a_scalar.h +26 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/aarch64/x4_v8a_v84a_scalar.h +35 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/api.h +117 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/armv81m/README.md +10 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/armv81m/mve.h +79 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/armv81m/src/fips202_native_armv81m.h +35 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/armv81m/src/keccak_f1600_x4_mve.S +667 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/armv81m/src/keccak_f1600_x4_mve.c +40 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/armv81m/src/keccakf1600_round_constants.c +51 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/armv81m/src/state_extract_bytes_x4_mve.S +290 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/armv81m/src/state_xor_bytes_x4_mve.S +314 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/auto.h +28 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/x86_64/keccak_f1600_x4_avx2.h +33 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/x86_64/src/fips202_native_x86_64.h +41 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/x86_64/src/keccak_f1600_x4_avx2.S +451 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/x86_64/src/keccakf1600_constants.c +51 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/indcpa.c +622 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/indcpa.h +156 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/kem.c +446 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/kem.h +326 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/README.md +16 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/meta.h +122 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/aarch64_zetas.c +174 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/arith_native_aarch64.h +177 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/intt.S +628 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/ntt.S +562 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/poly_mulcache_compute_asm.S +127 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/poly_reduce_asm.S +150 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/poly_tobytes_asm.S +117 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/poly_tomont_asm.S +98 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/polyvec_basemul_acc_montgomery_cached_asm_k2.S +261 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/polyvec_basemul_acc_montgomery_cached_asm_k3.S +314 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/polyvec_basemul_acc_montgomery_cached_asm_k4.S +368 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/rej_uniform_asm.S +226 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/rej_uniform_table.c +542 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/api.h +637 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/meta.h +25 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/riscv64/README.md +11 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/riscv64/meta.h +128 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/riscv64/src/arith_native_riscv64.h +45 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/riscv64/src/rv64v_debug.c +81 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/riscv64/src/rv64v_debug.h +145 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/riscv64/src/rv64v_izetas.inc +27 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/riscv64/src/rv64v_poly.c +805 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/riscv64/src/rv64v_zetas.inc +27 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/riscv64/src/rv64v_zetas_basemul.inc +39 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/README.md +4 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/meta.h +304 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/arith_native_x86_64.h +309 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/compress_consts.c +94 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/compress_consts.h +45 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/consts.c +102 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/consts.h +25 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/intt.S +719 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/mulcache_compute.S +90 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/ntt.S +639 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/nttfrombytes.S +193 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/ntttobytes.S +181 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/nttunpack.S +174 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/poly_compress_d10.S +382 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/poly_compress_d11.S +448 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/poly_compress_d4.S +163 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/poly_compress_d5.S +220 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/poly_decompress_d10.S +228 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/poly_decompress_d11.S +277 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/poly_decompress_d4.S +180 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/poly_decompress_d5.S +192 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/polyvec_basemul_acc_montgomery_cached_asm_k2.S +502 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/polyvec_basemul_acc_montgomery_cached_asm_k3.S +750 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/polyvec_basemul_acc_montgomery_cached_asm_k4.S +998 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/reduce.S +218 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/rej_uniform_asm.S +103 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/rej_uniform_table.c +544 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/tomont.S +155 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/params.h +76 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/poly.c +572 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/poly.h +317 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/poly_k.c +502 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/poly_k.h +668 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/randombytes.h +60 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/sampling.c +362 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/sampling.h +118 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/symmetric.h +70 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/sys.h +260 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/verify.c +20 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/verify.h +464 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/zetas.inc +30 -0
- data/lib/pq_crypto/version.rb +1 -1
- data/lib/pq_crypto.rb +1 -1
- data/script/vendor_libs.rb +88 -159
- metadata +236 -160
- data/ext/pqcrypto/vendor/pqclean/common/aes.c +0 -639
- data/ext/pqcrypto/vendor/pqclean/common/aes.h +0 -64
- data/ext/pqcrypto/vendor/pqclean/common/compat.h +0 -73
- data/ext/pqcrypto/vendor/pqclean/common/crypto_declassify.h +0 -7
- data/ext/pqcrypto/vendor/pqclean/common/fips202.c +0 -928
- data/ext/pqcrypto/vendor/pqclean/common/fips202.h +0 -166
- data/ext/pqcrypto/vendor/pqclean/common/keccak2x/feat.S +0 -168
- data/ext/pqcrypto/vendor/pqclean/common/keccak2x/fips202x2.c +0 -684
- data/ext/pqcrypto/vendor/pqclean/common/keccak2x/fips202x2.h +0 -60
- data/ext/pqcrypto/vendor/pqclean/common/keccak4x/KeccakP-1600-times4-SIMD256.c +0 -1028
- data/ext/pqcrypto/vendor/pqclean/common/keccak4x/KeccakP-1600-times4-SnP.h +0 -50
- data/ext/pqcrypto/vendor/pqclean/common/keccak4x/KeccakP-1600-unrolling.macros +0 -198
- data/ext/pqcrypto/vendor/pqclean/common/keccak4x/Makefile +0 -8
- data/ext/pqcrypto/vendor/pqclean/common/keccak4x/Makefile.Microsoft_nmake +0 -8
- data/ext/pqcrypto/vendor/pqclean/common/keccak4x/SIMD256-config.h +0 -3
- data/ext/pqcrypto/vendor/pqclean/common/keccak4x/align.h +0 -34
- data/ext/pqcrypto/vendor/pqclean/common/keccak4x/brg_endian.h +0 -142
- data/ext/pqcrypto/vendor/pqclean/common/nistseedexpander.c +0 -101
- data/ext/pqcrypto/vendor/pqclean/common/nistseedexpander.h +0 -39
- data/ext/pqcrypto/vendor/pqclean/common/randombytes.c +0 -355
- data/ext/pqcrypto/vendor/pqclean/common/randombytes.h +0 -27
- data/ext/pqcrypto/vendor/pqclean/common/sha2.c +0 -769
- data/ext/pqcrypto/vendor/pqclean/common/sha2.h +0 -173
- data/ext/pqcrypto/vendor/pqclean/common/sp800-185.c +0 -156
- data/ext/pqcrypto/vendor/pqclean/common/sp800-185.h +0 -27
- data/ext/pqcrypto/vendor/pqclean/crypto_kem/ml-kem-1024/clean/LICENSE +0 -5
- data/ext/pqcrypto/vendor/pqclean/crypto_kem/ml-kem-1024/clean/Makefile +0 -19
- data/ext/pqcrypto/vendor/pqclean/crypto_kem/ml-kem-1024/clean/Makefile.Microsoft_nmake +0 -23
- data/ext/pqcrypto/vendor/pqclean/crypto_kem/ml-kem-1024/clean/api.h +0 -18
- data/ext/pqcrypto/vendor/pqclean/crypto_kem/ml-kem-1024/clean/cbd.c +0 -83
- data/ext/pqcrypto/vendor/pqclean/crypto_kem/ml-kem-1024/clean/cbd.h +0 -11
- data/ext/pqcrypto/vendor/pqclean/crypto_kem/ml-kem-1024/clean/indcpa.c +0 -327
- data/ext/pqcrypto/vendor/pqclean/crypto_kem/ml-kem-1024/clean/indcpa.h +0 -22
- data/ext/pqcrypto/vendor/pqclean/crypto_kem/ml-kem-1024/clean/kem.c +0 -164
- data/ext/pqcrypto/vendor/pqclean/crypto_kem/ml-kem-1024/clean/kem.h +0 -23
- data/ext/pqcrypto/vendor/pqclean/crypto_kem/ml-kem-1024/clean/ntt.c +0 -146
- data/ext/pqcrypto/vendor/pqclean/crypto_kem/ml-kem-1024/clean/ntt.h +0 -14
- data/ext/pqcrypto/vendor/pqclean/crypto_kem/ml-kem-1024/clean/params.h +0 -36
- data/ext/pqcrypto/vendor/pqclean/crypto_kem/ml-kem-1024/clean/poly.c +0 -311
- data/ext/pqcrypto/vendor/pqclean/crypto_kem/ml-kem-1024/clean/poly.h +0 -37
- data/ext/pqcrypto/vendor/pqclean/crypto_kem/ml-kem-1024/clean/polyvec.c +0 -198
- data/ext/pqcrypto/vendor/pqclean/crypto_kem/ml-kem-1024/clean/polyvec.h +0 -26
- data/ext/pqcrypto/vendor/pqclean/crypto_kem/ml-kem-1024/clean/reduce.c +0 -41
- data/ext/pqcrypto/vendor/pqclean/crypto_kem/ml-kem-1024/clean/reduce.h +0 -13
- data/ext/pqcrypto/vendor/pqclean/crypto_kem/ml-kem-1024/clean/symmetric-shake.c +0 -71
- data/ext/pqcrypto/vendor/pqclean/crypto_kem/ml-kem-1024/clean/symmetric.h +0 -30
- data/ext/pqcrypto/vendor/pqclean/crypto_kem/ml-kem-1024/clean/verify.c +0 -67
- data/ext/pqcrypto/vendor/pqclean/crypto_kem/ml-kem-1024/clean/verify.h +0 -13
- data/ext/pqcrypto/vendor/pqclean/crypto_kem/ml-kem-512/clean/LICENSE +0 -5
- data/ext/pqcrypto/vendor/pqclean/crypto_kem/ml-kem-512/clean/Makefile +0 -19
- data/ext/pqcrypto/vendor/pqclean/crypto_kem/ml-kem-512/clean/Makefile.Microsoft_nmake +0 -23
- data/ext/pqcrypto/vendor/pqclean/crypto_kem/ml-kem-512/clean/api.h +0 -18
- data/ext/pqcrypto/vendor/pqclean/crypto_kem/ml-kem-512/clean/cbd.c +0 -108
- data/ext/pqcrypto/vendor/pqclean/crypto_kem/ml-kem-512/clean/cbd.h +0 -11
- data/ext/pqcrypto/vendor/pqclean/crypto_kem/ml-kem-512/clean/indcpa.c +0 -327
- data/ext/pqcrypto/vendor/pqclean/crypto_kem/ml-kem-512/clean/indcpa.h +0 -22
- data/ext/pqcrypto/vendor/pqclean/crypto_kem/ml-kem-512/clean/kem.c +0 -164
- data/ext/pqcrypto/vendor/pqclean/crypto_kem/ml-kem-512/clean/kem.h +0 -23
- data/ext/pqcrypto/vendor/pqclean/crypto_kem/ml-kem-512/clean/ntt.c +0 -146
- data/ext/pqcrypto/vendor/pqclean/crypto_kem/ml-kem-512/clean/ntt.h +0 -14
- data/ext/pqcrypto/vendor/pqclean/crypto_kem/ml-kem-512/clean/params.h +0 -36
- data/ext/pqcrypto/vendor/pqclean/crypto_kem/ml-kem-512/clean/poly.c +0 -299
- data/ext/pqcrypto/vendor/pqclean/crypto_kem/ml-kem-512/clean/poly.h +0 -37
- data/ext/pqcrypto/vendor/pqclean/crypto_kem/ml-kem-512/clean/polyvec.c +0 -188
- data/ext/pqcrypto/vendor/pqclean/crypto_kem/ml-kem-512/clean/polyvec.h +0 -26
- data/ext/pqcrypto/vendor/pqclean/crypto_kem/ml-kem-512/clean/reduce.c +0 -41
- data/ext/pqcrypto/vendor/pqclean/crypto_kem/ml-kem-512/clean/reduce.h +0 -13
- data/ext/pqcrypto/vendor/pqclean/crypto_kem/ml-kem-512/clean/symmetric-shake.c +0 -71
- data/ext/pqcrypto/vendor/pqclean/crypto_kem/ml-kem-512/clean/symmetric.h +0 -30
- data/ext/pqcrypto/vendor/pqclean/crypto_kem/ml-kem-512/clean/verify.c +0 -67
- data/ext/pqcrypto/vendor/pqclean/crypto_kem/ml-kem-512/clean/verify.h +0 -13
- data/ext/pqcrypto/vendor/pqclean/crypto_kem/ml-kem-768/clean/LICENSE +0 -5
- data/ext/pqcrypto/vendor/pqclean/crypto_kem/ml-kem-768/clean/Makefile +0 -19
- data/ext/pqcrypto/vendor/pqclean/crypto_kem/ml-kem-768/clean/Makefile.Microsoft_nmake +0 -23
- data/ext/pqcrypto/vendor/pqclean/crypto_kem/ml-kem-768/clean/api.h +0 -18
- data/ext/pqcrypto/vendor/pqclean/crypto_kem/ml-kem-768/clean/cbd.c +0 -83
- data/ext/pqcrypto/vendor/pqclean/crypto_kem/ml-kem-768/clean/cbd.h +0 -11
- data/ext/pqcrypto/vendor/pqclean/crypto_kem/ml-kem-768/clean/indcpa.c +0 -327
- data/ext/pqcrypto/vendor/pqclean/crypto_kem/ml-kem-768/clean/indcpa.h +0 -22
- data/ext/pqcrypto/vendor/pqclean/crypto_kem/ml-kem-768/clean/kem.c +0 -164
- data/ext/pqcrypto/vendor/pqclean/crypto_kem/ml-kem-768/clean/kem.h +0 -23
- data/ext/pqcrypto/vendor/pqclean/crypto_kem/ml-kem-768/clean/ntt.c +0 -146
- data/ext/pqcrypto/vendor/pqclean/crypto_kem/ml-kem-768/clean/ntt.h +0 -14
- data/ext/pqcrypto/vendor/pqclean/crypto_kem/ml-kem-768/clean/params.h +0 -36
- data/ext/pqcrypto/vendor/pqclean/crypto_kem/ml-kem-768/clean/poly.c +0 -299
- data/ext/pqcrypto/vendor/pqclean/crypto_kem/ml-kem-768/clean/poly.h +0 -37
- data/ext/pqcrypto/vendor/pqclean/crypto_kem/ml-kem-768/clean/polyvec.c +0 -188
- data/ext/pqcrypto/vendor/pqclean/crypto_kem/ml-kem-768/clean/polyvec.h +0 -26
- data/ext/pqcrypto/vendor/pqclean/crypto_kem/ml-kem-768/clean/reduce.c +0 -41
- data/ext/pqcrypto/vendor/pqclean/crypto_kem/ml-kem-768/clean/reduce.h +0 -13
- data/ext/pqcrypto/vendor/pqclean/crypto_kem/ml-kem-768/clean/symmetric-shake.c +0 -71
- data/ext/pqcrypto/vendor/pqclean/crypto_kem/ml-kem-768/clean/symmetric.h +0 -30
- data/ext/pqcrypto/vendor/pqclean/crypto_kem/ml-kem-768/clean/verify.c +0 -67
- data/ext/pqcrypto/vendor/pqclean/crypto_kem/ml-kem-768/clean/verify.h +0 -13
- data/ext/pqcrypto/vendor/pqclean/crypto_sign/ml-dsa-44/clean/LICENSE +0 -5
- data/ext/pqcrypto/vendor/pqclean/crypto_sign/ml-dsa-44/clean/Makefile +0 -19
- data/ext/pqcrypto/vendor/pqclean/crypto_sign/ml-dsa-44/clean/Makefile.Microsoft_nmake +0 -23
- data/ext/pqcrypto/vendor/pqclean/crypto_sign/ml-dsa-44/clean/api.h +0 -50
- data/ext/pqcrypto/vendor/pqclean/crypto_sign/ml-dsa-44/clean/ntt.c +0 -98
- data/ext/pqcrypto/vendor/pqclean/crypto_sign/ml-dsa-44/clean/ntt.h +0 -10
- data/ext/pqcrypto/vendor/pqclean/crypto_sign/ml-dsa-44/clean/packing.c +0 -261
- data/ext/pqcrypto/vendor/pqclean/crypto_sign/ml-dsa-44/clean/packing.h +0 -31
- data/ext/pqcrypto/vendor/pqclean/crypto_sign/ml-dsa-44/clean/params.h +0 -44
- data/ext/pqcrypto/vendor/pqclean/crypto_sign/ml-dsa-44/clean/poly.c +0 -848
- data/ext/pqcrypto/vendor/pqclean/crypto_sign/ml-dsa-44/clean/poly.h +0 -52
- data/ext/pqcrypto/vendor/pqclean/crypto_sign/ml-dsa-44/clean/polyvec.c +0 -415
- data/ext/pqcrypto/vendor/pqclean/crypto_sign/ml-dsa-44/clean/polyvec.h +0 -65
- data/ext/pqcrypto/vendor/pqclean/crypto_sign/ml-dsa-44/clean/reduce.c +0 -69
- data/ext/pqcrypto/vendor/pqclean/crypto_sign/ml-dsa-44/clean/reduce.h +0 -17
- data/ext/pqcrypto/vendor/pqclean/crypto_sign/ml-dsa-44/clean/rounding.c +0 -98
- data/ext/pqcrypto/vendor/pqclean/crypto_sign/ml-dsa-44/clean/rounding.h +0 -14
- data/ext/pqcrypto/vendor/pqclean/crypto_sign/ml-dsa-44/clean/sign.c +0 -407
- data/ext/pqcrypto/vendor/pqclean/crypto_sign/ml-dsa-44/clean/sign.h +0 -47
- data/ext/pqcrypto/vendor/pqclean/crypto_sign/ml-dsa-44/clean/symmetric-shake.c +0 -26
- data/ext/pqcrypto/vendor/pqclean/crypto_sign/ml-dsa-44/clean/symmetric.h +0 -34
- data/ext/pqcrypto/vendor/pqclean/crypto_sign/ml-dsa-65/clean/LICENSE +0 -5
- data/ext/pqcrypto/vendor/pqclean/crypto_sign/ml-dsa-65/clean/Makefile +0 -19
- data/ext/pqcrypto/vendor/pqclean/crypto_sign/ml-dsa-65/clean/Makefile.Microsoft_nmake +0 -23
- data/ext/pqcrypto/vendor/pqclean/crypto_sign/ml-dsa-65/clean/api.h +0 -50
- data/ext/pqcrypto/vendor/pqclean/crypto_sign/ml-dsa-65/clean/ntt.c +0 -98
- data/ext/pqcrypto/vendor/pqclean/crypto_sign/ml-dsa-65/clean/ntt.h +0 -10
- data/ext/pqcrypto/vendor/pqclean/crypto_sign/ml-dsa-65/clean/packing.c +0 -261
- data/ext/pqcrypto/vendor/pqclean/crypto_sign/ml-dsa-65/clean/packing.h +0 -31
- data/ext/pqcrypto/vendor/pqclean/crypto_sign/ml-dsa-65/clean/params.h +0 -44
- data/ext/pqcrypto/vendor/pqclean/crypto_sign/ml-dsa-65/clean/poly.c +0 -799
- data/ext/pqcrypto/vendor/pqclean/crypto_sign/ml-dsa-65/clean/poly.h +0 -52
- data/ext/pqcrypto/vendor/pqclean/crypto_sign/ml-dsa-65/clean/polyvec.c +0 -415
- data/ext/pqcrypto/vendor/pqclean/crypto_sign/ml-dsa-65/clean/polyvec.h +0 -65
- data/ext/pqcrypto/vendor/pqclean/crypto_sign/ml-dsa-65/clean/reduce.c +0 -69
- data/ext/pqcrypto/vendor/pqclean/crypto_sign/ml-dsa-65/clean/reduce.h +0 -17
- data/ext/pqcrypto/vendor/pqclean/crypto_sign/ml-dsa-65/clean/rounding.c +0 -92
- data/ext/pqcrypto/vendor/pqclean/crypto_sign/ml-dsa-65/clean/rounding.h +0 -14
- data/ext/pqcrypto/vendor/pqclean/crypto_sign/ml-dsa-65/clean/sign.c +0 -407
- data/ext/pqcrypto/vendor/pqclean/crypto_sign/ml-dsa-65/clean/sign.h +0 -47
- data/ext/pqcrypto/vendor/pqclean/crypto_sign/ml-dsa-65/clean/symmetric-shake.c +0 -26
- data/ext/pqcrypto/vendor/pqclean/crypto_sign/ml-dsa-65/clean/symmetric.h +0 -34
- data/ext/pqcrypto/vendor/pqclean/crypto_sign/ml-dsa-87/clean/LICENSE +0 -5
- data/ext/pqcrypto/vendor/pqclean/crypto_sign/ml-dsa-87/clean/Makefile +0 -19
- data/ext/pqcrypto/vendor/pqclean/crypto_sign/ml-dsa-87/clean/Makefile.Microsoft_nmake +0 -23
- data/ext/pqcrypto/vendor/pqclean/crypto_sign/ml-dsa-87/clean/api.h +0 -50
- data/ext/pqcrypto/vendor/pqclean/crypto_sign/ml-dsa-87/clean/ntt.c +0 -98
- data/ext/pqcrypto/vendor/pqclean/crypto_sign/ml-dsa-87/clean/ntt.h +0 -10
- data/ext/pqcrypto/vendor/pqclean/crypto_sign/ml-dsa-87/clean/packing.c +0 -261
- data/ext/pqcrypto/vendor/pqclean/crypto_sign/ml-dsa-87/clean/packing.h +0 -31
- data/ext/pqcrypto/vendor/pqclean/crypto_sign/ml-dsa-87/clean/params.h +0 -44
- data/ext/pqcrypto/vendor/pqclean/crypto_sign/ml-dsa-87/clean/poly.c +0 -823
- data/ext/pqcrypto/vendor/pqclean/crypto_sign/ml-dsa-87/clean/poly.h +0 -52
- data/ext/pqcrypto/vendor/pqclean/crypto_sign/ml-dsa-87/clean/polyvec.c +0 -415
- data/ext/pqcrypto/vendor/pqclean/crypto_sign/ml-dsa-87/clean/polyvec.h +0 -65
- data/ext/pqcrypto/vendor/pqclean/crypto_sign/ml-dsa-87/clean/reduce.c +0 -69
- data/ext/pqcrypto/vendor/pqclean/crypto_sign/ml-dsa-87/clean/reduce.h +0 -17
- data/ext/pqcrypto/vendor/pqclean/crypto_sign/ml-dsa-87/clean/rounding.c +0 -92
- data/ext/pqcrypto/vendor/pqclean/crypto_sign/ml-dsa-87/clean/rounding.h +0 -14
- data/ext/pqcrypto/vendor/pqclean/crypto_sign/ml-dsa-87/clean/sign.c +0 -407
- data/ext/pqcrypto/vendor/pqclean/crypto_sign/ml-dsa-87/clean/sign.h +0 -47
- data/ext/pqcrypto/vendor/pqclean/crypto_sign/ml-dsa-87/clean/symmetric-shake.c +0 -26
- data/ext/pqcrypto/vendor/pqclean/crypto_sign/ml-dsa-87/clean/symmetric.h +0 -34
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) The mlkem-native project authors
|
|
3
|
+
* Copyright (c) The mldsa-native project authors
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0 OR ISC OR MIT
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
/* References
|
|
8
|
+
* ==========
|
|
9
|
+
*
|
|
10
|
+
* - [HYBRID]
|
|
11
|
+
* Hybrid scalar/vector implementations of Keccak and SPHINCS+ on AArch64
|
|
12
|
+
* Becker, Kannwischer
|
|
13
|
+
* https://eprint.iacr.org/2022/1243
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
#ifndef MLD_FIPS202_NATIVE_AARCH64_AUTO_H
|
|
17
|
+
#define MLD_FIPS202_NATIVE_AARCH64_AUTO_H
|
|
18
|
+
/* Default FIPS202 assembly profile for AArch64 systems */
|
|
19
|
+
|
|
20
|
+
/*
|
|
21
|
+
* Default logic to decide which implementation to use.
|
|
22
|
+
*
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
/*
|
|
26
|
+
* Keccak-f1600
|
|
27
|
+
*
|
|
28
|
+
* - On Arm-based Apple CPUs, we pick a pure Neon implementation.
|
|
29
|
+
* - Otherwise, unless MLD_SYS_AARCH64_SLOW_BARREL_SHIFTER is set,
|
|
30
|
+
* we use lazy-rotation scalar assembly from @[HYBRID].
|
|
31
|
+
* - Otherwise, if MLD_SYS_AARCH64_SLOW_BARREL_SHIFTER is set, we
|
|
32
|
+
* fall back to the standard C implementation.
|
|
33
|
+
*/
|
|
34
|
+
#if defined(__ARM_FEATURE_SHA3) && defined(__APPLE__)
|
|
35
|
+
#include "x1_v84a.h"
|
|
36
|
+
#elif !defined(MLD_SYS_AARCH64_SLOW_BARREL_SHIFTER)
|
|
37
|
+
#include "x1_scalar.h"
|
|
38
|
+
#endif
|
|
39
|
+
|
|
40
|
+
/*
|
|
41
|
+
* Keccak-f1600x2/x4
|
|
42
|
+
*
|
|
43
|
+
* The optimal implementation is highly CPU-specific; see @[HYBRID].
|
|
44
|
+
*
|
|
45
|
+
* For now, if v8.4-A is not implemented, we fall back to Keccak-f1600.
|
|
46
|
+
* If v8.4-A is implemented and we are on an Apple CPU, we use a plain
|
|
47
|
+
* Neon-based implementation.
|
|
48
|
+
* If v8.4-A is implemented and we are not on an Apple CPU, we use a
|
|
49
|
+
* scalar/Neon/Neon hybrid.
|
|
50
|
+
* The reason for this distinction is that Apple CPUs appear to implement
|
|
51
|
+
* the SHA3 instructions on all SIMD units, while Arm CPUs prior to Cortex-X4
|
|
52
|
+
* don't, and ordinary Neon instructions are still needed.
|
|
53
|
+
*/
|
|
54
|
+
#if defined(__ARM_FEATURE_SHA3)
|
|
55
|
+
/*
|
|
56
|
+
* For Apple-M cores, we use a plain implementation leveraging SHA3
|
|
57
|
+
* instructions only.
|
|
58
|
+
*/
|
|
59
|
+
#if defined(__APPLE__)
|
|
60
|
+
#include "x2_v84a.h"
|
|
61
|
+
#else
|
|
62
|
+
#include "x4_v8a_v84a_scalar.h"
|
|
63
|
+
#endif
|
|
64
|
+
|
|
65
|
+
#else /* __ARM_FEATURE_SHA3 */
|
|
66
|
+
|
|
67
|
+
#include "x4_v8a_scalar.h"
|
|
68
|
+
|
|
69
|
+
#endif /* !__ARM_FEATURE_SHA3 */
|
|
70
|
+
|
|
71
|
+
#endif /* !MLD_FIPS202_NATIVE_AARCH64_AUTO_H */
|
data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/aarch64/src/fips202_native_aarch64.h
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) The mlkem-native project authors
|
|
3
|
+
* Copyright (c) The mldsa-native project authors
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0 OR ISC OR MIT
|
|
5
|
+
*/
|
|
6
|
+
#ifndef MLD_FIPS202_NATIVE_AARCH64_SRC_FIPS202_NATIVE_AARCH64_H
|
|
7
|
+
#define MLD_FIPS202_NATIVE_AARCH64_SRC_FIPS202_NATIVE_AARCH64_H
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
#include "../../../../cbmc.h"
|
|
11
|
+
#include "../../../../common.h"
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
#define mld_keccakf1600_round_constants \
|
|
15
|
+
MLD_NAMESPACE(keccakf1600_round_constants)
|
|
16
|
+
extern const uint64_t mld_keccakf1600_round_constants[];
|
|
17
|
+
|
|
18
|
+
#define mld_keccak_f1600_x1_scalar_asm MLD_NAMESPACE(keccak_f1600_x1_scalar_asm)
|
|
19
|
+
void mld_keccak_f1600_x1_scalar_asm(uint64_t state[25], const uint64_t rc[24])
|
|
20
|
+
__contract__(
|
|
21
|
+
requires(memory_no_alias(state, sizeof(uint64_t) * 25 * 1))
|
|
22
|
+
requires(rc == mld_keccakf1600_round_constants)
|
|
23
|
+
assigns(memory_slice(state, sizeof(uint64_t) * 25 * 1))
|
|
24
|
+
);
|
|
25
|
+
|
|
26
|
+
#define mld_keccak_f1600_x1_v84a_asm MLD_NAMESPACE(keccak_f1600_x1_v84a_asm)
|
|
27
|
+
void mld_keccak_f1600_x1_v84a_asm(uint64_t state[25], const uint64_t rc[24])
|
|
28
|
+
__contract__(
|
|
29
|
+
requires(memory_no_alias(state, sizeof(uint64_t) * 25 * 1))
|
|
30
|
+
requires(rc == mld_keccakf1600_round_constants)
|
|
31
|
+
assigns(memory_slice(state, sizeof(uint64_t) * 25 * 1))
|
|
32
|
+
);
|
|
33
|
+
|
|
34
|
+
#define mld_keccak_f1600_x2_v84a_asm MLD_NAMESPACE(keccak_f1600_x2_v84a_asm)
|
|
35
|
+
void mld_keccak_f1600_x2_v84a_asm(uint64_t state[50], const uint64_t rc[24])
|
|
36
|
+
__contract__(
|
|
37
|
+
requires(memory_no_alias(state, sizeof(uint64_t) * 25 * 2))
|
|
38
|
+
requires(rc == mld_keccakf1600_round_constants)
|
|
39
|
+
assigns(memory_slice(state, sizeof(uint64_t) * 25 * 2))
|
|
40
|
+
);
|
|
41
|
+
|
|
42
|
+
#define mld_keccak_f1600_x4_v8a_scalar_hybrid_asm \
|
|
43
|
+
MLD_NAMESPACE(keccak_f1600_x4_v8a_scalar_hybrid_asm)
|
|
44
|
+
void mld_keccak_f1600_x4_v8a_scalar_hybrid_asm(uint64_t state[100],
|
|
45
|
+
const uint64_t rc[24])
|
|
46
|
+
__contract__(
|
|
47
|
+
requires(memory_no_alias(state, sizeof(uint64_t) * 25 * 4))
|
|
48
|
+
requires(rc == mld_keccakf1600_round_constants)
|
|
49
|
+
assigns(memory_slice(state, sizeof(uint64_t) * 25 * 4))
|
|
50
|
+
);
|
|
51
|
+
|
|
52
|
+
#define mld_keccak_f1600_x4_v8a_v84a_scalar_hybrid_asm \
|
|
53
|
+
MLD_NAMESPACE(keccak_f1600_x4_v8a_v84a_scalar_hybrid_asm)
|
|
54
|
+
void mld_keccak_f1600_x4_v8a_v84a_scalar_hybrid_asm(uint64_t state[100],
|
|
55
|
+
const uint64_t rc[24])
|
|
56
|
+
__contract__(
|
|
57
|
+
requires(memory_no_alias(state, sizeof(uint64_t) * 25 * 4))
|
|
58
|
+
requires(rc == mld_keccakf1600_round_constants)
|
|
59
|
+
assigns(memory_slice(state, sizeof(uint64_t) * 25 * 4))
|
|
60
|
+
);
|
|
61
|
+
|
|
62
|
+
#endif /* !MLD_FIPS202_NATIVE_AARCH64_SRC_FIPS202_NATIVE_AARCH64_H */
|
|
@@ -0,0 +1,376 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) The mlkem-native project authors
|
|
3
|
+
* Copyright (c) The mldsa-native project authors
|
|
4
|
+
* Copyright (c) 2021-2022 Arm Limited
|
|
5
|
+
* Copyright (c) 2022 Matthias Kannwischer
|
|
6
|
+
* SPDX-License-Identifier: Apache-2.0 OR ISC OR MIT
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
// Author: Hanno Becker <hanno.becker@arm.com>
|
|
10
|
+
// Author: Matthias Kannwischer <matthias@kannwischer.eu>
|
|
11
|
+
|
|
12
|
+
/*yaml
|
|
13
|
+
Name: keccak_f1600_x1_scalar_asm
|
|
14
|
+
Description: AArch64 scalar implementation of Keccak-f[1600] permutation for single state
|
|
15
|
+
Signature: void mld_keccak_f1600_x1_scalar_asm(uint64_t state[25], const uint64_t rc[24])
|
|
16
|
+
ABI:
|
|
17
|
+
x0:
|
|
18
|
+
type: buffer
|
|
19
|
+
size_bytes: 200
|
|
20
|
+
permissions: read/write
|
|
21
|
+
c_parameter: uint64_t state[25]
|
|
22
|
+
description: Keccak state (25 x uint64_t)
|
|
23
|
+
x1:
|
|
24
|
+
type: buffer
|
|
25
|
+
size_bytes: 192
|
|
26
|
+
permissions: read-only
|
|
27
|
+
c_parameter: uint64_t const *rc
|
|
28
|
+
description: Round constants (24 x uint64_t)
|
|
29
|
+
Stack:
|
|
30
|
+
bytes: 128
|
|
31
|
+
description: register preservation and temporary storage
|
|
32
|
+
*/
|
|
33
|
+
|
|
34
|
+
#include "../../../../common.h"
|
|
35
|
+
#if defined(MLD_FIPS202_AARCH64_NEED_X1_SCALAR) && \
|
|
36
|
+
!defined(MLD_CONFIG_MULTILEVEL_NO_SHARED)
|
|
37
|
+
|
|
38
|
+
/*
|
|
39
|
+
* WARNING: This file is auto-derived from the mldsa-native source file
|
|
40
|
+
* dev/fips202/aarch64/src/keccak_f1600_x1_scalar_asm.S using scripts/simpasm. Do not modify it directly.
|
|
41
|
+
*/
|
|
42
|
+
|
|
43
|
+
#if defined(__ELF__)
|
|
44
|
+
.section .note.GNU-stack,"",@progbits
|
|
45
|
+
#endif
|
|
46
|
+
|
|
47
|
+
.text
|
|
48
|
+
.balign 4
|
|
49
|
+
.global MLD_ASM_NAMESPACE(keccak_f1600_x1_scalar_asm)
|
|
50
|
+
MLD_ASM_FN_SYMBOL(keccak_f1600_x1_scalar_asm)
|
|
51
|
+
|
|
52
|
+
.cfi_startproc
|
|
53
|
+
sub sp, sp, #0x80
|
|
54
|
+
.cfi_adjust_cfa_offset 0x80
|
|
55
|
+
stp x19, x20, [sp, #0x20]
|
|
56
|
+
.cfi_rel_offset x19, 0x20
|
|
57
|
+
.cfi_rel_offset x20, 0x28
|
|
58
|
+
stp x21, x22, [sp, #0x30]
|
|
59
|
+
.cfi_rel_offset x21, 0x30
|
|
60
|
+
.cfi_rel_offset x22, 0x38
|
|
61
|
+
stp x23, x24, [sp, #0x40]
|
|
62
|
+
.cfi_rel_offset x23, 0x40
|
|
63
|
+
.cfi_rel_offset x24, 0x48
|
|
64
|
+
stp x25, x26, [sp, #0x50]
|
|
65
|
+
.cfi_rel_offset x25, 0x50
|
|
66
|
+
.cfi_rel_offset x26, 0x58
|
|
67
|
+
stp x27, x28, [sp, #0x60]
|
|
68
|
+
.cfi_rel_offset x27, 0x60
|
|
69
|
+
.cfi_rel_offset x28, 0x68
|
|
70
|
+
stp x29, x30, [sp, #0x70]
|
|
71
|
+
.cfi_rel_offset x29, 0x70
|
|
72
|
+
.cfi_rel_offset x30, 0x78
|
|
73
|
+
|
|
74
|
+
Lkeccak_f1600_x1_scalar_initial:
|
|
75
|
+
mov x26, x1
|
|
76
|
+
str x1, [sp, #0x8]
|
|
77
|
+
ldp x1, x6, [x0]
|
|
78
|
+
ldp x11, x16, [x0, #0x10]
|
|
79
|
+
ldp x21, x2, [x0, #0x20]
|
|
80
|
+
ldp x7, x12, [x0, #0x30]
|
|
81
|
+
ldp x17, x22, [x0, #0x40]
|
|
82
|
+
ldp x3, x8, [x0, #0x50]
|
|
83
|
+
ldp x13, x28, [x0, #0x60]
|
|
84
|
+
ldp x23, x4, [x0, #0x70]
|
|
85
|
+
ldp x9, x14, [x0, #0x80]
|
|
86
|
+
ldp x19, x24, [x0, #0x90]
|
|
87
|
+
ldp x5, x10, [x0, #0xa0]
|
|
88
|
+
ldp x15, x20, [x0, #0xb0]
|
|
89
|
+
ldr x25, [x0, #0xc0]
|
|
90
|
+
str x0, [sp]
|
|
91
|
+
eor x30, x24, x25
|
|
92
|
+
eor x27, x9, x10
|
|
93
|
+
eor x0, x30, x21
|
|
94
|
+
eor x26, x27, x6
|
|
95
|
+
eor x27, x26, x7
|
|
96
|
+
eor x29, x0, x22
|
|
97
|
+
eor x26, x29, x23
|
|
98
|
+
eor x29, x4, x5
|
|
99
|
+
eor x30, x29, x1
|
|
100
|
+
eor x0, x27, x8
|
|
101
|
+
eor x29, x30, x2
|
|
102
|
+
eor x30, x19, x20
|
|
103
|
+
eor x30, x30, x16
|
|
104
|
+
eor x27, x26, x0, ror #63
|
|
105
|
+
eor x4, x4, x27
|
|
106
|
+
eor x30, x30, x17
|
|
107
|
+
eor x30, x30, x28
|
|
108
|
+
eor x29, x29, x3
|
|
109
|
+
eor x0, x0, x30, ror #63
|
|
110
|
+
eor x30, x30, x29, ror #63
|
|
111
|
+
eor x22, x22, x30
|
|
112
|
+
eor x23, x23, x30
|
|
113
|
+
str x23, [sp, #0x18]
|
|
114
|
+
eor x23, x14, x15
|
|
115
|
+
eor x14, x14, x0
|
|
116
|
+
eor x23, x23, x11
|
|
117
|
+
eor x15, x15, x0
|
|
118
|
+
eor x1, x1, x27
|
|
119
|
+
eor x23, x23, x12
|
|
120
|
+
eor x23, x23, x13
|
|
121
|
+
eor x11, x11, x0
|
|
122
|
+
eor x29, x29, x23, ror #63
|
|
123
|
+
eor x23, x23, x26, ror #63
|
|
124
|
+
eor x26, x13, x0
|
|
125
|
+
eor x13, x28, x23
|
|
126
|
+
eor x28, x24, x30
|
|
127
|
+
eor x24, x16, x23
|
|
128
|
+
eor x16, x21, x30
|
|
129
|
+
eor x21, x25, x30
|
|
130
|
+
eor x30, x19, x23
|
|
131
|
+
eor x19, x20, x23
|
|
132
|
+
eor x20, x17, x23
|
|
133
|
+
eor x17, x12, x0
|
|
134
|
+
eor x0, x2, x27
|
|
135
|
+
eor x2, x6, x29
|
|
136
|
+
eor x6, x8, x29
|
|
137
|
+
bic x8, x28, x13, ror #47
|
|
138
|
+
eor x12, x3, x27
|
|
139
|
+
bic x3, x13, x17, ror #19
|
|
140
|
+
eor x5, x5, x27
|
|
141
|
+
ldr x27, [sp, #0x18]
|
|
142
|
+
bic x25, x17, x2, ror #5
|
|
143
|
+
eor x9, x9, x29
|
|
144
|
+
eor x23, x25, x5, ror #52
|
|
145
|
+
eor x3, x3, x2, ror #24
|
|
146
|
+
eor x8, x8, x17, ror #2
|
|
147
|
+
eor x17, x10, x29
|
|
148
|
+
bic x25, x12, x22, ror #47
|
|
149
|
+
eor x29, x7, x29
|
|
150
|
+
bic x10, x4, x27, ror #2
|
|
151
|
+
bic x7, x5, x28, ror #10
|
|
152
|
+
eor x10, x10, x20, ror #50
|
|
153
|
+
eor x13, x7, x13, ror #57
|
|
154
|
+
bic x7, x2, x5, ror #47
|
|
155
|
+
eor x2, x25, x24, ror #39
|
|
156
|
+
bic x25, x20, x11, ror #57
|
|
157
|
+
bic x5, x17, x4, ror #25
|
|
158
|
+
eor x25, x25, x17, ror #53
|
|
159
|
+
bic x17, x11, x17, ror #60
|
|
160
|
+
eor x28, x7, x28, ror #57
|
|
161
|
+
bic x7, x9, x12, ror #42
|
|
162
|
+
eor x7, x7, x22, ror #25
|
|
163
|
+
bic x22, x22, x24, ror #56
|
|
164
|
+
bic x24, x24, x15, ror #31
|
|
165
|
+
eor x22, x22, x15, ror #23
|
|
166
|
+
bic x20, x27, x20, ror #48
|
|
167
|
+
bic x15, x15, x9, ror #16
|
|
168
|
+
eor x12, x15, x12, ror #58
|
|
169
|
+
eor x15, x5, x27, ror #27
|
|
170
|
+
eor x5, x20, x11, ror #41
|
|
171
|
+
ldr x11, [sp, #0x8]
|
|
172
|
+
eor x20, x17, x4, ror #21
|
|
173
|
+
eor x17, x24, x9, ror #47
|
|
174
|
+
mov x24, #0x1 // =1
|
|
175
|
+
bic x9, x0, x16, ror #9
|
|
176
|
+
str x24, [sp, #0x10]
|
|
177
|
+
bic x24, x29, x1, ror #44
|
|
178
|
+
bic x27, x1, x21, ror #50
|
|
179
|
+
bic x4, x26, x29, ror #63
|
|
180
|
+
eor x1, x1, x4, ror #21
|
|
181
|
+
ldr x11, [x11]
|
|
182
|
+
bic x4, x21, x30, ror #57
|
|
183
|
+
eor x21, x24, x21, ror #30
|
|
184
|
+
eor x24, x9, x19, ror #44
|
|
185
|
+
bic x9, x14, x6, ror #5
|
|
186
|
+
eor x9, x9, x0, ror #43
|
|
187
|
+
bic x0, x6, x0, ror #38
|
|
188
|
+
eor x1, x1, x11
|
|
189
|
+
eor x11, x4, x26, ror #35
|
|
190
|
+
eor x4, x0, x16, ror #47
|
|
191
|
+
bic x0, x16, x19, ror #35
|
|
192
|
+
eor x16, x27, x30, ror #43
|
|
193
|
+
bic x27, x30, x26, ror #42
|
|
194
|
+
bic x26, x19, x14, ror #41
|
|
195
|
+
eor x19, x0, x14, ror #12
|
|
196
|
+
eor x14, x26, x6, ror #46
|
|
197
|
+
eor x6, x27, x29, ror #41
|
|
198
|
+
|
|
199
|
+
Lkeccak_f1600_x1_scalar_loop:
|
|
200
|
+
eor x0, x15, x11, ror #52
|
|
201
|
+
eor x0, x0, x13, ror #48
|
|
202
|
+
eor x26, x8, x9, ror #57
|
|
203
|
+
eor x27, x0, x14, ror #10
|
|
204
|
+
eor x29, x16, x28, ror #63
|
|
205
|
+
eor x26, x26, x6, ror #51
|
|
206
|
+
eor x30, x23, x22, ror #50
|
|
207
|
+
eor x0, x26, x10, ror #31
|
|
208
|
+
eor x29, x29, x19, ror #37
|
|
209
|
+
eor x27, x27, x12, ror #5
|
|
210
|
+
eor x30, x30, x24, ror #34
|
|
211
|
+
eor x0, x0, x7, ror #27
|
|
212
|
+
eor x26, x30, x21, ror #26
|
|
213
|
+
eor x26, x26, x25, ror #15
|
|
214
|
+
ror x30, x27, #0x3e
|
|
215
|
+
eor x30, x30, x26, ror #57
|
|
216
|
+
ror x26, x26, #0x3a
|
|
217
|
+
eor x16, x30, x16
|
|
218
|
+
eor x28, x30, x28, ror #63
|
|
219
|
+
str x28, [sp, #0x18]
|
|
220
|
+
eor x29, x29, x17, ror #36
|
|
221
|
+
eor x28, x1, x2, ror #61
|
|
222
|
+
eor x19, x30, x19, ror #37
|
|
223
|
+
eor x29, x29, x20, ror #2
|
|
224
|
+
eor x28, x28, x4, ror #54
|
|
225
|
+
eor x26, x26, x0, ror #55
|
|
226
|
+
eor x28, x28, x3, ror #39
|
|
227
|
+
eor x28, x28, x5, ror #25
|
|
228
|
+
ror x0, x0, #0x38
|
|
229
|
+
eor x0, x0, x29, ror #63
|
|
230
|
+
eor x27, x28, x27, ror #61
|
|
231
|
+
eor x13, x0, x13, ror #46
|
|
232
|
+
eor x28, x29, x28, ror #63
|
|
233
|
+
eor x29, x30, x20, ror #2
|
|
234
|
+
eor x20, x26, x3, ror #39
|
|
235
|
+
eor x11, x0, x11, ror #50
|
|
236
|
+
eor x25, x28, x25, ror #9
|
|
237
|
+
eor x3, x28, x21, ror #20
|
|
238
|
+
eor x21, x26, x1
|
|
239
|
+
eor x9, x27, x9, ror #49
|
|
240
|
+
eor x24, x28, x24, ror #28
|
|
241
|
+
eor x1, x30, x17, ror #36
|
|
242
|
+
eor x14, x0, x14, ror #8
|
|
243
|
+
eor x22, x28, x22, ror #44
|
|
244
|
+
eor x8, x27, x8, ror #56
|
|
245
|
+
eor x17, x27, x7, ror #19
|
|
246
|
+
eor x15, x0, x15, ror #62
|
|
247
|
+
bic x7, x20, x22, ror #47
|
|
248
|
+
eor x4, x26, x4, ror #54
|
|
249
|
+
eor x0, x0, x12, ror #3
|
|
250
|
+
eor x28, x28, x23, ror #58
|
|
251
|
+
eor x23, x26, x2, ror #61
|
|
252
|
+
eor x26, x26, x5, ror #25
|
|
253
|
+
eor x2, x7, x16, ror #39
|
|
254
|
+
bic x7, x9, x20, ror #42
|
|
255
|
+
bic x30, x15, x9, ror #16
|
|
256
|
+
eor x7, x7, x22, ror #25
|
|
257
|
+
eor x12, x30, x20, ror #58
|
|
258
|
+
bic x20, x22, x16, ror #56
|
|
259
|
+
eor x30, x27, x6, ror #43
|
|
260
|
+
eor x22, x20, x15, ror #23
|
|
261
|
+
bic x6, x19, x13, ror #42
|
|
262
|
+
eor x6, x6, x17, ror #41
|
|
263
|
+
bic x5, x13, x17, ror #63
|
|
264
|
+
eor x5, x21, x5, ror #21
|
|
265
|
+
bic x17, x17, x21, ror #44
|
|
266
|
+
eor x27, x27, x10, ror #23
|
|
267
|
+
bic x21, x21, x25, ror #50
|
|
268
|
+
bic x20, x27, x4, ror #25
|
|
269
|
+
bic x10, x16, x15, ror #31
|
|
270
|
+
eor x16, x21, x19, ror #43
|
|
271
|
+
eor x21, x17, x25, ror #30
|
|
272
|
+
bic x19, x25, x19, ror #57
|
|
273
|
+
ldr x25, [sp, #0x10]
|
|
274
|
+
eor x17, x10, x9, ror #47
|
|
275
|
+
ldr x9, [sp, #0x8]
|
|
276
|
+
eor x15, x20, x28, ror #27
|
|
277
|
+
bic x20, x4, x28, ror #2
|
|
278
|
+
eor x10, x20, x1, ror #50
|
|
279
|
+
bic x20, x11, x27, ror #60
|
|
280
|
+
eor x20, x20, x4, ror #21
|
|
281
|
+
bic x4, x28, x1, ror #48
|
|
282
|
+
bic x1, x1, x11, ror #57
|
|
283
|
+
ldr x28, [x9, x25, lsl #3]
|
|
284
|
+
ldr x9, [sp, #0x18]
|
|
285
|
+
add x25, x25, #0x1
|
|
286
|
+
str x25, [sp, #0x10]
|
|
287
|
+
cmp x25, #0x17
|
|
288
|
+
eor x25, x1, x27, ror #53
|
|
289
|
+
bic x27, x30, x26, ror #47
|
|
290
|
+
eor x1, x5, x28
|
|
291
|
+
eor x5, x4, x11, ror #41
|
|
292
|
+
eor x11, x19, x13, ror #35
|
|
293
|
+
bic x13, x26, x24, ror #10
|
|
294
|
+
eor x28, x27, x24, ror #57
|
|
295
|
+
bic x27, x24, x9, ror #47
|
|
296
|
+
bic x19, x23, x3, ror #9
|
|
297
|
+
bic x4, x29, x14, ror #41
|
|
298
|
+
eor x24, x19, x29, ror #44
|
|
299
|
+
bic x29, x3, x29, ror #35
|
|
300
|
+
eor x13, x13, x9, ror #57
|
|
301
|
+
eor x19, x29, x14, ror #12
|
|
302
|
+
bic x29, x9, x0, ror #19
|
|
303
|
+
bic x14, x14, x8, ror #5
|
|
304
|
+
eor x9, x14, x23, ror #43
|
|
305
|
+
eor x14, x4, x8, ror #46
|
|
306
|
+
bic x23, x8, x23, ror #38
|
|
307
|
+
eor x8, x27, x0, ror #2
|
|
308
|
+
eor x4, x23, x3, ror #47
|
|
309
|
+
bic x3, x0, x30, ror #5
|
|
310
|
+
eor x23, x3, x26, ror #52
|
|
311
|
+
eor x3, x29, x30, ror #24
|
|
312
|
+
b.le Lkeccak_f1600_x1_scalar_loop
|
|
313
|
+
ror x6, x6, #0x2b
|
|
314
|
+
ror x11, x11, #0x32
|
|
315
|
+
ror x21, x21, #0x14
|
|
316
|
+
ror x2, x2, #0x3d
|
|
317
|
+
ror x7, x7, #0x13
|
|
318
|
+
ror x12, x12, #0x3
|
|
319
|
+
ror x17, x17, #0x24
|
|
320
|
+
ror x22, x22, #0x2c
|
|
321
|
+
ror x3, x3, #0x27
|
|
322
|
+
ror x8, x8, #0x38
|
|
323
|
+
ror x13, x13, #0x2e
|
|
324
|
+
ror x28, x28, #0x3f
|
|
325
|
+
ror x23, x23, #0x3a
|
|
326
|
+
ror x4, x4, #0x36
|
|
327
|
+
ror x9, x9, #0x31
|
|
328
|
+
ror x14, x14, #0x8
|
|
329
|
+
ror x19, x19, #0x25
|
|
330
|
+
ror x24, x24, #0x1c
|
|
331
|
+
ror x5, x5, #0x19
|
|
332
|
+
ror x10, x10, #0x17
|
|
333
|
+
ror x15, x15, #0x3e
|
|
334
|
+
ror x20, x20, #0x2
|
|
335
|
+
ror x25, x25, #0x9
|
|
336
|
+
ldr x0, [sp]
|
|
337
|
+
stp x1, x6, [x0]
|
|
338
|
+
stp x11, x16, [x0, #0x10]
|
|
339
|
+
stp x21, x2, [x0, #0x20]
|
|
340
|
+
stp x7, x12, [x0, #0x30]
|
|
341
|
+
stp x17, x22, [x0, #0x40]
|
|
342
|
+
stp x3, x8, [x0, #0x50]
|
|
343
|
+
stp x13, x28, [x0, #0x60]
|
|
344
|
+
stp x23, x4, [x0, #0x70]
|
|
345
|
+
stp x9, x14, [x0, #0x80]
|
|
346
|
+
stp x19, x24, [x0, #0x90]
|
|
347
|
+
stp x5, x10, [x0, #0xa0]
|
|
348
|
+
stp x15, x20, [x0, #0xb0]
|
|
349
|
+
str x25, [x0, #0xc0]
|
|
350
|
+
ldp x19, x20, [sp, #0x20]
|
|
351
|
+
.cfi_restore x19
|
|
352
|
+
.cfi_restore x20
|
|
353
|
+
ldp x21, x22, [sp, #0x30]
|
|
354
|
+
.cfi_restore x21
|
|
355
|
+
.cfi_restore x22
|
|
356
|
+
ldp x23, x24, [sp, #0x40]
|
|
357
|
+
.cfi_restore x23
|
|
358
|
+
.cfi_restore x24
|
|
359
|
+
ldp x25, x26, [sp, #0x50]
|
|
360
|
+
.cfi_restore x25
|
|
361
|
+
.cfi_restore x26
|
|
362
|
+
ldp x27, x28, [sp, #0x60]
|
|
363
|
+
.cfi_restore x27
|
|
364
|
+
.cfi_restore x28
|
|
365
|
+
ldp x29, x30, [sp, #0x70]
|
|
366
|
+
.cfi_restore x29
|
|
367
|
+
.cfi_restore x30
|
|
368
|
+
add sp, sp, #0x80
|
|
369
|
+
.cfi_adjust_cfa_offset -0x80
|
|
370
|
+
ret
|
|
371
|
+
.cfi_endproc
|
|
372
|
+
|
|
373
|
+
MLD_ASM_FN_SIZE(keccak_f1600_x1_scalar_asm)
|
|
374
|
+
|
|
375
|
+
#endif /* MLD_FIPS202_AARCH64_NEED_X1_SCALAR && \
|
|
376
|
+
!MLD_CONFIG_MULTILEVEL_NO_SHARED */
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) The mlkem-native project authors
|
|
3
|
+
* Copyright (c) The mldsa-native project authors
|
|
4
|
+
* Copyright (c) 2021-2022 Arm Limited
|
|
5
|
+
* Copyright (c) 2022 Matthias Kannwischer
|
|
6
|
+
* SPDX-License-Identifier: Apache-2.0 OR ISC OR MIT
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
/* References
|
|
10
|
+
* ==========
|
|
11
|
+
*
|
|
12
|
+
* - [HYBRID]
|
|
13
|
+
* Hybrid scalar/vector implementations of Keccak and SPHINCS+ on AArch64
|
|
14
|
+
* Becker, Kannwischer
|
|
15
|
+
* https://eprint.iacr.org/2022/1243
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
/*yaml
|
|
19
|
+
Name: keccak_f1600_x1_v84a_asm
|
|
20
|
+
Description: AArch64 ARMv8.4-A implementation of Keccak-f[1600] permutation for single state
|
|
21
|
+
Signature: void mld_keccak_f1600_x1_v84a_asm(uint64_t state[25], const uint64_t rc[24])
|
|
22
|
+
ABI:
|
|
23
|
+
x0:
|
|
24
|
+
type: buffer
|
|
25
|
+
size_bytes: 200
|
|
26
|
+
permissions: read/write
|
|
27
|
+
c_parameter: uint64_t state[25]
|
|
28
|
+
description: Keccak state (25 x uint64_t)
|
|
29
|
+
x1:
|
|
30
|
+
type: buffer
|
|
31
|
+
size_bytes: 192
|
|
32
|
+
permissions: read-only
|
|
33
|
+
c_parameter: const uint64_t rc[24]
|
|
34
|
+
description: Round constants (24 x uint64_t)
|
|
35
|
+
Stack:
|
|
36
|
+
bytes: 64
|
|
37
|
+
description: register preservation
|
|
38
|
+
*/
|
|
39
|
+
|
|
40
|
+
//
|
|
41
|
+
// Author: Hanno Becker <hanno.becker@arm.com>
|
|
42
|
+
// Author: Matthias Kannwischer <matthias@kannwischer.eu>
|
|
43
|
+
//
|
|
44
|
+
// This implementation is essentially from the paper @[HYBRID].
|
|
45
|
+
// The only difference is interleaving/deinterleaving of Keccak state
|
|
46
|
+
// during load and store, so that the caller need not do this.
|
|
47
|
+
//
|
|
48
|
+
|
|
49
|
+
#include "../../../../common.h"
|
|
50
|
+
#if defined(MLD_FIPS202_AARCH64_NEED_X1_V84A) && \
|
|
51
|
+
!defined(MLD_CONFIG_MULTILEVEL_NO_SHARED)
|
|
52
|
+
|
|
53
|
+
#if defined(__ARM_FEATURE_SHA3)
|
|
54
|
+
|
|
55
|
+
/*
|
|
56
|
+
* WARNING: This file is auto-derived from the mldsa-native source file
|
|
57
|
+
* dev/fips202/aarch64/src/keccak_f1600_x1_v84a_asm.S using scripts/simpasm. Do not modify it directly.
|
|
58
|
+
*/
|
|
59
|
+
|
|
60
|
+
#if defined(__ELF__)
|
|
61
|
+
.section .note.GNU-stack,"",@progbits
|
|
62
|
+
#endif
|
|
63
|
+
|
|
64
|
+
.text
|
|
65
|
+
.balign 4
|
|
66
|
+
.global MLD_ASM_NAMESPACE(keccak_f1600_x1_v84a_asm)
|
|
67
|
+
MLD_ASM_FN_SYMBOL(keccak_f1600_x1_v84a_asm)
|
|
68
|
+
|
|
69
|
+
.cfi_startproc
|
|
70
|
+
sub sp, sp, #0x40
|
|
71
|
+
.cfi_adjust_cfa_offset 0x40
|
|
72
|
+
stp d8, d9, [sp]
|
|
73
|
+
.cfi_rel_offset d8, 0x0
|
|
74
|
+
.cfi_rel_offset d9, 0x8
|
|
75
|
+
stp d10, d11, [sp, #0x10]
|
|
76
|
+
.cfi_rel_offset d10, 0x10
|
|
77
|
+
.cfi_rel_offset d11, 0x18
|
|
78
|
+
stp d12, d13, [sp, #0x20]
|
|
79
|
+
.cfi_rel_offset d12, 0x20
|
|
80
|
+
.cfi_rel_offset d13, 0x28
|
|
81
|
+
stp d14, d15, [sp, #0x30]
|
|
82
|
+
.cfi_rel_offset d14, 0x30
|
|
83
|
+
.cfi_rel_offset d15, 0x38
|
|
84
|
+
ldp d0, d1, [x0]
|
|
85
|
+
ldp d2, d3, [x0, #0x10]
|
|
86
|
+
ldp d4, d5, [x0, #0x20]
|
|
87
|
+
ldp d6, d7, [x0, #0x30]
|
|
88
|
+
ldp d8, d9, [x0, #0x40]
|
|
89
|
+
ldp d10, d11, [x0, #0x50]
|
|
90
|
+
ldp d12, d13, [x0, #0x60]
|
|
91
|
+
ldp d14, d15, [x0, #0x70]
|
|
92
|
+
ldp d16, d17, [x0, #0x80]
|
|
93
|
+
ldp d18, d19, [x0, #0x90]
|
|
94
|
+
ldp d20, d21, [x0, #0xa0]
|
|
95
|
+
ldp d22, d23, [x0, #0xb0]
|
|
96
|
+
ldr d24, [x0, #0xc0]
|
|
97
|
+
mov x2, #0x18 // =24
|
|
98
|
+
|
|
99
|
+
Lkeccak_f1600_x1_v84a_loop:
|
|
100
|
+
eor3 v30.16b, v0.16b, v5.16b, v10.16b
|
|
101
|
+
eor3 v29.16b, v1.16b, v6.16b, v11.16b
|
|
102
|
+
eor3 v28.16b, v2.16b, v7.16b, v12.16b
|
|
103
|
+
eor3 v27.16b, v3.16b, v8.16b, v13.16b
|
|
104
|
+
eor3 v26.16b, v4.16b, v9.16b, v14.16b
|
|
105
|
+
eor3 v30.16b, v30.16b, v15.16b, v20.16b
|
|
106
|
+
eor3 v29.16b, v29.16b, v16.16b, v21.16b
|
|
107
|
+
eor3 v28.16b, v28.16b, v17.16b, v22.16b
|
|
108
|
+
eor3 v27.16b, v27.16b, v18.16b, v23.16b
|
|
109
|
+
eor3 v26.16b, v26.16b, v19.16b, v24.16b
|
|
110
|
+
rax1 v25.2d, v30.2d, v28.2d
|
|
111
|
+
rax1 v28.2d, v28.2d, v26.2d
|
|
112
|
+
rax1 v26.2d, v26.2d, v29.2d
|
|
113
|
+
rax1 v29.2d, v29.2d, v27.2d
|
|
114
|
+
rax1 v27.2d, v27.2d, v30.2d
|
|
115
|
+
eor v30.16b, v0.16b, v26.16b
|
|
116
|
+
xar v0.2d, v2.2d, v29.2d, #0x2
|
|
117
|
+
xar v2.2d, v12.2d, v29.2d, #0x15
|
|
118
|
+
xar v12.2d, v13.2d, v28.2d, #0x27
|
|
119
|
+
xar v13.2d, v19.2d, v27.2d, #0x38
|
|
120
|
+
xar v19.2d, v23.2d, v28.2d, #0x8
|
|
121
|
+
xar v23.2d, v15.2d, v26.2d, #0x17
|
|
122
|
+
xar v15.2d, v1.2d, v25.2d, #0x3f
|
|
123
|
+
xar v1.2d, v8.2d, v28.2d, #0x9
|
|
124
|
+
xar v8.2d, v16.2d, v25.2d, #0x13
|
|
125
|
+
xar v16.2d, v7.2d, v29.2d, #0x3a
|
|
126
|
+
xar v7.2d, v10.2d, v26.2d, #0x3d
|
|
127
|
+
xar v10.2d, v3.2d, v28.2d, #0x24
|
|
128
|
+
xar v3.2d, v18.2d, v28.2d, #0x2b
|
|
129
|
+
xar v18.2d, v17.2d, v29.2d, #0x31
|
|
130
|
+
xar v17.2d, v11.2d, v25.2d, #0x36
|
|
131
|
+
xar v11.2d, v9.2d, v27.2d, #0x2c
|
|
132
|
+
xar v9.2d, v22.2d, v29.2d, #0x3
|
|
133
|
+
xar v22.2d, v14.2d, v27.2d, #0x19
|
|
134
|
+
xar v14.2d, v20.2d, v26.2d, #0x2e
|
|
135
|
+
xar v20.2d, v4.2d, v27.2d, #0x25
|
|
136
|
+
xar v4.2d, v24.2d, v27.2d, #0x32
|
|
137
|
+
xar v24.2d, v21.2d, v25.2d, #0x3e
|
|
138
|
+
xar v21.2d, v5.2d, v26.2d, #0x1c
|
|
139
|
+
xar v27.2d, v6.2d, v25.2d, #0x14
|
|
140
|
+
ld1r { v31.2d }, [x1], #8
|
|
141
|
+
bcax v5.16b, v10.16b, v7.16b, v11.16b
|
|
142
|
+
bcax v6.16b, v11.16b, v8.16b, v7.16b
|
|
143
|
+
bcax v7.16b, v7.16b, v9.16b, v8.16b
|
|
144
|
+
bcax v8.16b, v8.16b, v10.16b, v9.16b
|
|
145
|
+
bcax v9.16b, v9.16b, v11.16b, v10.16b
|
|
146
|
+
bcax v10.16b, v15.16b, v12.16b, v16.16b
|
|
147
|
+
bcax v11.16b, v16.16b, v13.16b, v12.16b
|
|
148
|
+
bcax v12.16b, v12.16b, v14.16b, v13.16b
|
|
149
|
+
bcax v13.16b, v13.16b, v15.16b, v14.16b
|
|
150
|
+
bcax v14.16b, v14.16b, v16.16b, v15.16b
|
|
151
|
+
bcax v15.16b, v20.16b, v17.16b, v21.16b
|
|
152
|
+
bcax v16.16b, v21.16b, v18.16b, v17.16b
|
|
153
|
+
bcax v17.16b, v17.16b, v19.16b, v18.16b
|
|
154
|
+
bcax v18.16b, v18.16b, v20.16b, v19.16b
|
|
155
|
+
bcax v19.16b, v19.16b, v21.16b, v20.16b
|
|
156
|
+
bcax v20.16b, v0.16b, v22.16b, v1.16b
|
|
157
|
+
bcax v21.16b, v1.16b, v23.16b, v22.16b
|
|
158
|
+
bcax v22.16b, v22.16b, v24.16b, v23.16b
|
|
159
|
+
bcax v23.16b, v23.16b, v0.16b, v24.16b
|
|
160
|
+
bcax v24.16b, v24.16b, v1.16b, v0.16b
|
|
161
|
+
bcax v0.16b, v30.16b, v2.16b, v27.16b
|
|
162
|
+
bcax v1.16b, v27.16b, v3.16b, v2.16b
|
|
163
|
+
bcax v2.16b, v2.16b, v4.16b, v3.16b
|
|
164
|
+
bcax v3.16b, v3.16b, v30.16b, v4.16b
|
|
165
|
+
bcax v4.16b, v4.16b, v27.16b, v30.16b
|
|
166
|
+
eor v0.16b, v0.16b, v31.16b
|
|
167
|
+
sub x2, x2, #0x1
|
|
168
|
+
cbnz x2, Lkeccak_f1600_x1_v84a_loop
|
|
169
|
+
stp d0, d1, [x0]
|
|
170
|
+
stp d2, d3, [x0, #0x10]
|
|
171
|
+
stp d4, d5, [x0, #0x20]
|
|
172
|
+
stp d6, d7, [x0, #0x30]
|
|
173
|
+
stp d8, d9, [x0, #0x40]
|
|
174
|
+
stp d10, d11, [x0, #0x50]
|
|
175
|
+
stp d12, d13, [x0, #0x60]
|
|
176
|
+
stp d14, d15, [x0, #0x70]
|
|
177
|
+
stp d16, d17, [x0, #0x80]
|
|
178
|
+
stp d18, d19, [x0, #0x90]
|
|
179
|
+
stp d20, d21, [x0, #0xa0]
|
|
180
|
+
stp d22, d23, [x0, #0xb0]
|
|
181
|
+
str d24, [x0, #0xc0]
|
|
182
|
+
ldp d8, d9, [sp]
|
|
183
|
+
.cfi_restore d8
|
|
184
|
+
.cfi_restore d9
|
|
185
|
+
ldp d10, d11, [sp, #0x10]
|
|
186
|
+
.cfi_restore d10
|
|
187
|
+
.cfi_restore d11
|
|
188
|
+
ldp d12, d13, [sp, #0x20]
|
|
189
|
+
.cfi_restore d12
|
|
190
|
+
.cfi_restore d13
|
|
191
|
+
ldp d14, d15, [sp, #0x30]
|
|
192
|
+
.cfi_restore d14
|
|
193
|
+
.cfi_restore d15
|
|
194
|
+
add sp, sp, #0x40
|
|
195
|
+
.cfi_adjust_cfa_offset -0x40
|
|
196
|
+
ret
|
|
197
|
+
.cfi_endproc
|
|
198
|
+
|
|
199
|
+
MLD_ASM_FN_SIZE(keccak_f1600_x1_v84a_asm)
|
|
200
|
+
|
|
201
|
+
#endif /* __ARM_FEATURE_SHA3 */
|
|
202
|
+
|
|
203
|
+
#endif /* MLD_FIPS202_AARCH64_NEED_X1_V84A && !MLD_CONFIG_MULTILEVEL_NO_SHARED \
|
|
204
|
+
*/
|