pq_crypto 0.6.7 → 0.6.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +20 -0
- data/README.md +1 -3
- data/ext/pqcrypto/pqcrypto_ruby_secure.c +41 -11
- data/ext/pqcrypto/pqcrypto_secure.c +501 -296
- data/ext/pqcrypto/pqcrypto_version.h +1 -1
- data/ext/pqcrypto/vendor/.vendored +7 -7
- data/ext/pqcrypto/vendor/mldsa-native/BUILDING.md +71 -0
- data/ext/pqcrypto/vendor/mldsa-native/README.md +26 -11
- data/ext/pqcrypto/vendor/mldsa-native/RELEASE.md +77 -150
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/mldsa_native.c +93 -40
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/mldsa_native.h +74 -59
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/mldsa_native_asm.S +106 -40
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/mldsa_native_config.h +94 -92
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/capability.h +31 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/cbmc.h +55 -4
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/common.h +30 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/context.h +1 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/debug.c +1 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/fips202.h +1 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/aarch64/src/keccak_f1600_x1_scalar_aarch64_asm.S +5 -2
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/aarch64/src/keccak_f1600_x1_v84a_aarch64_asm.S +4 -4
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/aarch64/src/keccak_f1600_x2_v84a_aarch64_asm.S +4 -4
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/aarch64/src/keccak_f1600_x4_v8a_scalar_hybrid_aarch64_asm.S +8 -3
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/aarch64/src/keccak_f1600_x4_v8a_v84a_scalar_hybrid_aarch64_asm.S +8 -4
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/armv81m/mve.h +12 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/armv81m/src/keccak_f1600_x4_mve.S +4 -2
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/armv81m/src/keccak_f1600_x4_state_extract_bytes_mve.S +37 -19
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/armv81m/src/keccak_f1600_x4_state_xor_bytes_mve.S +37 -19
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/auto.h +3 -8
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/x86_64/auto.h +53 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/x86_64/keccak_f1600_x1_avx512.h +38 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/x86_64/keccak_f1600_x4_avx512.h +38 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/x86_64/src/fips202_native_x86_64.h +24 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/x86_64/src/keccak_f1600_x1_avx512_asm.S +574 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/x86_64/src/keccak_f1600_x4_avx2_asm.S +46 -18
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/x86_64/src/keccak_f1600_x4_avx512_asm.S +679 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/x86_64/src/keccakf1600_constants.c +13 -4
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/meta.h +6 -4
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/arith_native_aarch64.h +5 -6
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/mldsa_intt_aarch64_asm.S +4 -2
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/mldsa_ntt_aarch64_asm.S +4 -2
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/mldsa_pointwise_montgomery_aarch64_asm.S +6 -4
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/mldsa_poly_caddq_aarch64_asm.S +4 -2
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/mldsa_poly_chknorm_aarch64_asm.S +6 -4
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/mldsa_poly_decompose_32_aarch64_asm.S +4 -3
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/mldsa_poly_decompose_88_aarch64_asm.S +4 -3
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/mldsa_poly_use_hint_32_aarch64_asm.S +4 -3
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/mldsa_poly_use_hint_88_aarch64_asm.S +4 -3
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/mldsa_polyvecl_pointwise_acc_montgomery_l4_aarch64_asm.S +4 -2
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/mldsa_polyvecl_pointwise_acc_montgomery_l5_aarch64_asm.S +4 -2
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/mldsa_polyvecl_pointwise_acc_montgomery_l7_aarch64_asm.S +4 -2
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/mldsa_polyz_unpack_17_aarch64_asm.S +5 -3
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/mldsa_polyz_unpack_19_aarch64_asm.S +5 -3
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/mldsa_rej_uniform_aarch64_asm.S +110 -120
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/mldsa_rej_uniform_eta2_aarch64_asm.S +109 -101
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/mldsa_rej_uniform_eta4_aarch64_asm.S +97 -93
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/api.h +1 -9
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/meta.h +4 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/rv32im/fastmul.h +74 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/rv32im/slowmul.h +77 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/rv32im/src/arith_native_rv32im.h +124 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/rv32im/src/mldsa_intt_rv32im_asm.S +331 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/rv32im/src/mldsa_intt_rv32im_slowmul_asm.S +381 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/rv32im/src/mldsa_ntt_rv32im_asm.S +304 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/rv32im/src/mldsa_ntt_rv32im_slowmul_asm.S +351 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/rv32im/src/mldsa_poly_pointwise_montgomery_rv32im_asm.S +139 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/rv32im/src/rv32im_zetas.c +118 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/meta.h +6 -5
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/arith_native_x86_64.h +2 -3
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/mldsa_intt_avx2_asm.S +5 -3
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/mldsa_ntt_avx2_asm.S +5 -3
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/mldsa_nttunpack_avx2_asm.S +5 -3
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/mldsa_pointwise_acc_l4_avx2_asm.S +6 -3
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/mldsa_pointwise_acc_l5_avx2_asm.S +6 -3
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/mldsa_pointwise_acc_l7_avx2_asm.S +6 -3
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/mldsa_pointwise_avx2_asm.S +5 -3
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/mldsa_poly_caddq_avx2_asm.S +5 -3
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/mldsa_poly_chknorm_avx2_asm.S +7 -5
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/mldsa_poly_decompose_32_avx2_asm.S +69 -67
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/mldsa_poly_decompose_88_avx2_asm.S +69 -67
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/mldsa_poly_use_hint_32_avx2_asm.S +12 -16
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/mldsa_poly_use_hint_88_avx2_asm.S +14 -18
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/mldsa_polyz_unpack_17_avx2_asm.S +6 -3
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/mldsa_polyz_unpack_19_avx2_asm.S +6 -3
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/mldsa_rej_uniform_avx2_asm.S +5 -3
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/mldsa_rej_uniform_eta2_avx2_asm.S +5 -3
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/mldsa_rej_uniform_eta4_avx2_asm.S +5 -3
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/packing.c +23 -27
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/packing.h +21 -42
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/params.h +28 -1
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/poly.c +87 -28
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/poly.h +61 -3
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/poly_kl.c +23 -19
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/poly_kl.h +30 -0
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/polyvec.c +55 -107
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/polyvec.h +67 -107
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/polyvec_lazy.c +16 -24
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/polyvec_lazy.h +27 -21
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/reduce.h +8 -8
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/sign.c +191 -119
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/sign.h +6 -3
- data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/sys.h +16 -42
- data/ext/pqcrypto/vendor/mlkem-native/BUILDING.md +72 -0
- data/ext/pqcrypto/vendor/mlkem-native/README.md +9 -5
- data/ext/pqcrypto/vendor/mlkem-native/RELEASE.md +64 -312
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/mlkem_native.c +77 -34
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/mlkem_native.h +41 -13
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/mlkem_native_asm.S +89 -33
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/mlkem_native_config.h +50 -46
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/capability.h +30 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/common.h +30 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/compress.c +1 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/compress.h +4 -5
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/debug.c +1 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/fips202.c +15 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/fips202.h +23 -8
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/fips202x4.c +11 -3
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/fips202x4.h +7 -1
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/keccakf1600.c +8 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/keccakf1600.h +8 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/aarch64/src/keccak_f1600_x1_scalar_aarch64_asm.S +5 -2
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/aarch64/src/keccak_f1600_x1_v84a_aarch64_asm.S +4 -4
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/aarch64/src/keccak_f1600_x2_v84a_aarch64_asm.S +4 -4
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/aarch64/src/keccak_f1600_x4_v8a_scalar_hybrid_aarch64_asm.S +8 -3
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/aarch64/src/keccak_f1600_x4_v8a_v84a_scalar_hybrid_aarch64_asm.S +8 -4
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/armv81m/src/keccak_f1600_x4_mve.S +4 -2
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/armv81m/src/keccak_f1600_x4_state_extract_bytes_mve.S +37 -19
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/armv81m/src/keccak_f1600_x4_state_xor_bytes_mve.S +37 -19
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/auto.h +2 -2
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/x86_64/auto.h +47 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/x86_64/keccak_f1600_x1_avx512.h +37 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/x86_64/keccak_f1600_x4_avx512.h +37 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/x86_64/src/fips202_native_x86_64.h +24 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/x86_64/src/keccak_f1600_x1_avx512_asm.S +573 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/x86_64/src/keccak_f1600_x4_avx2_asm.S +46 -18
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/x86_64/src/keccak_f1600_x4_avx512_asm.S +678 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/x86_64/src/keccakf1600_constants.c +13 -4
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/indcpa.c +1 -2
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/kem.c +7 -5
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/kem.h +29 -5
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/meta.h +156 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/arith_native_aarch64.h +137 -3
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/compress_d5_table.c +43 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/decompress_d10_table.c +50 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/decompress_d11_table.c +53 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/decompress_d4_table.c +44 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/decompress_d5_table.c +53 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/mlkem_intt_aarch64_asm.S +5 -3
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/mlkem_ntt_aarch64_asm.S +4 -2
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/mlkem_poly_compress_d10_aarch64_asm.S +439 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/mlkem_poly_compress_d11_aarch64_asm.S +452 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/mlkem_poly_compress_d4_aarch64_asm.S +106 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/mlkem_poly_compress_d5_aarch64_asm.S +124 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/mlkem_poly_decompress_d10_aarch64_asm.S +108 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/mlkem_poly_decompress_d11_aarch64_asm.S +116 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/mlkem_poly_decompress_d4_aarch64_asm.S +93 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/mlkem_poly_decompress_d5_aarch64_asm.S +104 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/mlkem_poly_frombytes_aarch64_asm.S +84 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/mlkem_poly_mulcache_compute_aarch64_asm.S +4 -2
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/mlkem_poly_reduce_aarch64_asm.S +4 -2
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/mlkem_poly_tobytes_aarch64_asm.S +5 -3
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/mlkem_poly_tomont_aarch64_asm.S +4 -3
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/mlkem_polyvec_basemul_acc_montgomery_cached_k2_aarch64_asm.S +4 -2
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/mlkem_polyvec_basemul_acc_montgomery_cached_k3_aarch64_asm.S +4 -2
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/mlkem_polyvec_basemul_acc_montgomery_cached_k4_aarch64_asm.S +4 -2
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/mlkem_rej_uniform_aarch64_asm.S +112 -104
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/api.h +0 -1
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/meta.h +2 -2
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/ppc64le/README.md +2 -2
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/ppc64le/meta.h +16 -21
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/ppc64le/src/arith_native_ppc64le.h +1 -0
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/ppc64le/src/consts.c +2 -2
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/ppc64le/src/mlkem_intt_ppc_asm.S +6 -5
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/ppc64le/src/mlkem_ntt_ppc_asm.S +6 -5
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/ppc64le/src/mlkem_poly_tomont_ppc_asm.S +6 -5
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/ppc64le/src/mlkem_reduce_ppc_asm.S +6 -5
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/riscv64/src/rv64v_debug.c +5 -4
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/riscv64/src/rv64v_debug.h +2 -2
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/riscv64/src/rv64v_poly.c +1 -1
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/arith_native_x86_64.h +5 -5
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/mlkem_intt_avx2_asm.S +36 -33
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/mlkem_ntt_avx2_asm.S +67 -65
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/mlkem_nttfrombytes_avx2_asm.S +8 -5
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/mlkem_ntttobytes_avx2_asm.S +6 -3
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/mlkem_nttunpack_avx2_asm.S +5 -3
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/mlkem_poly_compress_d10_avx2_asm.S +7 -5
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/mlkem_poly_compress_d11_avx2_asm.S +7 -4
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/mlkem_poly_compress_d4_avx2_asm.S +7 -5
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/mlkem_poly_compress_d5_avx2_asm.S +7 -4
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/mlkem_poly_decompress_d10_avx2_asm.S +7 -4
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/mlkem_poly_decompress_d11_avx2_asm.S +6 -4
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/mlkem_poly_decompress_d4_avx2_asm.S +7 -4
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/mlkem_poly_decompress_d5_avx2_asm.S +6 -4
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/mlkem_poly_mulcache_compute_avx2_asm.S +5 -3
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/mlkem_polyvec_basemul_acc_montgomery_cached_k2_avx2_asm.S +118 -115
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/mlkem_polyvec_basemul_acc_montgomery_cached_k3_avx2_asm.S +174 -171
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/mlkem_polyvec_basemul_acc_montgomery_cached_k4_avx2_asm.S +230 -227
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/mlkem_reduce_avx2_asm.S +17 -15
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/mlkem_rej_uniform_avx2_asm.S +7 -6
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/mlkem_tomont_avx2_asm.S +5 -3
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/poly_k.c +4 -9
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/poly_k.h +1 -1
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/sys.h +31 -44
- data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/verify.h +1 -1
- data/lib/pq_crypto/internal.rb +10 -0
- data/lib/pq_crypto/kem.rb +5 -10
- data/lib/pq_crypto/pkcs8/der.rb +26 -11
- data/lib/pq_crypto/pkcs8/private_key_choice.rb +21 -25
- data/lib/pq_crypto/signature.rb +28 -40
- data/lib/pq_crypto/spki.rb +36 -23
- data/lib/pq_crypto/version.rb +1 -1
- data/script/vendor_libs.rb +6 -6
- metadata +36 -1
data/lib/pq_crypto/spki.rb
CHANGED
|
@@ -39,30 +39,9 @@ module PQCrypto
|
|
|
39
39
|
def decode_der(der)
|
|
40
40
|
input = String(der).b
|
|
41
41
|
outer = decode_asn1(input)
|
|
42
|
-
|
|
43
|
-
raise SerializationError, "SPKI must be an ASN.1 SEQUENCE" unless outer.is_a?(OpenSSL::ASN1::Sequence)
|
|
44
|
-
raise SerializationError, "SPKI SEQUENCE must contain exactly 2 elements" unless outer.value.size == 2
|
|
45
|
-
|
|
46
|
-
algorithm_identifier, subject_public_key = outer.value
|
|
42
|
+
algorithm_identifier, subject_public_key = spki_elements(outer, input)
|
|
47
43
|
algorithm = decode_algorithm_identifier(algorithm_identifier)
|
|
48
|
-
|
|
49
|
-
validate_public_key_algorithm!(algorithm, entry)
|
|
50
|
-
|
|
51
|
-
unless subject_public_key.is_a?(OpenSSL::ASN1::BitString)
|
|
52
|
-
raise SerializationError, "SPKI subjectPublicKey must be a BIT STRING"
|
|
53
|
-
end
|
|
54
|
-
unless subject_public_key.unused_bits.zero?
|
|
55
|
-
raise SerializationError, "SPKI subjectPublicKey must have zero unused bits"
|
|
56
|
-
end
|
|
57
|
-
|
|
58
|
-
bytes = String(subject_public_key.value).b
|
|
59
|
-
expected = entry.fetch(:public_key_bytes)
|
|
60
|
-
unless bytes.bytesize == expected
|
|
61
|
-
raise SerializationError,
|
|
62
|
-
"Invalid #{algorithm.inspect} SPKI public key length: expected #{expected}, got #{bytes.bytesize}"
|
|
63
|
-
end
|
|
64
|
-
|
|
65
|
-
[algorithm, bytes]
|
|
44
|
+
[algorithm, decode_subject_public_key(algorithm, subject_public_key)]
|
|
66
45
|
rescue OpenSSL::OpenSSLError, TypeError => e
|
|
67
46
|
raise SerializationError, e.message
|
|
68
47
|
end
|
|
@@ -80,6 +59,40 @@ module PQCrypto
|
|
|
80
59
|
raise SerializationError, e.message
|
|
81
60
|
end
|
|
82
61
|
|
|
62
|
+
def spki_elements(outer, input)
|
|
63
|
+
raise SerializationError, "SPKI DER contains trailing data" unless outer.to_der.b == input
|
|
64
|
+
raise SerializationError, "SPKI must be an ASN.1 SEQUENCE" unless outer.is_a?(OpenSSL::ASN1::Sequence)
|
|
65
|
+
raise SerializationError, "SPKI SEQUENCE must contain exactly 2 elements" unless outer.value.size == 2
|
|
66
|
+
|
|
67
|
+
outer.value
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
def decode_subject_public_key(algorithm, subject_public_key)
|
|
71
|
+
entry = AlgorithmRegistry.fetch(algorithm)
|
|
72
|
+
validate_public_key_algorithm!(algorithm, entry)
|
|
73
|
+
validate_subject_public_key!(subject_public_key)
|
|
74
|
+
|
|
75
|
+
bytes = String(subject_public_key.value).b
|
|
76
|
+
validate_public_key_length!(algorithm, bytes, entry.fetch(:public_key_bytes))
|
|
77
|
+
bytes
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
def validate_subject_public_key!(subject_public_key)
|
|
81
|
+
unless subject_public_key.is_a?(OpenSSL::ASN1::BitString)
|
|
82
|
+
raise SerializationError, "SPKI subjectPublicKey must be a BIT STRING"
|
|
83
|
+
end
|
|
84
|
+
return if subject_public_key.unused_bits.zero?
|
|
85
|
+
|
|
86
|
+
raise SerializationError, "SPKI subjectPublicKey must have zero unused bits"
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
def validate_public_key_length!(algorithm, bytes, expected)
|
|
90
|
+
return if bytes.bytesize == expected
|
|
91
|
+
|
|
92
|
+
raise SerializationError,
|
|
93
|
+
"Invalid #{algorithm.inspect} SPKI public key length: expected #{expected}, got #{bytes.bytesize}"
|
|
94
|
+
end
|
|
95
|
+
|
|
83
96
|
def decode_algorithm_identifier(value)
|
|
84
97
|
unless value.is_a?(OpenSSL::ASN1::Sequence)
|
|
85
98
|
raise SerializationError, "SPKI algorithm must be an AlgorithmIdentifier SEQUENCE"
|
data/lib/pq_crypto/version.rb
CHANGED
data/script/vendor_libs.rb
CHANGED
|
@@ -13,17 +13,17 @@ MANIFEST_PATH = File.join(VENDOR_DIR, ".vendored")
|
|
|
13
13
|
PINS = {
|
|
14
14
|
mlkem: {
|
|
15
15
|
repo: "https://github.com/pq-code-package/mlkem-native.git",
|
|
16
|
-
ref: "v2.
|
|
17
|
-
commit: "
|
|
18
|
-
tree_sha256: "
|
|
16
|
+
ref: "v2.1.0",
|
|
17
|
+
commit: "4d69d6b0358e678e3a694ea1bb8404a41770f68e",
|
|
18
|
+
tree_sha256: "0fb0b44188f63d42ca0049bd66bee26187d0317fa28489eb6b6c9ce30ef97dff",
|
|
19
19
|
target: "mlkem-native",
|
|
20
20
|
source_dir: "mlkem"
|
|
21
21
|
},
|
|
22
22
|
mldsa: {
|
|
23
23
|
repo: "https://github.com/pq-code-package/mldsa-native.git",
|
|
24
|
-
ref: "v2.
|
|
25
|
-
commit: "
|
|
26
|
-
tree_sha256: "
|
|
24
|
+
ref: "v2.1.0",
|
|
25
|
+
commit: "c9999d77599a9f0f0281ad745ad59a83f177b22c",
|
|
26
|
+
tree_sha256: "b00aa86111dc66fe8bad91ddf083817677d4d3685fcf6eac70e6572d96dc907f",
|
|
27
27
|
target: "mldsa-native",
|
|
28
28
|
source_dir: "mldsa"
|
|
29
29
|
}
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: pq_crypto
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.6.
|
|
4
|
+
version: 0.6.9
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Roman Haydarov
|
|
@@ -89,6 +89,7 @@ files:
|
|
|
89
89
|
- ext/pqcrypto/vendor/mldsa-native/mldsa/mldsa_native.h
|
|
90
90
|
- ext/pqcrypto/vendor/mldsa-native/mldsa/mldsa_native_asm.S
|
|
91
91
|
- ext/pqcrypto/vendor/mldsa-native/mldsa/mldsa_native_config.h
|
|
92
|
+
- ext/pqcrypto/vendor/mldsa-native/mldsa/src/capability.h
|
|
92
93
|
- ext/pqcrypto/vendor/mldsa-native/mldsa/src/cbmc.h
|
|
93
94
|
- ext/pqcrypto/vendor/mldsa-native/mldsa/src/common.h
|
|
94
95
|
- ext/pqcrypto/vendor/mldsa-native/mldsa/src/context.h
|
|
@@ -125,9 +126,14 @@ files:
|
|
|
125
126
|
- ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/armv81m/src/keccak_f1600_x4_state_xor_bytes_mve.S
|
|
126
127
|
- ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/armv81m/src/keccakf1600_round_constants.c
|
|
127
128
|
- ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/auto.h
|
|
129
|
+
- ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/x86_64/auto.h
|
|
130
|
+
- ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/x86_64/keccak_f1600_x1_avx512.h
|
|
128
131
|
- ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/x86_64/keccak_f1600_x4_avx2.h
|
|
132
|
+
- ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/x86_64/keccak_f1600_x4_avx512.h
|
|
129
133
|
- ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/x86_64/src/fips202_native_x86_64.h
|
|
134
|
+
- ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/x86_64/src/keccak_f1600_x1_avx512_asm.S
|
|
130
135
|
- ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/x86_64/src/keccak_f1600_x4_avx2_asm.S
|
|
136
|
+
- ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/x86_64/src/keccak_f1600_x4_avx512_asm.S
|
|
131
137
|
- ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/x86_64/src/keccakf1600_constants.c
|
|
132
138
|
- ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/meta.h
|
|
133
139
|
- ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/aarch64_zetas.c
|
|
@@ -154,6 +160,15 @@ files:
|
|
|
154
160
|
- ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/rej_uniform_table.c
|
|
155
161
|
- ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/api.h
|
|
156
162
|
- ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/meta.h
|
|
163
|
+
- ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/rv32im/fastmul.h
|
|
164
|
+
- ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/rv32im/slowmul.h
|
|
165
|
+
- ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/rv32im/src/arith_native_rv32im.h
|
|
166
|
+
- ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/rv32im/src/mldsa_intt_rv32im_asm.S
|
|
167
|
+
- ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/rv32im/src/mldsa_intt_rv32im_slowmul_asm.S
|
|
168
|
+
- ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/rv32im/src/mldsa_ntt_rv32im_asm.S
|
|
169
|
+
- ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/rv32im/src/mldsa_ntt_rv32im_slowmul_asm.S
|
|
170
|
+
- ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/rv32im/src/mldsa_poly_pointwise_montgomery_rv32im_asm.S
|
|
171
|
+
- ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/rv32im/src/rv32im_zetas.c
|
|
157
172
|
- ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/meta.h
|
|
158
173
|
- ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/arith_native_x86_64.h
|
|
159
174
|
- ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/consts.c
|
|
@@ -207,6 +222,7 @@ files:
|
|
|
207
222
|
- ext/pqcrypto/vendor/mlkem-native/mlkem/mlkem_native.h
|
|
208
223
|
- ext/pqcrypto/vendor/mlkem-native/mlkem/mlkem_native_asm.S
|
|
209
224
|
- ext/pqcrypto/vendor/mlkem-native/mlkem/mlkem_native_config.h
|
|
225
|
+
- ext/pqcrypto/vendor/mlkem-native/mlkem/src/capability.h
|
|
210
226
|
- ext/pqcrypto/vendor/mlkem-native/mlkem/src/cbmc.h
|
|
211
227
|
- ext/pqcrypto/vendor/mlkem-native/mlkem/src/common.h
|
|
212
228
|
- ext/pqcrypto/vendor/mlkem-native/mlkem/src/compress.c
|
|
@@ -243,9 +259,14 @@ files:
|
|
|
243
259
|
- ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/armv81m/src/keccak_f1600_x4_state_xor_bytes_mve.S
|
|
244
260
|
- ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/armv81m/src/keccakf1600_round_constants.c
|
|
245
261
|
- ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/auto.h
|
|
262
|
+
- ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/x86_64/auto.h
|
|
263
|
+
- ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/x86_64/keccak_f1600_x1_avx512.h
|
|
246
264
|
- ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/x86_64/keccak_f1600_x4_avx2.h
|
|
265
|
+
- ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/x86_64/keccak_f1600_x4_avx512.h
|
|
247
266
|
- ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/x86_64/src/fips202_native_x86_64.h
|
|
267
|
+
- ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/x86_64/src/keccak_f1600_x1_avx512_asm.S
|
|
248
268
|
- ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/x86_64/src/keccak_f1600_x4_avx2_asm.S
|
|
269
|
+
- ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/x86_64/src/keccak_f1600_x4_avx512_asm.S
|
|
249
270
|
- ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/x86_64/src/keccakf1600_constants.c
|
|
250
271
|
- ext/pqcrypto/vendor/mlkem-native/mlkem/src/indcpa.c
|
|
251
272
|
- ext/pqcrypto/vendor/mlkem-native/mlkem/src/indcpa.h
|
|
@@ -255,8 +276,22 @@ files:
|
|
|
255
276
|
- ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/meta.h
|
|
256
277
|
- ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/aarch64_zetas.c
|
|
257
278
|
- ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/arith_native_aarch64.h
|
|
279
|
+
- ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/compress_d5_table.c
|
|
280
|
+
- ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/decompress_d10_table.c
|
|
281
|
+
- ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/decompress_d11_table.c
|
|
282
|
+
- ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/decompress_d4_table.c
|
|
283
|
+
- ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/decompress_d5_table.c
|
|
258
284
|
- ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/mlkem_intt_aarch64_asm.S
|
|
259
285
|
- ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/mlkem_ntt_aarch64_asm.S
|
|
286
|
+
- ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/mlkem_poly_compress_d10_aarch64_asm.S
|
|
287
|
+
- ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/mlkem_poly_compress_d11_aarch64_asm.S
|
|
288
|
+
- ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/mlkem_poly_compress_d4_aarch64_asm.S
|
|
289
|
+
- ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/mlkem_poly_compress_d5_aarch64_asm.S
|
|
290
|
+
- ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/mlkem_poly_decompress_d10_aarch64_asm.S
|
|
291
|
+
- ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/mlkem_poly_decompress_d11_aarch64_asm.S
|
|
292
|
+
- ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/mlkem_poly_decompress_d4_aarch64_asm.S
|
|
293
|
+
- ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/mlkem_poly_decompress_d5_aarch64_asm.S
|
|
294
|
+
- ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/mlkem_poly_frombytes_aarch64_asm.S
|
|
260
295
|
- ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/mlkem_poly_mulcache_compute_aarch64_asm.S
|
|
261
296
|
- ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/mlkem_poly_reduce_aarch64_asm.S
|
|
262
297
|
- ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/mlkem_poly_tobytes_aarch64_asm.S
|