pq_crypto 0.6.8 → 0.6.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (206) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +11 -0
  3. data/README.md +1 -3
  4. data/ext/pqcrypto/pqcrypto_version.h +1 -1
  5. data/ext/pqcrypto/vendor/.vendored +7 -7
  6. data/ext/pqcrypto/vendor/mldsa-native/BUILDING.md +71 -0
  7. data/ext/pqcrypto/vendor/mldsa-native/README.md +26 -11
  8. data/ext/pqcrypto/vendor/mldsa-native/RELEASE.md +77 -150
  9. data/ext/pqcrypto/vendor/mldsa-native/mldsa/mldsa_native.c +93 -40
  10. data/ext/pqcrypto/vendor/mldsa-native/mldsa/mldsa_native.h +74 -59
  11. data/ext/pqcrypto/vendor/mldsa-native/mldsa/mldsa_native_asm.S +106 -40
  12. data/ext/pqcrypto/vendor/mldsa-native/mldsa/mldsa_native_config.h +94 -92
  13. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/capability.h +31 -0
  14. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/cbmc.h +55 -4
  15. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/common.h +30 -0
  16. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/context.h +1 -0
  17. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/debug.c +1 -0
  18. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/fips202.h +1 -0
  19. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/aarch64/src/keccak_f1600_x1_scalar_aarch64_asm.S +5 -2
  20. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/aarch64/src/keccak_f1600_x1_v84a_aarch64_asm.S +4 -4
  21. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/aarch64/src/keccak_f1600_x2_v84a_aarch64_asm.S +4 -4
  22. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/aarch64/src/keccak_f1600_x4_v8a_scalar_hybrid_aarch64_asm.S +8 -3
  23. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/aarch64/src/keccak_f1600_x4_v8a_v84a_scalar_hybrid_aarch64_asm.S +8 -4
  24. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/armv81m/mve.h +12 -0
  25. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/armv81m/src/keccak_f1600_x4_mve.S +4 -2
  26. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/armv81m/src/keccak_f1600_x4_state_extract_bytes_mve.S +37 -19
  27. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/armv81m/src/keccak_f1600_x4_state_xor_bytes_mve.S +37 -19
  28. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/auto.h +3 -8
  29. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/x86_64/auto.h +53 -0
  30. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/x86_64/keccak_f1600_x1_avx512.h +38 -0
  31. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/x86_64/keccak_f1600_x4_avx512.h +38 -0
  32. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/x86_64/src/fips202_native_x86_64.h +24 -0
  33. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/x86_64/src/keccak_f1600_x1_avx512_asm.S +574 -0
  34. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/x86_64/src/keccak_f1600_x4_avx2_asm.S +46 -18
  35. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/x86_64/src/keccak_f1600_x4_avx512_asm.S +679 -0
  36. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/x86_64/src/keccakf1600_constants.c +13 -4
  37. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/meta.h +6 -4
  38. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/arith_native_aarch64.h +5 -6
  39. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/mldsa_intt_aarch64_asm.S +4 -2
  40. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/mldsa_ntt_aarch64_asm.S +4 -2
  41. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/mldsa_pointwise_montgomery_aarch64_asm.S +6 -4
  42. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/mldsa_poly_caddq_aarch64_asm.S +4 -2
  43. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/mldsa_poly_chknorm_aarch64_asm.S +6 -4
  44. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/mldsa_poly_decompose_32_aarch64_asm.S +4 -3
  45. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/mldsa_poly_decompose_88_aarch64_asm.S +4 -3
  46. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/mldsa_poly_use_hint_32_aarch64_asm.S +4 -3
  47. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/mldsa_poly_use_hint_88_aarch64_asm.S +4 -3
  48. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/mldsa_polyvecl_pointwise_acc_montgomery_l4_aarch64_asm.S +4 -2
  49. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/mldsa_polyvecl_pointwise_acc_montgomery_l5_aarch64_asm.S +4 -2
  50. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/mldsa_polyvecl_pointwise_acc_montgomery_l7_aarch64_asm.S +4 -2
  51. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/mldsa_polyz_unpack_17_aarch64_asm.S +5 -3
  52. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/mldsa_polyz_unpack_19_aarch64_asm.S +5 -3
  53. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/mldsa_rej_uniform_aarch64_asm.S +110 -120
  54. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/mldsa_rej_uniform_eta2_aarch64_asm.S +109 -101
  55. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/mldsa_rej_uniform_eta4_aarch64_asm.S +97 -93
  56. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/api.h +1 -9
  57. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/meta.h +4 -0
  58. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/rv32im/fastmul.h +74 -0
  59. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/rv32im/slowmul.h +77 -0
  60. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/rv32im/src/arith_native_rv32im.h +124 -0
  61. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/rv32im/src/mldsa_intt_rv32im_asm.S +331 -0
  62. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/rv32im/src/mldsa_intt_rv32im_slowmul_asm.S +381 -0
  63. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/rv32im/src/mldsa_ntt_rv32im_asm.S +304 -0
  64. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/rv32im/src/mldsa_ntt_rv32im_slowmul_asm.S +351 -0
  65. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/rv32im/src/mldsa_poly_pointwise_montgomery_rv32im_asm.S +139 -0
  66. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/rv32im/src/rv32im_zetas.c +118 -0
  67. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/meta.h +6 -5
  68. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/arith_native_x86_64.h +2 -3
  69. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/mldsa_intt_avx2_asm.S +5 -3
  70. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/mldsa_ntt_avx2_asm.S +5 -3
  71. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/mldsa_nttunpack_avx2_asm.S +5 -3
  72. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/mldsa_pointwise_acc_l4_avx2_asm.S +6 -3
  73. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/mldsa_pointwise_acc_l5_avx2_asm.S +6 -3
  74. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/mldsa_pointwise_acc_l7_avx2_asm.S +6 -3
  75. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/mldsa_pointwise_avx2_asm.S +5 -3
  76. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/mldsa_poly_caddq_avx2_asm.S +5 -3
  77. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/mldsa_poly_chknorm_avx2_asm.S +7 -5
  78. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/mldsa_poly_decompose_32_avx2_asm.S +69 -67
  79. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/mldsa_poly_decompose_88_avx2_asm.S +69 -67
  80. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/mldsa_poly_use_hint_32_avx2_asm.S +12 -16
  81. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/mldsa_poly_use_hint_88_avx2_asm.S +14 -18
  82. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/mldsa_polyz_unpack_17_avx2_asm.S +6 -3
  83. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/mldsa_polyz_unpack_19_avx2_asm.S +6 -3
  84. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/mldsa_rej_uniform_avx2_asm.S +5 -3
  85. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/mldsa_rej_uniform_eta2_avx2_asm.S +5 -3
  86. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/mldsa_rej_uniform_eta4_avx2_asm.S +5 -3
  87. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/packing.c +23 -27
  88. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/packing.h +21 -42
  89. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/params.h +28 -1
  90. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/poly.c +87 -28
  91. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/poly.h +61 -3
  92. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/poly_kl.c +23 -19
  93. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/poly_kl.h +30 -0
  94. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/polyvec.c +55 -107
  95. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/polyvec.h +67 -107
  96. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/polyvec_lazy.c +16 -24
  97. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/polyvec_lazy.h +27 -21
  98. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/reduce.h +8 -8
  99. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/sign.c +191 -119
  100. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/sign.h +6 -3
  101. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/sys.h +16 -42
  102. data/ext/pqcrypto/vendor/mlkem-native/BUILDING.md +72 -0
  103. data/ext/pqcrypto/vendor/mlkem-native/README.md +9 -5
  104. data/ext/pqcrypto/vendor/mlkem-native/RELEASE.md +64 -312
  105. data/ext/pqcrypto/vendor/mlkem-native/mlkem/mlkem_native.c +77 -34
  106. data/ext/pqcrypto/vendor/mlkem-native/mlkem/mlkem_native.h +41 -13
  107. data/ext/pqcrypto/vendor/mlkem-native/mlkem/mlkem_native_asm.S +89 -33
  108. data/ext/pqcrypto/vendor/mlkem-native/mlkem/mlkem_native_config.h +50 -46
  109. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/capability.h +30 -0
  110. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/common.h +30 -0
  111. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/compress.c +1 -0
  112. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/compress.h +4 -5
  113. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/debug.c +1 -0
  114. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/fips202.c +15 -0
  115. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/fips202.h +23 -8
  116. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/fips202x4.c +11 -3
  117. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/fips202x4.h +7 -1
  118. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/keccakf1600.c +8 -0
  119. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/keccakf1600.h +8 -0
  120. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/aarch64/src/keccak_f1600_x1_scalar_aarch64_asm.S +5 -2
  121. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/aarch64/src/keccak_f1600_x1_v84a_aarch64_asm.S +4 -4
  122. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/aarch64/src/keccak_f1600_x2_v84a_aarch64_asm.S +4 -4
  123. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/aarch64/src/keccak_f1600_x4_v8a_scalar_hybrid_aarch64_asm.S +8 -3
  124. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/aarch64/src/keccak_f1600_x4_v8a_v84a_scalar_hybrid_aarch64_asm.S +8 -4
  125. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/armv81m/src/keccak_f1600_x4_mve.S +4 -2
  126. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/armv81m/src/keccak_f1600_x4_state_extract_bytes_mve.S +37 -19
  127. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/armv81m/src/keccak_f1600_x4_state_xor_bytes_mve.S +37 -19
  128. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/auto.h +2 -2
  129. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/x86_64/auto.h +47 -0
  130. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/x86_64/keccak_f1600_x1_avx512.h +37 -0
  131. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/x86_64/keccak_f1600_x4_avx512.h +37 -0
  132. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/x86_64/src/fips202_native_x86_64.h +24 -0
  133. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/x86_64/src/keccak_f1600_x1_avx512_asm.S +573 -0
  134. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/x86_64/src/keccak_f1600_x4_avx2_asm.S +46 -18
  135. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/x86_64/src/keccak_f1600_x4_avx512_asm.S +678 -0
  136. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/x86_64/src/keccakf1600_constants.c +13 -4
  137. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/indcpa.c +1 -2
  138. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/kem.c +7 -5
  139. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/kem.h +29 -5
  140. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/meta.h +156 -0
  141. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/arith_native_aarch64.h +137 -3
  142. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/compress_d5_table.c +43 -0
  143. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/decompress_d10_table.c +50 -0
  144. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/decompress_d11_table.c +53 -0
  145. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/decompress_d4_table.c +44 -0
  146. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/decompress_d5_table.c +53 -0
  147. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/mlkem_intt_aarch64_asm.S +5 -3
  148. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/mlkem_ntt_aarch64_asm.S +4 -2
  149. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/mlkem_poly_compress_d10_aarch64_asm.S +439 -0
  150. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/mlkem_poly_compress_d11_aarch64_asm.S +452 -0
  151. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/mlkem_poly_compress_d4_aarch64_asm.S +106 -0
  152. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/mlkem_poly_compress_d5_aarch64_asm.S +124 -0
  153. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/mlkem_poly_decompress_d10_aarch64_asm.S +108 -0
  154. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/mlkem_poly_decompress_d11_aarch64_asm.S +116 -0
  155. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/mlkem_poly_decompress_d4_aarch64_asm.S +93 -0
  156. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/mlkem_poly_decompress_d5_aarch64_asm.S +104 -0
  157. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/mlkem_poly_frombytes_aarch64_asm.S +84 -0
  158. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/mlkem_poly_mulcache_compute_aarch64_asm.S +4 -2
  159. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/mlkem_poly_reduce_aarch64_asm.S +4 -2
  160. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/mlkem_poly_tobytes_aarch64_asm.S +5 -3
  161. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/mlkem_poly_tomont_aarch64_asm.S +4 -3
  162. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/mlkem_polyvec_basemul_acc_montgomery_cached_k2_aarch64_asm.S +4 -2
  163. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/mlkem_polyvec_basemul_acc_montgomery_cached_k3_aarch64_asm.S +4 -2
  164. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/mlkem_polyvec_basemul_acc_montgomery_cached_k4_aarch64_asm.S +4 -2
  165. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/mlkem_rej_uniform_aarch64_asm.S +112 -104
  166. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/api.h +0 -1
  167. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/meta.h +2 -2
  168. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/ppc64le/README.md +2 -2
  169. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/ppc64le/meta.h +16 -21
  170. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/ppc64le/src/arith_native_ppc64le.h +1 -0
  171. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/ppc64le/src/consts.c +2 -2
  172. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/ppc64le/src/mlkem_intt_ppc_asm.S +6 -5
  173. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/ppc64le/src/mlkem_ntt_ppc_asm.S +6 -5
  174. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/ppc64le/src/mlkem_poly_tomont_ppc_asm.S +6 -5
  175. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/ppc64le/src/mlkem_reduce_ppc_asm.S +6 -5
  176. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/riscv64/src/rv64v_debug.c +5 -4
  177. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/riscv64/src/rv64v_debug.h +2 -2
  178. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/riscv64/src/rv64v_poly.c +1 -1
  179. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/arith_native_x86_64.h +5 -5
  180. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/mlkem_intt_avx2_asm.S +36 -33
  181. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/mlkem_ntt_avx2_asm.S +67 -65
  182. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/mlkem_nttfrombytes_avx2_asm.S +8 -5
  183. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/mlkem_ntttobytes_avx2_asm.S +6 -3
  184. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/mlkem_nttunpack_avx2_asm.S +5 -3
  185. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/mlkem_poly_compress_d10_avx2_asm.S +7 -5
  186. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/mlkem_poly_compress_d11_avx2_asm.S +7 -4
  187. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/mlkem_poly_compress_d4_avx2_asm.S +7 -5
  188. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/mlkem_poly_compress_d5_avx2_asm.S +7 -4
  189. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/mlkem_poly_decompress_d10_avx2_asm.S +7 -4
  190. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/mlkem_poly_decompress_d11_avx2_asm.S +6 -4
  191. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/mlkem_poly_decompress_d4_avx2_asm.S +7 -4
  192. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/mlkem_poly_decompress_d5_avx2_asm.S +6 -4
  193. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/mlkem_poly_mulcache_compute_avx2_asm.S +5 -3
  194. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/mlkem_polyvec_basemul_acc_montgomery_cached_k2_avx2_asm.S +118 -115
  195. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/mlkem_polyvec_basemul_acc_montgomery_cached_k3_avx2_asm.S +174 -171
  196. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/mlkem_polyvec_basemul_acc_montgomery_cached_k4_avx2_asm.S +230 -227
  197. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/mlkem_reduce_avx2_asm.S +17 -15
  198. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/mlkem_rej_uniform_avx2_asm.S +7 -6
  199. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/mlkem_tomont_avx2_asm.S +5 -3
  200. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/poly_k.c +4 -9
  201. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/poly_k.h +1 -1
  202. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/sys.h +31 -44
  203. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/verify.h +1 -1
  204. data/lib/pq_crypto/version.rb +1 -1
  205. data/script/vendor_libs.rb +6 -6
  206. metadata +36 -1
