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,46 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) The mlkem-native project authors
|
|
3
|
+
* SPDX-License-Identifier: Apache-2.0 OR ISC OR MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/*
|
|
7
|
+
* WARNING: This file is auto-generated from scripts/autogen
|
|
8
|
+
* in the mlkem-native repository.
|
|
9
|
+
* Do not modify it directly.
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
#include "../../../../common.h"
|
|
13
|
+
|
|
14
|
+
#if (defined(MLK_FIPS202_AARCH64_NEED_X1_SCALAR) || \
|
|
15
|
+
defined(MLK_FIPS202_AARCH64_NEED_X1_V84A) || \
|
|
16
|
+
defined(MLK_FIPS202_AARCH64_NEED_X2_V84A) || \
|
|
17
|
+
defined(MLK_FIPS202_AARCH64_NEED_X4_V8A_SCALAR_HYBRID) || \
|
|
18
|
+
defined(MLK_FIPS202_AARCH64_NEED_X4_V8A_V84A_SCALAR_HYBRID)) && \
|
|
19
|
+
!defined(MLK_CONFIG_MULTILEVEL_NO_SHARED)
|
|
20
|
+
|
|
21
|
+
#include "fips202_native_aarch64.h"
|
|
22
|
+
|
|
23
|
+
MLK_ALIGN const uint64_t mlk_keccakf1600_round_constants[] = {
|
|
24
|
+
0x0000000000000001, 0x0000000000008082, 0x800000000000808a,
|
|
25
|
+
0x8000000080008000, 0x000000000000808b, 0x0000000080000001,
|
|
26
|
+
0x8000000080008081, 0x8000000000008009, 0x000000000000008a,
|
|
27
|
+
0x0000000000000088, 0x0000000080008009, 0x000000008000000a,
|
|
28
|
+
0x000000008000808b, 0x800000000000008b, 0x8000000000008089,
|
|
29
|
+
0x8000000000008003, 0x8000000000008002, 0x8000000000000080,
|
|
30
|
+
0x000000000000800a, 0x800000008000000a, 0x8000000080008081,
|
|
31
|
+
0x8000000000008080, 0x0000000080000001, 0x8000000080008008,
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
#else /* (MLK_FIPS202_AARCH64_NEED_X1_SCALAR || \
|
|
35
|
+
MLK_FIPS202_AARCH64_NEED_X1_V84A || MLK_FIPS202_AARCH64_NEED_X2_V84A \
|
|
36
|
+
|| MLK_FIPS202_AARCH64_NEED_X4_V8A_SCALAR_HYBRID || \
|
|
37
|
+
MLK_FIPS202_AARCH64_NEED_X4_V8A_V84A_SCALAR_HYBRID) && \
|
|
38
|
+
!MLK_CONFIG_MULTILEVEL_NO_SHARED */
|
|
39
|
+
|
|
40
|
+
MLK_EMPTY_CU(fips202_aarch64_round_constants)
|
|
41
|
+
|
|
42
|
+
#endif /* !((MLK_FIPS202_AARCH64_NEED_X1_SCALAR || \
|
|
43
|
+
MLK_FIPS202_AARCH64_NEED_X1_V84A || MLK_FIPS202_AARCH64_NEED_X2_V84A \
|
|
44
|
+
|| MLK_FIPS202_AARCH64_NEED_X4_V8A_SCALAR_HYBRID || \
|
|
45
|
+
MLK_FIPS202_AARCH64_NEED_X4_V8A_V84A_SCALAR_HYBRID) && \
|
|
46
|
+
!MLK_CONFIG_MULTILEVEL_NO_SHARED) */
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) The mlkem-native project authors
|
|
3
|
+
* SPDX-License-Identifier: Apache-2.0 OR ISC OR MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
#ifndef MLK_FIPS202_NATIVE_AARCH64_X1_SCALAR_H
|
|
7
|
+
#define MLK_FIPS202_NATIVE_AARCH64_X1_SCALAR_H
|
|
8
|
+
|
|
9
|
+
/* Part of backend API */
|
|
10
|
+
#define MLK_USE_FIPS202_X1_NATIVE
|
|
11
|
+
/* Guard for assembly file */
|
|
12
|
+
#define MLK_FIPS202_AARCH64_NEED_X1_SCALAR
|
|
13
|
+
|
|
14
|
+
#if !defined(__ASSEMBLER__)
|
|
15
|
+
#include "../api.h"
|
|
16
|
+
#include "src/fips202_native_aarch64.h"
|
|
17
|
+
MLK_MUST_CHECK_RETURN_VALUE
|
|
18
|
+
static MLK_INLINE int mlk_keccak_f1600_x1_native(uint64_t *state)
|
|
19
|
+
{
|
|
20
|
+
mlk_keccak_f1600_x1_scalar_asm(state, mlk_keccakf1600_round_constants);
|
|
21
|
+
return MLK_NATIVE_FUNC_SUCCESS;
|
|
22
|
+
}
|
|
23
|
+
#endif /* !__ASSEMBLER__ */
|
|
24
|
+
|
|
25
|
+
#endif /* !MLK_FIPS202_NATIVE_AARCH64_X1_SCALAR_H */
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) The mlkem-native project authors
|
|
3
|
+
* SPDX-License-Identifier: Apache-2.0 OR ISC OR MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
#ifndef MLK_FIPS202_NATIVE_AARCH64_X1_V84A_H
|
|
7
|
+
#define MLK_FIPS202_NATIVE_AARCH64_X1_V84A_H
|
|
8
|
+
|
|
9
|
+
#if !defined(__ARM_FEATURE_SHA3)
|
|
10
|
+
#error This backend can only be used if SHA3 extensions are available.
|
|
11
|
+
#endif
|
|
12
|
+
|
|
13
|
+
/* Part of backend API */
|
|
14
|
+
#define MLK_USE_FIPS202_X1_NATIVE
|
|
15
|
+
/* Guard for assembly file */
|
|
16
|
+
#define MLK_FIPS202_AARCH64_NEED_X1_V84A
|
|
17
|
+
|
|
18
|
+
#if !defined(__ASSEMBLER__)
|
|
19
|
+
#include "../api.h"
|
|
20
|
+
#include "src/fips202_native_aarch64.h"
|
|
21
|
+
MLK_MUST_CHECK_RETURN_VALUE
|
|
22
|
+
static MLK_INLINE int mlk_keccak_f1600_x1_native(uint64_t *state)
|
|
23
|
+
{
|
|
24
|
+
if (!mlk_sys_check_capability(MLK_SYS_CAP_SHA3))
|
|
25
|
+
{
|
|
26
|
+
return MLK_NATIVE_FUNC_FALLBACK;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
mlk_keccak_f1600_x1_v84a_asm(state, mlk_keccakf1600_round_constants);
|
|
30
|
+
return MLK_NATIVE_FUNC_SUCCESS;
|
|
31
|
+
}
|
|
32
|
+
#endif /* !__ASSEMBLER__ */
|
|
33
|
+
|
|
34
|
+
#endif /* !MLK_FIPS202_NATIVE_AARCH64_X1_V84A_H */
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) The mlkem-native project authors
|
|
3
|
+
* SPDX-License-Identifier: Apache-2.0 OR ISC OR MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
#ifndef MLK_FIPS202_NATIVE_AARCH64_X2_V84A_H
|
|
7
|
+
#define MLK_FIPS202_NATIVE_AARCH64_X2_V84A_H
|
|
8
|
+
|
|
9
|
+
#if !defined(__ARM_FEATURE_SHA3)
|
|
10
|
+
#error This backend can only be used if SHA3 extensions are available.
|
|
11
|
+
#endif
|
|
12
|
+
|
|
13
|
+
/* Part of backend API */
|
|
14
|
+
#define MLK_USE_FIPS202_X4_NATIVE
|
|
15
|
+
/* Guard for assembly file */
|
|
16
|
+
#define MLK_FIPS202_AARCH64_NEED_X2_V84A
|
|
17
|
+
|
|
18
|
+
#if !defined(__ASSEMBLER__)
|
|
19
|
+
#include "../api.h"
|
|
20
|
+
#include "src/fips202_native_aarch64.h"
|
|
21
|
+
MLK_MUST_CHECK_RETURN_VALUE
|
|
22
|
+
static MLK_INLINE int mlk_keccak_f1600_x4_native(uint64_t *state)
|
|
23
|
+
{
|
|
24
|
+
if (!mlk_sys_check_capability(MLK_SYS_CAP_SHA3))
|
|
25
|
+
{
|
|
26
|
+
return MLK_NATIVE_FUNC_FALLBACK;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
mlk_keccak_f1600_x2_v84a_asm(state + 0 * 25, mlk_keccakf1600_round_constants);
|
|
30
|
+
mlk_keccak_f1600_x2_v84a_asm(state + 2 * 25, mlk_keccakf1600_round_constants);
|
|
31
|
+
return MLK_NATIVE_FUNC_SUCCESS;
|
|
32
|
+
}
|
|
33
|
+
#endif /* !__ASSEMBLER__ */
|
|
34
|
+
|
|
35
|
+
#endif /* !MLK_FIPS202_NATIVE_AARCH64_X2_V84A_H */
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) The mlkem-native project authors
|
|
3
|
+
* SPDX-License-Identifier: Apache-2.0 OR ISC OR MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
#ifndef MLK_FIPS202_NATIVE_AARCH64_X4_V8A_SCALAR_H
|
|
7
|
+
#define MLK_FIPS202_NATIVE_AARCH64_X4_V8A_SCALAR_H
|
|
8
|
+
|
|
9
|
+
/* Part of backend API */
|
|
10
|
+
#define MLK_USE_FIPS202_X4_NATIVE
|
|
11
|
+
/* Guard for assembly file */
|
|
12
|
+
#define MLK_FIPS202_AARCH64_NEED_X4_V8A_SCALAR_HYBRID
|
|
13
|
+
|
|
14
|
+
#if !defined(__ASSEMBLER__)
|
|
15
|
+
#include "../api.h"
|
|
16
|
+
#include "src/fips202_native_aarch64.h"
|
|
17
|
+
MLK_MUST_CHECK_RETURN_VALUE
|
|
18
|
+
static MLK_INLINE int mlk_keccak_f1600_x4_native(uint64_t *state)
|
|
19
|
+
{
|
|
20
|
+
mlk_keccak_f1600_x4_v8a_scalar_hybrid_asm(state,
|
|
21
|
+
mlk_keccakf1600_round_constants);
|
|
22
|
+
return MLK_NATIVE_FUNC_SUCCESS;
|
|
23
|
+
}
|
|
24
|
+
#endif /* !__ASSEMBLER__ */
|
|
25
|
+
|
|
26
|
+
#endif /* !MLK_FIPS202_NATIVE_AARCH64_X4_V8A_SCALAR_H */
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) The mlkem-native project authors
|
|
3
|
+
* SPDX-License-Identifier: Apache-2.0 OR ISC OR MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
#ifndef MLK_FIPS202_NATIVE_AARCH64_X4_V8A_V84A_SCALAR_H
|
|
7
|
+
#define MLK_FIPS202_NATIVE_AARCH64_X4_V8A_V84A_SCALAR_H
|
|
8
|
+
|
|
9
|
+
#if !defined(__ARM_FEATURE_SHA3)
|
|
10
|
+
#error This backend can only be used if SHA3 extensions are available.
|
|
11
|
+
#endif
|
|
12
|
+
|
|
13
|
+
/* Part of backend API */
|
|
14
|
+
#define MLK_USE_FIPS202_X4_NATIVE
|
|
15
|
+
/* Guard for assembly file */
|
|
16
|
+
#define MLK_FIPS202_AARCH64_NEED_X4_V8A_V84A_SCALAR_HYBRID
|
|
17
|
+
|
|
18
|
+
#if !defined(__ASSEMBLER__)
|
|
19
|
+
#include "../api.h"
|
|
20
|
+
#include "src/fips202_native_aarch64.h"
|
|
21
|
+
MLK_MUST_CHECK_RETURN_VALUE
|
|
22
|
+
static MLK_INLINE int mlk_keccak_f1600_x4_native(uint64_t *state)
|
|
23
|
+
{
|
|
24
|
+
if (!mlk_sys_check_capability(MLK_SYS_CAP_SHA3))
|
|
25
|
+
{
|
|
26
|
+
return MLK_NATIVE_FUNC_FALLBACK;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
mlk_keccak_f1600_x4_v8a_v84a_scalar_hybrid_asm(
|
|
30
|
+
state, mlk_keccakf1600_round_constants);
|
|
31
|
+
return MLK_NATIVE_FUNC_SUCCESS;
|
|
32
|
+
}
|
|
33
|
+
#endif /* !__ASSEMBLER__ */
|
|
34
|
+
|
|
35
|
+
#endif /* !MLK_FIPS202_NATIVE_AARCH64_X4_V8A_V84A_SCALAR_H */
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) The mlkem-native project authors
|
|
3
|
+
* SPDX-License-Identifier: Apache-2.0 OR ISC OR MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
#ifndef MLK_FIPS202_NATIVE_API_H
|
|
7
|
+
#define MLK_FIPS202_NATIVE_API_H
|
|
8
|
+
/*
|
|
9
|
+
* FIPS-202 native interface
|
|
10
|
+
*
|
|
11
|
+
* This header is primarily for documentation purposes.
|
|
12
|
+
* It should not be included by backend implementations.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
#include "../../cbmc.h"
|
|
16
|
+
|
|
17
|
+
/* Backends must return MLK_NATIVE_FUNC_SUCCESS upon success. */
|
|
18
|
+
#define MLK_NATIVE_FUNC_SUCCESS (0)
|
|
19
|
+
/* Backends may return MLK_NATIVE_FUNC_FALLBACK to signal to the frontend that
|
|
20
|
+
* the target/parameters are unsupported; typically, this would be because of
|
|
21
|
+
* dependencies on CPU features not detected on the host CPU. In this case,
|
|
22
|
+
* the frontend falls back to the default C implementation. */
|
|
23
|
+
#define MLK_NATIVE_FUNC_FALLBACK (-1)
|
|
24
|
+
|
|
25
|
+
/*
|
|
26
|
+
* This is the C<->native interface allowing for the drop-in
|
|
27
|
+
* of custom Keccak-F1600 implementations.
|
|
28
|
+
*
|
|
29
|
+
* A _backend_ is a specific implementation of parts of this interface.
|
|
30
|
+
*
|
|
31
|
+
* You can replace 1-fold or 4-fold batched Keccak-F1600.
|
|
32
|
+
* To enable, set MLK_USE_FIPS202_X1_NATIVE or MLK_USE_FIPS202_X4_NATIVE
|
|
33
|
+
* in your backend, and define the inline wrappers mlk_keccak_f1600_x1_native()
|
|
34
|
+
* and/or mlk_keccak_f1600_x4_native(), respectively, to forward to your
|
|
35
|
+
* implementation.
|
|
36
|
+
*/
|
|
37
|
+
|
|
38
|
+
#if defined(MLK_USE_FIPS202_X1_NATIVE)
|
|
39
|
+
MLK_MUST_CHECK_RETURN_VALUE
|
|
40
|
+
static MLK_INLINE int mlk_keccak_f1600_x1_native(uint64_t *state)
|
|
41
|
+
__contract__(
|
|
42
|
+
requires(memory_no_alias(state, sizeof(uint64_t) * 25 * 1))
|
|
43
|
+
assigns(memory_slice(state, sizeof(uint64_t) * 25 * 1))
|
|
44
|
+
ensures(return_value == MLK_NATIVE_FUNC_FALLBACK || return_value == MLK_NATIVE_FUNC_SUCCESS)
|
|
45
|
+
ensures((return_value == MLK_NATIVE_FUNC_FALLBACK) ==> array_unchanged_u64(state, 25 * 1)));
|
|
46
|
+
#endif /* MLK_USE_FIPS202_X1_NATIVE */
|
|
47
|
+
#if defined(MLK_USE_FIPS202_X4_NATIVE)
|
|
48
|
+
MLK_MUST_CHECK_RETURN_VALUE
|
|
49
|
+
static MLK_INLINE int mlk_keccak_f1600_x4_native(uint64_t *state)
|
|
50
|
+
__contract__(
|
|
51
|
+
requires(memory_no_alias(state, sizeof(uint64_t) * 25 * 4))
|
|
52
|
+
assigns(memory_slice(state, sizeof(uint64_t) * 25 * 4))
|
|
53
|
+
ensures(return_value == MLK_NATIVE_FUNC_FALLBACK || return_value == MLK_NATIVE_FUNC_SUCCESS)
|
|
54
|
+
ensures((return_value == MLK_NATIVE_FUNC_FALLBACK) ==> array_unchanged_u64(state, 25 * 4)));
|
|
55
|
+
#endif /* MLK_USE_FIPS202_X4_NATIVE */
|
|
56
|
+
|
|
57
|
+
/*
|
|
58
|
+
* Native x4 XOR bytes and extract bytes interface.
|
|
59
|
+
*
|
|
60
|
+
* These functions allow backends to provide optimized implementations for
|
|
61
|
+
* XORing input data into the state and extracting output data from the state.
|
|
62
|
+
* This is particularly useful for backends that use a different internal state
|
|
63
|
+
* representation (e.g., bit-interleaved), as conversion can happen during
|
|
64
|
+
* XOR/extract rather than before/after each permutation.
|
|
65
|
+
*
|
|
66
|
+
* NOTE: We assume that the custom representation of the zero state is the
|
|
67
|
+
* all-zero state.
|
|
68
|
+
*
|
|
69
|
+
* MLK_USE_FIPS202_X4_XOR_BYTES_NATIVE: Backend provides native XOR bytes
|
|
70
|
+
* MLK_USE_FIPS202_X4_EXTRACT_BYTES_NATIVE: Backend provides native extract
|
|
71
|
+
* bytes
|
|
72
|
+
*/
|
|
73
|
+
|
|
74
|
+
#if defined(MLK_USE_FIPS202_X4_XOR_BYTES_NATIVE)
|
|
75
|
+
MLK_MUST_CHECK_RETURN_VALUE
|
|
76
|
+
static MLK_INLINE int mlk_keccakf1600_xor_bytes_x4_native(
|
|
77
|
+
uint64_t *state, const unsigned char *data0, const unsigned char *data1,
|
|
78
|
+
const unsigned char *data2, const unsigned char *data3, unsigned offset,
|
|
79
|
+
unsigned length)
|
|
80
|
+
__contract__(
|
|
81
|
+
requires(0 <= offset && offset <= 25 * sizeof(uint64_t) &&
|
|
82
|
+
0 <= length && length <= 25 * sizeof(uint64_t) - offset)
|
|
83
|
+
requires(memory_no_alias(state, sizeof(uint64_t) * 25 * 4))
|
|
84
|
+
requires(memory_no_alias(data0, length))
|
|
85
|
+
requires((data0 == data1 &&
|
|
86
|
+
data0 == data2 &&
|
|
87
|
+
data0 == data3) ||
|
|
88
|
+
(memory_no_alias(data1, length) &&
|
|
89
|
+
memory_no_alias(data2, length) &&
|
|
90
|
+
memory_no_alias(data3, length)))
|
|
91
|
+
assigns(memory_slice(state, sizeof(uint64_t) * 25 * 4))
|
|
92
|
+
ensures(return_value == MLK_NATIVE_FUNC_FALLBACK || return_value == MLK_NATIVE_FUNC_SUCCESS)
|
|
93
|
+
ensures((return_value == MLK_NATIVE_FUNC_FALLBACK) ==> array_unchanged_u64(state, 25 * 4)));
|
|
94
|
+
#endif /* MLK_USE_FIPS202_X4_XOR_BYTES_NATIVE */
|
|
95
|
+
|
|
96
|
+
#if defined(MLK_USE_FIPS202_X4_EXTRACT_BYTES_NATIVE)
|
|
97
|
+
MLK_MUST_CHECK_RETURN_VALUE
|
|
98
|
+
static MLK_INLINE int mlk_keccakf1600_extract_bytes_x4_native(
|
|
99
|
+
uint64_t *state, unsigned char *data0, unsigned char *data1,
|
|
100
|
+
unsigned char *data2, unsigned char *data3, unsigned offset,
|
|
101
|
+
unsigned length)
|
|
102
|
+
__contract__(
|
|
103
|
+
requires(0 <= offset && offset <= 25 * sizeof(uint64_t) &&
|
|
104
|
+
0 <= length && length <= 25 * sizeof(uint64_t) - offset)
|
|
105
|
+
requires(memory_no_alias(state, sizeof(uint64_t) * 25 * 4))
|
|
106
|
+
requires(memory_no_alias(data0, length))
|
|
107
|
+
requires(memory_no_alias(data1, length))
|
|
108
|
+
requires(memory_no_alias(data2, length))
|
|
109
|
+
requires(memory_no_alias(data3, length))
|
|
110
|
+
assigns(memory_slice(data0, length))
|
|
111
|
+
assigns(memory_slice(data1, length))
|
|
112
|
+
assigns(memory_slice(data2, length))
|
|
113
|
+
assigns(memory_slice(data3, length))
|
|
114
|
+
ensures(return_value == MLK_NATIVE_FUNC_FALLBACK || return_value == MLK_NATIVE_FUNC_SUCCESS));
|
|
115
|
+
#endif /* MLK_USE_FIPS202_X4_EXTRACT_BYTES_NATIVE */
|
|
116
|
+
|
|
117
|
+
#endif /* !MLK_FIPS202_NATIVE_API_H */
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
[//]: # (SPDX-License-Identifier: CC-BY-4.0)
|
|
2
|
+
|
|
3
|
+
# FIPS202 backend for Armv8.1-M + MVE
|
|
4
|
+
|
|
5
|
+
This directory contains the source code for a FIPS202 backend targeting
|
|
6
|
+
the Armv8.1-M + MVE/Helium architecture. It is automatically derived from
|
|
7
|
+
the respective development source in [dev/fips202/armv81m](../../../../../dev/fips202/armv81m).
|
|
8
|
+
|
|
9
|
+
**Warning:** This backend is still in active development and has not yet undergone
|
|
10
|
+
the same level of review as the rest of the code. Use at your own risk!
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) The mlkem-native project authors
|
|
3
|
+
* SPDX-License-Identifier: Apache-2.0 OR ISC OR MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
#ifndef MLK_FIPS202_NATIVE_ARMV81M_MVE_H
|
|
7
|
+
#define MLK_FIPS202_NATIVE_ARMV81M_MVE_H
|
|
8
|
+
|
|
9
|
+
#define MLK_FIPS202_NATIVE_ARMV81M
|
|
10
|
+
|
|
11
|
+
/* Part of backend API */
|
|
12
|
+
#define MLK_USE_FIPS202_X4_NATIVE
|
|
13
|
+
#define MLK_USE_FIPS202_X4_XOR_BYTES_NATIVE
|
|
14
|
+
#define MLK_USE_FIPS202_X4_EXTRACT_BYTES_NATIVE
|
|
15
|
+
/* Guard for assembly file */
|
|
16
|
+
#define MLK_FIPS202_ARMV81M_NEED_X4
|
|
17
|
+
|
|
18
|
+
#if !defined(__ASSEMBLER__)
|
|
19
|
+
#include "../api.h"
|
|
20
|
+
|
|
21
|
+
/*
|
|
22
|
+
* Native x4 permutation
|
|
23
|
+
* State is kept in bit-interleaved format.
|
|
24
|
+
*/
|
|
25
|
+
#define mlk_keccak_f1600_x4_native_impl \
|
|
26
|
+
MLK_NAMESPACE(keccak_f1600_x4_native_impl)
|
|
27
|
+
int mlk_keccak_f1600_x4_native_impl(uint64_t *state);
|
|
28
|
+
|
|
29
|
+
MLK_MUST_CHECK_RETURN_VALUE
|
|
30
|
+
static MLK_INLINE int mlk_keccak_f1600_x4_native(uint64_t *state)
|
|
31
|
+
{
|
|
32
|
+
return mlk_keccak_f1600_x4_native_impl(state);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/*
|
|
36
|
+
* Native x4 XOR bytes (with on-the-fly bit interleaving)
|
|
37
|
+
*/
|
|
38
|
+
#define mlk_keccak_f1600_x4_state_xor_bytes \
|
|
39
|
+
MLK_NAMESPACE(keccak_f1600_x4_state_xor_bytes_asm)
|
|
40
|
+
void mlk_keccak_f1600_x4_state_xor_bytes(void *state, const uint8_t *data0,
|
|
41
|
+
const uint8_t *data1,
|
|
42
|
+
const uint8_t *data2,
|
|
43
|
+
const uint8_t *data3, unsigned offset,
|
|
44
|
+
unsigned length);
|
|
45
|
+
|
|
46
|
+
MLK_MUST_CHECK_RETURN_VALUE
|
|
47
|
+
static MLK_INLINE int mlk_keccakf1600_xor_bytes_x4_native(
|
|
48
|
+
uint64_t *state, const uint8_t *data0, const uint8_t *data1,
|
|
49
|
+
const uint8_t *data2, const uint8_t *data3, unsigned offset,
|
|
50
|
+
unsigned length)
|
|
51
|
+
{
|
|
52
|
+
mlk_keccak_f1600_x4_state_xor_bytes(state, data0, data1, data2, data3, offset,
|
|
53
|
+
length);
|
|
54
|
+
return MLK_NATIVE_FUNC_SUCCESS;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/*
|
|
58
|
+
* Native x4 extract bytes (with on-the-fly bit de-interleaving)
|
|
59
|
+
*/
|
|
60
|
+
#define mlk_keccak_f1600_x4_state_extract_bytes \
|
|
61
|
+
MLK_NAMESPACE(keccak_f1600_x4_state_extract_bytes_asm)
|
|
62
|
+
void mlk_keccak_f1600_x4_state_extract_bytes(void *state, uint8_t *data0,
|
|
63
|
+
uint8_t *data1, uint8_t *data2,
|
|
64
|
+
uint8_t *data3, unsigned offset,
|
|
65
|
+
unsigned length);
|
|
66
|
+
|
|
67
|
+
MLK_MUST_CHECK_RETURN_VALUE
|
|
68
|
+
static MLK_INLINE int mlk_keccakf1600_extract_bytes_x4_native(
|
|
69
|
+
uint64_t *state, uint8_t *data0, uint8_t *data1, uint8_t *data2,
|
|
70
|
+
uint8_t *data3, unsigned offset, unsigned length)
|
|
71
|
+
{
|
|
72
|
+
mlk_keccak_f1600_x4_state_extract_bytes(state, data0, data1, data2, data3,
|
|
73
|
+
offset, length);
|
|
74
|
+
return MLK_NATIVE_FUNC_SUCCESS;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
#endif /* !__ASSEMBLER__ */
|
|
78
|
+
|
|
79
|
+
#endif /* !MLK_FIPS202_NATIVE_ARMV81M_MVE_H */
|
data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/armv81m/src/fips202_native_armv81m.h
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) The mlkem-native project authors
|
|
3
|
+
* SPDX-License-Identifier: Apache-2.0 OR ISC OR MIT
|
|
4
|
+
*/
|
|
5
|
+
#ifndef MLK_FIPS202_NATIVE_ARMV81M_SRC_FIPS202_NATIVE_ARMV81M_H
|
|
6
|
+
#define MLK_FIPS202_NATIVE_ARMV81M_SRC_FIPS202_NATIVE_ARMV81M_H
|
|
7
|
+
|
|
8
|
+
#include "../../../../common.h"
|
|
9
|
+
|
|
10
|
+
/* Keccak round constants in bit-interleaved form */
|
|
11
|
+
#define mlk_keccakf1600_round_constants \
|
|
12
|
+
MLK_NAMESPACE(keccakf1600_round_constants)
|
|
13
|
+
extern const uint32_t mlk_keccakf1600_round_constants[48];
|
|
14
|
+
|
|
15
|
+
#define mlk_keccak_f1600_x4_mve_asm MLK_NAMESPACE(keccak_f1600_x4_mve_asm)
|
|
16
|
+
void mlk_keccak_f1600_x4_mve_asm(uint64_t state[100], uint64_t tmpstate[100],
|
|
17
|
+
const uint32_t rc[48]);
|
|
18
|
+
|
|
19
|
+
#define mlk_keccak_f1600_x4_state_xor_bytes_asm \
|
|
20
|
+
MLK_NAMESPACE(keccak_f1600_x4_state_xor_bytes_asm)
|
|
21
|
+
void mlk_keccak_f1600_x4_state_xor_bytes_asm(void *state, const uint8_t *d0,
|
|
22
|
+
const uint8_t *d1,
|
|
23
|
+
const uint8_t *d2,
|
|
24
|
+
const uint8_t *d3, unsigned offset,
|
|
25
|
+
unsigned length);
|
|
26
|
+
|
|
27
|
+
#define mlk_keccak_f1600_x4_state_extract_bytes_asm \
|
|
28
|
+
MLK_NAMESPACE(keccak_f1600_x4_state_extract_bytes_asm)
|
|
29
|
+
void mlk_keccak_f1600_x4_state_extract_bytes_asm(void *state, uint8_t *data0,
|
|
30
|
+
uint8_t *data1, uint8_t *data2,
|
|
31
|
+
uint8_t *data3,
|
|
32
|
+
unsigned offset,
|
|
33
|
+
unsigned length);
|
|
34
|
+
|
|
35
|
+
#endif /* !MLK_FIPS202_NATIVE_ARMV81M_SRC_FIPS202_NATIVE_ARMV81M_H */
|