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
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
#ifndef PQCLEAN_MLDSA87_CLEAN_API_H
|
|
2
|
-
#define PQCLEAN_MLDSA87_CLEAN_API_H
|
|
3
|
-
|
|
4
|
-
#include <stddef.h>
|
|
5
|
-
#include <stdint.h>
|
|
6
|
-
|
|
7
|
-
#define PQCLEAN_MLDSA87_CLEAN_CRYPTO_PUBLICKEYBYTES 2592
|
|
8
|
-
#define PQCLEAN_MLDSA87_CLEAN_CRYPTO_SECRETKEYBYTES 4896
|
|
9
|
-
#define PQCLEAN_MLDSA87_CLEAN_CRYPTO_BYTES 4627
|
|
10
|
-
#define PQCLEAN_MLDSA87_CLEAN_CRYPTO_ALGNAME "ML-DSA-87"
|
|
11
|
-
|
|
12
|
-
int PQCLEAN_MLDSA87_CLEAN_crypto_sign_keypair(uint8_t *pk, uint8_t *sk);
|
|
13
|
-
|
|
14
|
-
int PQCLEAN_MLDSA87_CLEAN_crypto_sign_signature_ctx(uint8_t *sig, size_t *siglen,
|
|
15
|
-
const uint8_t *m, size_t mlen,
|
|
16
|
-
const uint8_t *ctx, size_t ctxlen,
|
|
17
|
-
const uint8_t *sk);
|
|
18
|
-
|
|
19
|
-
int PQCLEAN_MLDSA87_CLEAN_crypto_sign_ctx(uint8_t *sm, size_t *smlen,
|
|
20
|
-
const uint8_t *m, size_t mlen,
|
|
21
|
-
const uint8_t *ctx, size_t ctxlen,
|
|
22
|
-
const uint8_t *sk);
|
|
23
|
-
|
|
24
|
-
int PQCLEAN_MLDSA87_CLEAN_crypto_sign_verify_ctx(const uint8_t *sig, size_t siglen,
|
|
25
|
-
const uint8_t *m, size_t mlen,
|
|
26
|
-
const uint8_t *ctx, size_t ctxlen,
|
|
27
|
-
const uint8_t *pk);
|
|
28
|
-
|
|
29
|
-
int PQCLEAN_MLDSA87_CLEAN_crypto_sign_open_ctx(uint8_t *m, size_t *mlen,
|
|
30
|
-
const uint8_t *sm, size_t smlen,
|
|
31
|
-
const uint8_t *ctx, size_t ctxlen,
|
|
32
|
-
const uint8_t *pk);
|
|
33
|
-
|
|
34
|
-
int PQCLEAN_MLDSA87_CLEAN_crypto_sign_signature(uint8_t *sig, size_t *siglen,
|
|
35
|
-
const uint8_t *m, size_t mlen,
|
|
36
|
-
const uint8_t *sk);
|
|
37
|
-
|
|
38
|
-
int PQCLEAN_MLDSA87_CLEAN_crypto_sign(uint8_t *sm, size_t *smlen,
|
|
39
|
-
const uint8_t *m, size_t mlen,
|
|
40
|
-
const uint8_t *sk);
|
|
41
|
-
|
|
42
|
-
int PQCLEAN_MLDSA87_CLEAN_crypto_sign_verify(const uint8_t *sig, size_t siglen,
|
|
43
|
-
const uint8_t *m, size_t mlen,
|
|
44
|
-
const uint8_t *pk);
|
|
45
|
-
|
|
46
|
-
int PQCLEAN_MLDSA87_CLEAN_crypto_sign_open(uint8_t *m, size_t *mlen,
|
|
47
|
-
const uint8_t *sm, size_t smlen,
|
|
48
|
-
const uint8_t *pk);
|
|
49
|
-
|
|
50
|
-
#endif
|
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
#include "ntt.h"
|
|
2
|
-
#include "params.h"
|
|
3
|
-
#include "reduce.h"
|
|
4
|
-
#include <stdint.h>
|
|
5
|
-
|
|
6
|
-
static const int32_t zetas[N] = {
|
|
7
|
-
0, 25847, -2608894, -518909, 237124, -777960, -876248, 466468,
|
|
8
|
-
1826347, 2353451, -359251, -2091905, 3119733, -2884855, 3111497, 2680103,
|
|
9
|
-
2725464, 1024112, -1079900, 3585928, -549488, -1119584, 2619752, -2108549,
|
|
10
|
-
-2118186, -3859737, -1399561, -3277672, 1757237, -19422, 4010497, 280005,
|
|
11
|
-
2706023, 95776, 3077325, 3530437, -1661693, -3592148, -2537516, 3915439,
|
|
12
|
-
-3861115, -3043716, 3574422, -2867647, 3539968, -300467, 2348700, -539299,
|
|
13
|
-
-1699267, -1643818, 3505694, -3821735, 3507263, -2140649, -1600420, 3699596,
|
|
14
|
-
811944, 531354, 954230, 3881043, 3900724, -2556880, 2071892, -2797779,
|
|
15
|
-
-3930395, -1528703, -3677745, -3041255, -1452451, 3475950, 2176455, -1585221,
|
|
16
|
-
-1257611, 1939314, -4083598, -1000202, -3190144, -3157330, -3632928, 126922,
|
|
17
|
-
3412210, -983419, 2147896, 2715295, -2967645, -3693493, -411027, -2477047,
|
|
18
|
-
-671102, -1228525, -22981, -1308169, -381987, 1349076, 1852771, -1430430,
|
|
19
|
-
-3343383, 264944, 508951, 3097992, 44288, -1100098, 904516, 3958618,
|
|
20
|
-
-3724342, -8578, 1653064, -3249728, 2389356, -210977, 759969, -1316856,
|
|
21
|
-
189548, -3553272, 3159746, -1851402, -2409325, -177440, 1315589, 1341330,
|
|
22
|
-
1285669, -1584928, -812732, -1439742, -3019102, -3881060, -3628969, 3839961,
|
|
23
|
-
2091667, 3407706, 2316500, 3817976, -3342478, 2244091, -2446433, -3562462,
|
|
24
|
-
266997, 2434439, -1235728, 3513181, -3520352, -3759364, -1197226, -3193378,
|
|
25
|
-
900702, 1859098, 909542, 819034, 495491, -1613174, -43260, -522500,
|
|
26
|
-
-655327, -3122442, 2031748, 3207046, -3556995, -525098, -768622, -3595838,
|
|
27
|
-
342297, 286988, -2437823, 4108315, 3437287, -3342277, 1735879, 203044,
|
|
28
|
-
2842341, 2691481, -2590150, 1265009, 4055324, 1247620, 2486353, 1595974,
|
|
29
|
-
-3767016, 1250494, 2635921, -3548272, -2994039, 1869119, 1903435, -1050970,
|
|
30
|
-
-1333058, 1237275, -3318210, -1430225, -451100, 1312455, 3306115, -1962642,
|
|
31
|
-
-1279661, 1917081, -2546312, -1374803, 1500165, 777191, 2235880, 3406031,
|
|
32
|
-
-542412, -2831860, -1671176, -1846953, -2584293, -3724270, 594136, -3776993,
|
|
33
|
-
-2013608, 2432395, 2454455, -164721, 1957272, 3369112, 185531, -1207385,
|
|
34
|
-
-3183426, 162844, 1616392, 3014001, 810149, 1652634, -3694233, -1799107,
|
|
35
|
-
-3038916, 3523897, 3866901, 269760, 2213111, -975884, 1717735, 472078,
|
|
36
|
-
-426683, 1723600, -1803090, 1910376, -1667432, -1104333, -260646, -3833893,
|
|
37
|
-
-2939036, -2235985, -420899, -2286327, 183443, -976891, 1612842, -3545687,
|
|
38
|
-
-554416, 3919660, -48306, -1362209, 3937738, 1400424, -846154, 1976782
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
/*************************************************
|
|
42
|
-
* Name: PQCLEAN_MLDSA87_CLEAN_ntt
|
|
43
|
-
*
|
|
44
|
-
* Description: Forward NTT, in-place. No modular reduction is performed after
|
|
45
|
-
* additions or subtractions. Output vector is in bitreversed order.
|
|
46
|
-
*
|
|
47
|
-
* Arguments: - uint32_t p[N]: input/output coefficient array
|
|
48
|
-
**************************************************/
|
|
49
|
-
void PQCLEAN_MLDSA87_CLEAN_ntt(int32_t a[N]) {
|
|
50
|
-
unsigned int len, start, j, k;
|
|
51
|
-
int32_t zeta, t;
|
|
52
|
-
|
|
53
|
-
k = 0;
|
|
54
|
-
for (len = 128; len > 0; len >>= 1) {
|
|
55
|
-
for (start = 0; start < N; start = j + len) {
|
|
56
|
-
zeta = zetas[++k];
|
|
57
|
-
for (j = start; j < start + len; ++j) {
|
|
58
|
-
t = PQCLEAN_MLDSA87_CLEAN_montgomery_reduce((int64_t)zeta * a[j + len]);
|
|
59
|
-
a[j + len] = a[j] - t;
|
|
60
|
-
a[j] = a[j] + t;
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
/*************************************************
|
|
67
|
-
* Name: PQCLEAN_MLDSA87_CLEAN_invntt_tomont
|
|
68
|
-
*
|
|
69
|
-
* Description: Inverse NTT and multiplication by Montgomery factor 2^32.
|
|
70
|
-
* In-place. No modular reductions after additions or
|
|
71
|
-
* subtractions; input coefficients need to be smaller than
|
|
72
|
-
* Q in absolute value. Output coefficient are smaller than Q in
|
|
73
|
-
* absolute value.
|
|
74
|
-
*
|
|
75
|
-
* Arguments: - uint32_t p[N]: input/output coefficient array
|
|
76
|
-
**************************************************/
|
|
77
|
-
void PQCLEAN_MLDSA87_CLEAN_invntt_tomont(int32_t a[N]) {
|
|
78
|
-
unsigned int start, len, j, k;
|
|
79
|
-
int32_t t, zeta;
|
|
80
|
-
const int32_t f = 41978; // mont^2/256
|
|
81
|
-
|
|
82
|
-
k = 256;
|
|
83
|
-
for (len = 1; len < N; len <<= 1) {
|
|
84
|
-
for (start = 0; start < N; start = j + len) {
|
|
85
|
-
zeta = -zetas[--k];
|
|
86
|
-
for (j = start; j < start + len; ++j) {
|
|
87
|
-
t = a[j];
|
|
88
|
-
a[j] = t + a[j + len];
|
|
89
|
-
a[j + len] = t - a[j + len];
|
|
90
|
-
a[j + len] = PQCLEAN_MLDSA87_CLEAN_montgomery_reduce((int64_t)zeta * a[j + len]);
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
for (j = 0; j < N; ++j) {
|
|
96
|
-
a[j] = PQCLEAN_MLDSA87_CLEAN_montgomery_reduce((int64_t)f * a[j]);
|
|
97
|
-
}
|
|
98
|
-
}
|
|
@@ -1,261 +0,0 @@
|
|
|
1
|
-
#include "packing.h"
|
|
2
|
-
#include "params.h"
|
|
3
|
-
#include "poly.h"
|
|
4
|
-
#include "polyvec.h"
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
/*************************************************
|
|
8
|
-
* Name: PQCLEAN_MLDSA87_CLEAN_pack_pk
|
|
9
|
-
*
|
|
10
|
-
* Description: Bit-pack public key pk = (rho, t1).
|
|
11
|
-
*
|
|
12
|
-
* Arguments: - uint8_t pk[]: output byte array
|
|
13
|
-
* - const uint8_t rho[]: byte array containing rho
|
|
14
|
-
* - const polyveck *t1: pointer to vector t1
|
|
15
|
-
**************************************************/
|
|
16
|
-
void PQCLEAN_MLDSA87_CLEAN_pack_pk(uint8_t pk[PQCLEAN_MLDSA87_CLEAN_CRYPTO_PUBLICKEYBYTES],
|
|
17
|
-
const uint8_t rho[SEEDBYTES],
|
|
18
|
-
const polyveck *t1) {
|
|
19
|
-
unsigned int i;
|
|
20
|
-
|
|
21
|
-
for (i = 0; i < SEEDBYTES; ++i) {
|
|
22
|
-
pk[i] = rho[i];
|
|
23
|
-
}
|
|
24
|
-
pk += SEEDBYTES;
|
|
25
|
-
|
|
26
|
-
for (i = 0; i < K; ++i) {
|
|
27
|
-
PQCLEAN_MLDSA87_CLEAN_polyt1_pack(pk + i * POLYT1_PACKEDBYTES, &t1->vec[i]);
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
/*************************************************
|
|
32
|
-
* Name: PQCLEAN_MLDSA87_CLEAN_unpack_pk
|
|
33
|
-
*
|
|
34
|
-
* Description: Unpack public key pk = (rho, t1).
|
|
35
|
-
*
|
|
36
|
-
* Arguments: - const uint8_t rho[]: output byte array for rho
|
|
37
|
-
* - const polyveck *t1: pointer to output vector t1
|
|
38
|
-
* - uint8_t pk[]: byte array containing bit-packed pk
|
|
39
|
-
**************************************************/
|
|
40
|
-
void PQCLEAN_MLDSA87_CLEAN_unpack_pk(uint8_t rho[SEEDBYTES],
|
|
41
|
-
polyveck *t1,
|
|
42
|
-
const uint8_t pk[PQCLEAN_MLDSA87_CLEAN_CRYPTO_PUBLICKEYBYTES]) {
|
|
43
|
-
unsigned int i;
|
|
44
|
-
|
|
45
|
-
for (i = 0; i < SEEDBYTES; ++i) {
|
|
46
|
-
rho[i] = pk[i];
|
|
47
|
-
}
|
|
48
|
-
pk += SEEDBYTES;
|
|
49
|
-
|
|
50
|
-
for (i = 0; i < K; ++i) {
|
|
51
|
-
PQCLEAN_MLDSA87_CLEAN_polyt1_unpack(&t1->vec[i], pk + i * POLYT1_PACKEDBYTES);
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
/*************************************************
|
|
56
|
-
* Name: PQCLEAN_MLDSA87_CLEAN_pack_sk
|
|
57
|
-
*
|
|
58
|
-
* Description: Bit-pack secret key sk = (rho, tr, key, t0, s1, s2).
|
|
59
|
-
*
|
|
60
|
-
* Arguments: - uint8_t sk[]: output byte array
|
|
61
|
-
* - const uint8_t rho[]: byte array containing rho
|
|
62
|
-
* - const uint8_t tr[]: byte array containing tr
|
|
63
|
-
* - const uint8_t key[]: byte array containing key
|
|
64
|
-
* - const polyveck *t0: pointer to vector t0
|
|
65
|
-
* - const polyvecl *s1: pointer to vector s1
|
|
66
|
-
* - const polyveck *s2: pointer to vector s2
|
|
67
|
-
**************************************************/
|
|
68
|
-
void PQCLEAN_MLDSA87_CLEAN_pack_sk(uint8_t sk[PQCLEAN_MLDSA87_CLEAN_CRYPTO_SECRETKEYBYTES],
|
|
69
|
-
const uint8_t rho[SEEDBYTES],
|
|
70
|
-
const uint8_t tr[TRBYTES],
|
|
71
|
-
const uint8_t key[SEEDBYTES],
|
|
72
|
-
const polyveck *t0,
|
|
73
|
-
const polyvecl *s1,
|
|
74
|
-
const polyveck *s2) {
|
|
75
|
-
unsigned int i;
|
|
76
|
-
|
|
77
|
-
for (i = 0; i < SEEDBYTES; ++i) {
|
|
78
|
-
sk[i] = rho[i];
|
|
79
|
-
}
|
|
80
|
-
sk += SEEDBYTES;
|
|
81
|
-
|
|
82
|
-
for (i = 0; i < SEEDBYTES; ++i) {
|
|
83
|
-
sk[i] = key[i];
|
|
84
|
-
}
|
|
85
|
-
sk += SEEDBYTES;
|
|
86
|
-
|
|
87
|
-
for (i = 0; i < TRBYTES; ++i) {
|
|
88
|
-
sk[i] = tr[i];
|
|
89
|
-
}
|
|
90
|
-
sk += TRBYTES;
|
|
91
|
-
|
|
92
|
-
for (i = 0; i < L; ++i) {
|
|
93
|
-
PQCLEAN_MLDSA87_CLEAN_polyeta_pack(sk + i * POLYETA_PACKEDBYTES, &s1->vec[i]);
|
|
94
|
-
}
|
|
95
|
-
sk += L * POLYETA_PACKEDBYTES;
|
|
96
|
-
|
|
97
|
-
for (i = 0; i < K; ++i) {
|
|
98
|
-
PQCLEAN_MLDSA87_CLEAN_polyeta_pack(sk + i * POLYETA_PACKEDBYTES, &s2->vec[i]);
|
|
99
|
-
}
|
|
100
|
-
sk += K * POLYETA_PACKEDBYTES;
|
|
101
|
-
|
|
102
|
-
for (i = 0; i < K; ++i) {
|
|
103
|
-
PQCLEAN_MLDSA87_CLEAN_polyt0_pack(sk + i * POLYT0_PACKEDBYTES, &t0->vec[i]);
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
/*************************************************
|
|
108
|
-
* Name: PQCLEAN_MLDSA87_CLEAN_unpack_sk
|
|
109
|
-
*
|
|
110
|
-
* Description: Unpack secret key sk = (rho, tr, key, t0, s1, s2).
|
|
111
|
-
*
|
|
112
|
-
* Arguments: - const uint8_t rho[]: output byte array for rho
|
|
113
|
-
* - const uint8_t tr[]: output byte array for tr
|
|
114
|
-
* - const uint8_t key[]: output byte array for key
|
|
115
|
-
* - const polyveck *t0: pointer to output vector t0
|
|
116
|
-
* - const polyvecl *s1: pointer to output vector s1
|
|
117
|
-
* - const polyveck *s2: pointer to output vector s2
|
|
118
|
-
* - uint8_t sk[]: byte array containing bit-packed sk
|
|
119
|
-
**************************************************/
|
|
120
|
-
void PQCLEAN_MLDSA87_CLEAN_unpack_sk(uint8_t rho[SEEDBYTES],
|
|
121
|
-
uint8_t tr[TRBYTES],
|
|
122
|
-
uint8_t key[SEEDBYTES],
|
|
123
|
-
polyveck *t0,
|
|
124
|
-
polyvecl *s1,
|
|
125
|
-
polyveck *s2,
|
|
126
|
-
const uint8_t sk[PQCLEAN_MLDSA87_CLEAN_CRYPTO_SECRETKEYBYTES]) {
|
|
127
|
-
unsigned int i;
|
|
128
|
-
|
|
129
|
-
for (i = 0; i < SEEDBYTES; ++i) {
|
|
130
|
-
rho[i] = sk[i];
|
|
131
|
-
}
|
|
132
|
-
sk += SEEDBYTES;
|
|
133
|
-
|
|
134
|
-
for (i = 0; i < SEEDBYTES; ++i) {
|
|
135
|
-
key[i] = sk[i];
|
|
136
|
-
}
|
|
137
|
-
sk += SEEDBYTES;
|
|
138
|
-
|
|
139
|
-
for (i = 0; i < TRBYTES; ++i) {
|
|
140
|
-
tr[i] = sk[i];
|
|
141
|
-
}
|
|
142
|
-
sk += TRBYTES;
|
|
143
|
-
|
|
144
|
-
for (i = 0; i < L; ++i) {
|
|
145
|
-
PQCLEAN_MLDSA87_CLEAN_polyeta_unpack(&s1->vec[i], sk + i * POLYETA_PACKEDBYTES);
|
|
146
|
-
}
|
|
147
|
-
sk += L * POLYETA_PACKEDBYTES;
|
|
148
|
-
|
|
149
|
-
for (i = 0; i < K; ++i) {
|
|
150
|
-
PQCLEAN_MLDSA87_CLEAN_polyeta_unpack(&s2->vec[i], sk + i * POLYETA_PACKEDBYTES);
|
|
151
|
-
}
|
|
152
|
-
sk += K * POLYETA_PACKEDBYTES;
|
|
153
|
-
|
|
154
|
-
for (i = 0; i < K; ++i) {
|
|
155
|
-
PQCLEAN_MLDSA87_CLEAN_polyt0_unpack(&t0->vec[i], sk + i * POLYT0_PACKEDBYTES);
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
/*************************************************
|
|
160
|
-
* Name: PQCLEAN_MLDSA87_CLEAN_pack_sig
|
|
161
|
-
*
|
|
162
|
-
* Description: Bit-pack signature sig = (c, z, h).
|
|
163
|
-
*
|
|
164
|
-
* Arguments: - uint8_t sig[]: output byte array
|
|
165
|
-
* - const uint8_t *c: pointer to challenge hash length SEEDBYTES
|
|
166
|
-
* - const polyvecl *z: pointer to vector z
|
|
167
|
-
* - const polyveck *h: pointer to hint vector h
|
|
168
|
-
**************************************************/
|
|
169
|
-
void PQCLEAN_MLDSA87_CLEAN_pack_sig(uint8_t sig[PQCLEAN_MLDSA87_CLEAN_CRYPTO_BYTES],
|
|
170
|
-
const uint8_t c[CTILDEBYTES],
|
|
171
|
-
const polyvecl *z,
|
|
172
|
-
const polyveck *h) {
|
|
173
|
-
unsigned int i, j, k;
|
|
174
|
-
|
|
175
|
-
for (i = 0; i < CTILDEBYTES; ++i) {
|
|
176
|
-
sig[i] = c[i];
|
|
177
|
-
}
|
|
178
|
-
sig += CTILDEBYTES;
|
|
179
|
-
|
|
180
|
-
for (i = 0; i < L; ++i) {
|
|
181
|
-
PQCLEAN_MLDSA87_CLEAN_polyz_pack(sig + i * POLYZ_PACKEDBYTES, &z->vec[i]);
|
|
182
|
-
}
|
|
183
|
-
sig += L * POLYZ_PACKEDBYTES;
|
|
184
|
-
|
|
185
|
-
/* Encode h */
|
|
186
|
-
for (i = 0; i < OMEGA + K; ++i) {
|
|
187
|
-
sig[i] = 0;
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
k = 0;
|
|
191
|
-
for (i = 0; i < K; ++i) {
|
|
192
|
-
for (j = 0; j < N; ++j) {
|
|
193
|
-
if (h->vec[i].coeffs[j] != 0) {
|
|
194
|
-
sig[k++] = (uint8_t) j;
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
sig[OMEGA + i] = (uint8_t) k;
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
/*************************************************
|
|
203
|
-
* Name: PQCLEAN_MLDSA87_CLEAN_unpack_sig
|
|
204
|
-
*
|
|
205
|
-
* Description: Unpack signature sig = (c, z, h).
|
|
206
|
-
*
|
|
207
|
-
* Arguments: - uint8_t *c: pointer to output challenge hash
|
|
208
|
-
* - polyvecl *z: pointer to output vector z
|
|
209
|
-
* - polyveck *h: pointer to output hint vector h
|
|
210
|
-
* - const uint8_t sig[]: byte array containing
|
|
211
|
-
* bit-packed signature
|
|
212
|
-
*
|
|
213
|
-
* Returns 1 in case of malformed signature; otherwise 0.
|
|
214
|
-
**************************************************/
|
|
215
|
-
int PQCLEAN_MLDSA87_CLEAN_unpack_sig(uint8_t c[CTILDEBYTES],
|
|
216
|
-
polyvecl *z,
|
|
217
|
-
polyveck *h,
|
|
218
|
-
const uint8_t sig[PQCLEAN_MLDSA87_CLEAN_CRYPTO_BYTES]) {
|
|
219
|
-
unsigned int i, j, k;
|
|
220
|
-
|
|
221
|
-
for (i = 0; i < CTILDEBYTES; ++i) {
|
|
222
|
-
c[i] = sig[i];
|
|
223
|
-
}
|
|
224
|
-
sig += CTILDEBYTES;
|
|
225
|
-
|
|
226
|
-
for (i = 0; i < L; ++i) {
|
|
227
|
-
PQCLEAN_MLDSA87_CLEAN_polyz_unpack(&z->vec[i], sig + i * POLYZ_PACKEDBYTES);
|
|
228
|
-
}
|
|
229
|
-
sig += L * POLYZ_PACKEDBYTES;
|
|
230
|
-
|
|
231
|
-
/* Decode h */
|
|
232
|
-
k = 0;
|
|
233
|
-
for (i = 0; i < K; ++i) {
|
|
234
|
-
for (j = 0; j < N; ++j) {
|
|
235
|
-
h->vec[i].coeffs[j] = 0;
|
|
236
|
-
}
|
|
237
|
-
|
|
238
|
-
if (sig[OMEGA + i] < k || sig[OMEGA + i] > OMEGA) {
|
|
239
|
-
return 1;
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
for (j = k; j < sig[OMEGA + i]; ++j) {
|
|
243
|
-
/* Coefficients are ordered for strong unforgeability */
|
|
244
|
-
if (j > k && sig[j] <= sig[j - 1]) {
|
|
245
|
-
return 1;
|
|
246
|
-
}
|
|
247
|
-
h->vec[i].coeffs[sig[j]] = 1;
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
k = sig[OMEGA + i];
|
|
251
|
-
}
|
|
252
|
-
|
|
253
|
-
/* Extra indices are zero for strong unforgeability */
|
|
254
|
-
for (j = k; j < OMEGA; ++j) {
|
|
255
|
-
if (sig[j]) {
|
|
256
|
-
return 1;
|
|
257
|
-
}
|
|
258
|
-
}
|
|
259
|
-
|
|
260
|
-
return 0;
|
|
261
|
-
}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
#ifndef PQCLEAN_MLDSA87_CLEAN_PACKING_H
|
|
2
|
-
#define PQCLEAN_MLDSA87_CLEAN_PACKING_H
|
|
3
|
-
#include "params.h"
|
|
4
|
-
#include "polyvec.h"
|
|
5
|
-
#include <stdint.h>
|
|
6
|
-
|
|
7
|
-
void PQCLEAN_MLDSA87_CLEAN_pack_pk(uint8_t pk[PQCLEAN_MLDSA87_CLEAN_CRYPTO_PUBLICKEYBYTES], const uint8_t rho[SEEDBYTES], const polyveck *t1);
|
|
8
|
-
|
|
9
|
-
void PQCLEAN_MLDSA87_CLEAN_pack_sk(uint8_t sk[PQCLEAN_MLDSA87_CLEAN_CRYPTO_SECRETKEYBYTES],
|
|
10
|
-
const uint8_t rho[SEEDBYTES],
|
|
11
|
-
const uint8_t tr[TRBYTES],
|
|
12
|
-
const uint8_t key[SEEDBYTES],
|
|
13
|
-
const polyveck *t0,
|
|
14
|
-
const polyvecl *s1,
|
|
15
|
-
const polyveck *s2);
|
|
16
|
-
|
|
17
|
-
void PQCLEAN_MLDSA87_CLEAN_pack_sig(uint8_t sig[PQCLEAN_MLDSA87_CLEAN_CRYPTO_BYTES], const uint8_t c[CTILDEBYTES], const polyvecl *z, const polyveck *h);
|
|
18
|
-
|
|
19
|
-
void PQCLEAN_MLDSA87_CLEAN_unpack_pk(uint8_t rho[SEEDBYTES], polyveck *t1, const uint8_t pk[PQCLEAN_MLDSA87_CLEAN_CRYPTO_PUBLICKEYBYTES]);
|
|
20
|
-
|
|
21
|
-
void PQCLEAN_MLDSA87_CLEAN_unpack_sk(uint8_t rho[SEEDBYTES],
|
|
22
|
-
uint8_t tr[TRBYTES],
|
|
23
|
-
uint8_t key[SEEDBYTES],
|
|
24
|
-
polyveck *t0,
|
|
25
|
-
polyvecl *s1,
|
|
26
|
-
polyveck *s2,
|
|
27
|
-
const uint8_t sk[PQCLEAN_MLDSA87_CLEAN_CRYPTO_SECRETKEYBYTES]);
|
|
28
|
-
|
|
29
|
-
int PQCLEAN_MLDSA87_CLEAN_unpack_sig(uint8_t c[CTILDEBYTES], polyvecl *z, polyveck *h, const uint8_t sig[PQCLEAN_MLDSA87_CLEAN_CRYPTO_BYTES]);
|
|
30
|
-
|
|
31
|
-
#endif
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
#ifndef PQCLEAN_MLDSA87_CLEAN_PARAMS_H
|
|
2
|
-
#define PQCLEAN_MLDSA87_CLEAN_PARAMS_H
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
#define SEEDBYTES 32
|
|
7
|
-
#define CRHBYTES 64
|
|
8
|
-
#define TRBYTES 64
|
|
9
|
-
#define RNDBYTES 32
|
|
10
|
-
#define N 256
|
|
11
|
-
#define Q 8380417
|
|
12
|
-
#define D 13
|
|
13
|
-
#define ROOT_OF_UNITY 1753
|
|
14
|
-
|
|
15
|
-
#define K 8
|
|
16
|
-
#define L 7
|
|
17
|
-
#define ETA 2
|
|
18
|
-
#define TAU 60
|
|
19
|
-
#define BETA 120
|
|
20
|
-
#define GAMMA1 (1 << 19)
|
|
21
|
-
#define GAMMA2 ((Q-1)/32)
|
|
22
|
-
#define OMEGA 75
|
|
23
|
-
#define CTILDEBYTES 64
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
#define POLYT1_PACKEDBYTES 320
|
|
27
|
-
#define POLYT0_PACKEDBYTES 416
|
|
28
|
-
#define POLYVECH_PACKEDBYTES (OMEGA + K)
|
|
29
|
-
|
|
30
|
-
#define POLYZ_PACKEDBYTES 640
|
|
31
|
-
|
|
32
|
-
#define POLYW1_PACKEDBYTES 128
|
|
33
|
-
|
|
34
|
-
#define POLYETA_PACKEDBYTES 96
|
|
35
|
-
|
|
36
|
-
#define PQCLEAN_MLDSA87_CLEAN_CRYPTO_PUBLICKEYBYTES (SEEDBYTES + K*POLYT1_PACKEDBYTES)
|
|
37
|
-
#define PQCLEAN_MLDSA87_CLEAN_CRYPTO_SECRETKEYBYTES (2*SEEDBYTES \
|
|
38
|
-
+ TRBYTES \
|
|
39
|
-
+ L*POLYETA_PACKEDBYTES \
|
|
40
|
-
+ K*POLYETA_PACKEDBYTES \
|
|
41
|
-
+ K*POLYT0_PACKEDBYTES)
|
|
42
|
-
#define PQCLEAN_MLDSA87_CLEAN_CRYPTO_BYTES (CTILDEBYTES + L*POLYZ_PACKEDBYTES + POLYVECH_PACKEDBYTES)
|
|
43
|
-
|
|
44
|
-
#endif
|