@@ -25,7 +25,8 @@
25
25
 
26
26
  #include "../../../common.h"
27
27
 
28
- #if defined(MLK_ARITH_BACKEND_X86_64_DEFAULT) && \
28
+ #if defined(MLK_SYS_X86_64_AVX2) && \
29
+ defined(MLK_ARITH_BACKEND_X86_64_DEFAULT) && \
29
30
  !defined(MLK_CONFIG_MULTILEVEL_NO_SHARED)
30
31
  /*yaml
31
32
  Name: reduce_avx2_asm
@@ -104,27 +105,27 @@ MLK_ASM_FN_SYMBOL(reduce_avx2_asm)
104
105
  vpsubw %ymm0, %ymm2, %ymm2
105
106
  vpsraw $0xf, %ymm2, %ymm12
106
107
  vpand %ymm0, %ymm12, %ymm12
107
- vpaddw %ymm12, %ymm2, %ymm2
108
+ vpaddw %ymm2, %ymm12, %ymm2
108
109
  vpsubw %ymm0, %ymm3, %ymm3
109
110
  vpsraw $0xf, %ymm3, %ymm12
110
111
  vpand %ymm0, %ymm12, %ymm12
111
- vpaddw %ymm12, %ymm3, %ymm3
112
+ vpaddw %ymm3, %ymm12, %ymm3
112
113
  vpsubw %ymm0, %ymm4, %ymm4
113
114
  vpsraw $0xf, %ymm4, %ymm12
114
115
  vpand %ymm0, %ymm12, %ymm12
115
- vpaddw %ymm12, %ymm4, %ymm4
116
+ vpaddw %ymm4, %ymm12, %ymm4
116
117
  vpsubw %ymm0, %ymm5, %ymm5
117
118
  vpsraw $0xf, %ymm5, %ymm12
118
119
  vpand %ymm0, %ymm12, %ymm12
119
- vpaddw %ymm12, %ymm5, %ymm5
120
+ vpaddw %ymm5, %ymm12, %ymm5
120
121
  vpsubw %ymm0, %ymm6, %ymm6
121
122
  vpsraw $0xf, %ymm6, %ymm12
122
123
  vpand %ymm0, %ymm12, %ymm12
123
- vpaddw %ymm12, %ymm6, %ymm6
124
+ vpaddw %ymm6, %ymm12, %ymm6
124
125
  vpsubw %ymm0, %ymm7, %ymm7
125
126
  vpsraw $0xf, %ymm7, %ymm12
126
127
  vpand %ymm0, %ymm12, %ymm12
127
- vpaddw %ymm12, %ymm7, %ymm7
128
+ vpaddw %ymm7, %ymm12, %ymm7
128
129
  vpsubw %ymm0, %ymm8, %ymm8
129
130
  vpsraw $0xf, %ymm8, %ymm12
130
131
  vpand %ymm0, %ymm12, %ymm12
@@ -184,27 +185,27 @@ MLK_ASM_FN_SYMBOL(reduce_avx2_asm)
184
185
  vpsubw %ymm0, %ymm2, %ymm2
185
186
  vpsraw $0xf, %ymm2, %ymm12
186
187
  vpand %ymm0, %ymm12, %ymm12
187
- vpaddw %ymm12, %ymm2, %ymm2
188
+ vpaddw %ymm2, %ymm12, %ymm2
188
189
  vpsubw %ymm0, %ymm3, %ymm3
189
190
  vpsraw $0xf, %ymm3, %ymm12
190
191
  vpand %ymm0, %ymm12, %ymm12
191
- vpaddw %ymm12, %ymm3, %ymm3
192
+ vpaddw %ymm3, %ymm12, %ymm3
192
193
  vpsubw %ymm0, %ymm4, %ymm4
193
194
  vpsraw $0xf, %ymm4, %ymm12
194
195
  vpand %ymm0, %ymm12, %ymm12
195
- vpaddw %ymm12, %ymm4, %ymm4
196
+ vpaddw %ymm4, %ymm12, %ymm4
196
197
  vpsubw %ymm0, %ymm5, %ymm5
197
198
  vpsraw $0xf, %ymm5, %ymm12
198
199
  vpand %ymm0, %ymm12, %ymm12
199
- vpaddw %ymm12, %ymm5, %ymm5
200
+ vpaddw %ymm5, %ymm12, %ymm5
200
201
  vpsubw %ymm0, %ymm6, %ymm6
201
202
  vpsraw $0xf, %ymm6, %ymm12
202
203
  vpand %ymm0, %ymm12, %ymm12
203
- vpaddw %ymm12, %ymm6, %ymm6
204
+ vpaddw %ymm6, %ymm12, %ymm6
204
205
  vpsubw %ymm0, %ymm7, %ymm7
205
206
  vpsraw $0xf, %ymm7, %ymm12
206
207
  vpand %ymm0, %ymm12, %ymm12
207
- vpaddw %ymm12, %ymm7, %ymm7
208
+ vpaddw %ymm7, %ymm12, %ymm7
208
209
  vpsubw %ymm0, %ymm8, %ymm8
209
210
  vpsraw $0xf, %ymm8, %ymm12
210
211
  vpand %ymm0, %ymm12, %ymm12
@@ -221,13 +222,14 @@ MLK_ASM_FN_SYMBOL(reduce_avx2_asm)
221
222
  vmovdqa %ymm7, 0x1a0(%rdi)
222
223
  vmovdqa %ymm8, 0x1c0(%rdi)
223
224
  vmovdqa %ymm9, 0x1e0(%rdi)
225
+ vzeroupper
224
226
  retq
225
227
  .cfi_endproc
226
228
 
227
229
  MLK_ASM_FN_SIZE(reduce_avx2_asm)
228
230
 
229
- #endif /* MLK_ARITH_BACKEND_X86_64_DEFAULT && !MLK_CONFIG_MULTILEVEL_NO_SHARED \
230
- */
231
+ #endif /* MLK_SYS_X86_64_AVX2 && MLK_ARITH_BACKEND_X86_64_DEFAULT && \
232
+ !MLK_CONFIG_MULTILEVEL_NO_SHARED */
231
233
 
232
234
  #if defined(__ELF__)
233
235
  .section .note.GNU-stack,"",%progbits
@@ -13,19 +13,20 @@
13
13
  * 16-bit coefficients.
14
14
  * - const uint8_t *buf: pointer to input buffer
15
15
  * (assumed to be uniform random bytes)
16
- * - unsigned buflen: length of input buffer in bytes.
16
+ * - uint64_t buflen: length of input buffer in bytes.
17
17
  * Must be a multiple of 12.
18
18
  *
19
19
  * Returns number of sampled 16-bit integers (at most MLKEM_N).
20
20
  **************************************************/
21
21
  #include "../../../common.h"
22
22
 
23
- #if defined(MLK_ARITH_BACKEND_X86_64_DEFAULT) && \
23
+ #if defined(MLK_SYS_X86_64_AVX2) && \
24
+ defined(MLK_ARITH_BACKEND_X86_64_DEFAULT) && \
24
25
  !defined(MLK_CONFIG_MULTILEVEL_NO_SHARED)
25
26
  /*yaml
26
27
  Name: rej_uniform_avx2_asm
27
28
  Description: x86_64 AVX2 rejection sampling
28
- Signature: uint64_t mlk_rej_uniform_avx2_asm(int16_t *r, const uint8_t *buf, unsigned buflen, const uint8_t *table)
29
+ Signature: uint64_t mlk_rej_uniform_avx2_asm(int16_t *r, const uint8_t *buf, uint64_t buflen, const uint8_t *table)
29
30
  ABI:
30
31
  Architecture: x86_64
31
32
  CallingConvention: SysV
@@ -44,7 +45,7 @@
44
45
  description: Input buffer
45
46
  rdx:
46
47
  type: scalar
47
- c_parameter: unsigned buflen
48
+ c_parameter: uint64_t buflen
48
49
  description: Length of input buffer (must be multiple of 12)
49
50
  test_with: 504 # MLKEM_GEN_MATRIX_NBLOCKS * MLK_XOF_RATE
50
51
  rcx:
@@ -128,8 +129,8 @@ Lmlk_rej_uniform_asm_end:
128
129
 
129
130
  MLK_ASM_FN_SIZE(rej_uniform_avx2_asm)
130
131
 
131
- #endif /* MLK_ARITH_BACKEND_X86_64_DEFAULT && !MLK_CONFIG_MULTILEVEL_NO_SHARED \
132
- */
132
+ #endif /* MLK_SYS_X86_64_AVX2 && MLK_ARITH_BACKEND_X86_64_DEFAULT && \
133
+ !MLK_CONFIG_MULTILEVEL_NO_SHARED */
133
134
 
134
135
  #if defined(__ELF__)
135
136
  .section .note.GNU-stack,"",%progbits
@@ -23,7 +23,8 @@
23
23
  */
24
24
 
25
25
  #include "../../../common.h"
26
- #if defined(MLK_ARITH_BACKEND_X86_64_DEFAULT) && \
26
+ #if defined(MLK_SYS_X86_64_AVX2) && \
27
+ defined(MLK_ARITH_BACKEND_X86_64_DEFAULT) && \
27
28
  !defined(MLK_CONFIG_MULTILEVEL_NO_SHARED) && \
28
29
  !defined(MLK_CONFIG_NO_KEYPAIR_API)
29
30
  /*yaml
@@ -159,13 +160,14 @@ MLK_ASM_FN_SYMBOL(tomont_avx2_asm)
159
160
  vmovdqa %ymm8, 0x1a0(%rdi)
160
161
  vmovdqa %ymm9, 0x1c0(%rdi)
161
162
  vmovdqa %ymm10, 0x1e0(%rdi)
163
+ vzeroupper
162
164
  retq
163
165
  .cfi_endproc
164
166
 
165
167
  MLK_ASM_FN_SIZE(tomont_avx2_asm)
166
168
 
167
- #endif /* MLK_ARITH_BACKEND_X86_64_DEFAULT && !MLK_CONFIG_MULTILEVEL_NO_SHARED \
168
- && !MLK_CONFIG_NO_KEYPAIR_API */
169
+ #endif /* MLK_SYS_X86_64_AVX2 && MLK_ARITH_BACKEND_X86_64_DEFAULT && \
170
+ !MLK_CONFIG_MULTILEVEL_NO_SHARED && !MLK_CONFIG_NO_KEYPAIR_API */
169
171
 
170
172
  #if defined(__ELF__)
171
173
  .section .note.GNU-stack,"",%progbits
@@ -23,7 +23,6 @@
23
23
  */
24
24
 
25
25
  #include "poly_k.h"
26
-
27
26
  #include "debug.h"
28
27
  #include "sampling.h"
29
28
  #include "symmetric.h"
@@ -361,8 +360,7 @@ void mlk_poly_getnoise_eta1_4x(mlk_poly *r0, mlk_poly *r1, mlk_poly *r2,
361
360
  extkey[2][MLKEM_SYMBYTES] = nonce2;
362
361
  extkey[3][MLKEM_SYMBYTES] = nonce3;
363
362
 
364
- #if !defined(FIPS202_X4_DEFAULT_IMPLEMENTATION) && \
365
- !defined(MLK_CONFIG_SERIAL_FIPS202_ONLY)
363
+ #if !defined(MLK_CONFIG_SERIAL_FIPS202_ONLY)
366
364
  mlk_prf_eta1_x4(buf, extkey);
367
365
  #else
368
366
  mlk_prf_eta1(buf[0], extkey[0]);
@@ -372,8 +370,7 @@ void mlk_poly_getnoise_eta1_4x(mlk_poly *r0, mlk_poly *r1, mlk_poly *r2,
372
370
  {
373
371
  mlk_prf_eta1(buf[3], extkey[3]);
374
372
  }
375
- #endif /* !(!FIPS202_X4_DEFAULT_IMPLEMENTATION && \
376
- !MLK_CONFIG_SERIAL_FIPS202_ONLY) */
373
+ #endif /* MLK_CONFIG_SERIAL_FIPS202_ONLY */
377
374
 
378
375
  mlk_poly_cbd_eta1(r0, buf[0]);
379
376
  mlk_poly_cbd_eta1(r1, buf[1]);
@@ -486,16 +483,14 @@ void mlk_poly_getnoise_eta1122_4x(mlk_poly *r0, mlk_poly *r1, mlk_poly *r2,
486
483
  /* On systems with fast batched Keccak, we use 4-fold batched PRF,
487
484
  * even though that means generating more random data in buf[2] and buf[3]
488
485
  * than necessary. */
489
- #if !defined(FIPS202_X4_DEFAULT_IMPLEMENTATION) && \
490
- !defined(MLK_CONFIG_SERIAL_FIPS202_ONLY)
486
+ #if !defined(MLK_CONFIG_SERIAL_FIPS202_ONLY)
491
487
  mlk_prf_eta1_x4(buf, extkey);
492
488
  #else
493
489
  mlk_prf_eta1(buf[0], extkey[0]);
494
490
  mlk_prf_eta1(buf[1], extkey[1]);
495
491
  mlk_prf_eta2(buf[2], extkey[2]);
496
492
  mlk_prf_eta2(buf[3], extkey[3]);
497
- #endif /* !(!FIPS202_X4_DEFAULT_IMPLEMENTATION && \
498
- !MLK_CONFIG_SERIAL_FIPS202_ONLY) */
493
+ #endif /* MLK_CONFIG_SERIAL_FIPS202_ONLY */
499
494
 
500
495
  mlk_poly_cbd_eta1(r0, buf[0]);
501
496
  mlk_poly_cbd_eta1(r1, buf[1]);
@@ -552,7 +552,7 @@ __contract__(
552
552
  * @spec{Implements `SamplePolyCBD_{eta2} (PRF_{eta2} (sigma, N))`:
553
553
  * @[FIPS203, Algorithm 8, SamplePolyCBD_eta] and @[FIPS203, Eq (4.3),
554
554
  * PRF_eta]. `SamplePolyCBD_{eta2} (PRF_{eta2} (sigma, N))` appears in
555
- * @[FIPS203, Algorithm 14, K-PKE.Encrypt, L14].}
555
+ * @[FIPS203, Algorithm 14, K-PKE.Encrypt, L17].}
556
556
  *
557
557
  * @param[out] r Output polynomial.
558
558
  * @param[in] seed Input seed (of length MLKEM_SYMBYTES bytes).
@@ -5,9 +5,9 @@
5
5
  #ifndef MLK_SYS_H
6
6
  #define MLK_SYS_H
7
7
 
8
- #if !defined(MLK_CONFIG_NO_ASM) && (defined(__GNUC__) || defined(__clang__))
9
- #define MLK_HAVE_INLINE_ASM
10
- #endif
8
+ /* This header must not depend on configuration options: configuration
9
+ * hooks may include it before all options are defined, and its include
10
+ * guard prevents re-evaluation. Evaluate options in common.h instead. */
11
11
 
12
12
  /* Try to find endianness, if not forced through CFLAGS already */
13
13
  #if !defined(MLK_SYS_LITTLE_ENDIAN) && !defined(MLK_SYS_BIG_ENDIAN)
@@ -57,8 +57,9 @@
57
57
  #define MLK_SYS_AARCH64_EB
58
58
  #endif
59
59
 
60
- /* Check if we're running on an Armv8.1-M system with MVE */
61
- #if defined(__ARM_ARCH_8_1M_MAIN__) || defined(__ARM_FEATURE_MVE)
60
+ /* Check if the Armv8.1-M compilation target supports MVE. Armv8.1-M
61
+ * architecture support alone does not imply that MVE is enabled. */
62
+ #if defined(__ARM_FEATURE_MVE)
62
63
  #define MLK_SYS_ARMV81M_MVE
63
64
  #endif
64
65
 
@@ -68,20 +69,38 @@
68
69
  #if defined(__AVX2__)
69
70
  #define MLK_SYS_X86_64_AVX2
70
71
  #endif
72
+ /* Check if the compilation target supports the AVX-512 extensions used by
73
+ * the AVX-512 backend: AVX-512F, AVX-512VL and AVX-512DQ. */
74
+ #if defined(__AVX512F__) && defined(__AVX512VL__) && defined(__AVX512DQ__)
75
+ #define MLK_SYS_X86_64_AVX512
76
+ #endif
71
77
  #endif /* __x86_64__ || _M_X64 || _M_AMD64 */
72
78
 
73
79
  #if defined(MLK_SYS_LITTLE_ENDIAN) && defined(__powerpc64__)
74
80
  #define MLK_SYS_PPC64LE
75
81
  #endif
76
82
 
83
+ /* Check if the PPC64LE compilation target supports the vector instructions
84
+ * used by the POWER8 backend: AltiVec/VMX, VSX, and POWER8 vector extensions
85
+ * (Power ISA 2.07). AltiVec predates POWER8; VSX was introduced in POWER7. */
86
+ #if defined(MLK_SYS_PPC64LE) && defined(__ALTIVEC__) && defined(__VSX__) && \
87
+ defined(__POWER8_VECTOR__)
88
+ #define MLK_SYS_PPC64LE_POWER8_VECTOR
89
+ #endif
90
+
77
91
  #if defined(__riscv) && defined(__riscv_xlen) && __riscv_xlen == 64
78
92
  #define MLK_SYS_RISCV64
79
93
  #endif
80
94
 
95
+ /* check-magic: off */
96
+ /* The RVV backend requires v0.12 or later of the RVV intrinsics
97
+ * (__riscv_v_intrinsic >= 12000); older compilers such as gcc 13 fall
98
+ * back to C. */
81
99
  #if defined(MLK_SYS_RISCV64) && defined(__riscv_vector) && \
82
- defined(__riscv_v_intrinsic)
100
+ defined(__riscv_v_intrinsic) && __riscv_v_intrinsic >= 12000
83
101
  #define MLK_SYS_RISCV64_RVV
84
102
  #endif
103
+ /* check-magic: on */
85
104
 
86
105
  #if defined(__riscv) && defined(__riscv_xlen) && __riscv_xlen == 32
87
106
  #define MLK_SYS_RISCV32
@@ -235,23 +254,6 @@
235
254
  #endif
236
255
  #endif /* MLK_SYS_X86_64 */
237
256
 
238
- #if defined(MLK_CONFIG_CT_TESTING_ENABLED) && !defined(__ASSEMBLER__)
239
- #include <valgrind/memcheck.h>
240
- #define MLK_CT_TESTING_SECRET(ptr, len) \
241
- VALGRIND_MAKE_MEM_UNDEFINED((ptr), (len))
242
- #define MLK_CT_TESTING_DECLASSIFY(ptr, len) \
243
- VALGRIND_MAKE_MEM_DEFINED((ptr), (len))
244
- #else /* MLK_CONFIG_CT_TESTING_ENABLED && !__ASSEMBLER__ */
245
- #define MLK_CT_TESTING_SECRET(ptr, len) \
246
- do \
247
- { \
248
- } while (0)
249
- #define MLK_CT_TESTING_DECLASSIFY(ptr, len) \
250
- do \
251
- { \
252
- } while (0)
253
- #endif /* !(MLK_CONFIG_CT_TESTING_ENABLED && !__ASSEMBLER__) */
254
-
255
257
  #if defined(__GNUC__) || defined(__clang__)
256
258
  #define MLK_MUST_CHECK_RETURN_VALUE __attribute__((warn_unused_result))
257
259
  #else
@@ -289,32 +291,17 @@ typedef enum
289
291
  {
290
292
  /* x86_64 */
291
293
  MLK_SYS_CAP_X86_64_AVX2,
294
+ /* AVX-512F, AVX-512VL and AVX-512DQ */
295
+ MLK_SYS_CAP_X86_64_AVX512,
292
296
  /* AArch64 */
293
297
  MLK_SYS_CAP_AARCH64_NEON,
294
298
  MLK_SYS_CAP_AARCH64_SHA3,
295
299
  /* Armv8.1-M */
296
- MLK_SYS_CAP_ARMV81M_MVE
300
+ MLK_SYS_CAP_ARMV81M_MVE,
301
+ /* PowerPC64 */
302
+ /* AltiVec/VMX, VSX, and POWER8 vector extensions (Power ISA 2.07). */
303
+ MLK_SYS_CAP_PPC64LE_POWER8_VECTOR
297
304
  } mlk_sys_cap;
298
-
299
- #if !defined(MLK_CONFIG_CUSTOM_CAPABILITY_FUNC)
300
- #include "cbmc.h"
301
-
302
- MLK_MUST_CHECK_RETURN_VALUE
303
- static MLK_INLINE int mlk_sys_check_capability(mlk_sys_cap cap)
304
- __contract__(
305
- ensures(return_value == 0 || return_value == 1)
306
- )
307
- {
308
- /* By default, we rely on compile-time feature detection/specification:
309
- * If a feature is enabled at compile-time, we assume it is supported by
310
- * the host that the resulting library/binary will be built on.
311
- * If this assumption is not true, you MUST overwrite this function.
312
- * See the documentation of MLK_CONFIG_CUSTOM_CAPABILITY_FUNC in
313
- * mlkem_native_config.h for more information. */
314
- (void)cap;
315
- return 1;
316
- }
317
- #endif /* !MLK_CONFIG_CUSTOM_CAPABILITY_FUNC */
318
305
  #endif /* !__ASSEMBLER__ */
319
306
 
320
307
  #endif /* !MLK_SYS_H */
@@ -320,7 +320,7 @@ __contract__(ensures(return_value == (cond ? a : b)))
320
320
  * @spec{Used to securely compute conditional move in @[FIPS203, Algorithm
321
321
  * 18 (ML-KEM.Decaps_Internal, L9-11].}
322
322
  *
323
- * @reference{`cmov()` in the reference implementation @[REF]. We return
323
+ * @reference{`verify()` in the reference implementation @[REF]. We return
324
324
  * `uint8_t`, not `int`. We use an additional XOR-accumulator in the
325
325
  * comparison loop which prevents early abort if the OR-accumulator is 0xFF.
326
326
  * We use a value barrier to convert the OR-accumulator into a mask; the
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module PQCrypto
4
- VERSION = "0.6.8"
4
+ VERSION = "0.6.9"
5
5
  end
@@ -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.0.0",
17
- commit: "d1b2fe782888bdb761a50336012923180be7f502",
18
- tree_sha256: "18bfa9ea4e2232bdf56f8ec374b62d10e50b99a30cb08aafc18d0b97e00cd06f",
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.0.0",
25
- commit: "834a90d5e846ffa1e1611bd24e160bb2e9b86d35",
26
- tree_sha256: "25b3c3949d2ed37d1ad5d4722c8476d13deb2a0bb945f12444f463378d69375d",
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.8
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