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.
Files changed (408) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +25 -0
  3. data/GET_STARTED.md +21 -16
  4. data/README.md +26 -0
  5. data/SECURITY.md +22 -16
  6. data/ext/pqcrypto/extconf.rb +148 -99
  7. data/ext/pqcrypto/mldsa_api.h +1 -118
  8. data/ext/pqcrypto/mlkem_api.h +1 -42
  9. data/ext/pqcrypto/pq_externalmu.c +88 -216
  10. data/ext/pqcrypto/pqcrypto_native_api.h +129 -0
  11. data/ext/pqcrypto/pqcrypto_ruby_secure.c +0 -3
  12. data/ext/pqcrypto/pqcrypto_secure.c +135 -117
  13. data/ext/pqcrypto/pqcrypto_secure.h +1 -42
  14. data/ext/pqcrypto/pqcrypto_version.h +1 -1
  15. data/ext/pqcrypto/randombytes.h +9 -0
  16. data/ext/pqcrypto/vendor/.vendored +10 -5
  17. data/ext/pqcrypto/vendor/mldsa-native/BUILDING.md +105 -0
  18. data/ext/pqcrypto/vendor/mldsa-native/LICENSE +286 -0
  19. data/ext/pqcrypto/vendor/mldsa-native/META.yml +24 -0
  20. data/ext/pqcrypto/vendor/mldsa-native/README.md +221 -0
  21. data/ext/pqcrypto/vendor/mldsa-native/SECURITY.md +8 -0
  22. data/ext/pqcrypto/vendor/mldsa-native/mldsa/mldsa_native.c +721 -0
  23. data/ext/pqcrypto/vendor/mldsa-native/mldsa/mldsa_native.h +975 -0
  24. data/ext/pqcrypto/vendor/mldsa-native/mldsa/mldsa_native_asm.S +724 -0
  25. data/ext/pqcrypto/vendor/mldsa-native/mldsa/mldsa_native_config.h +723 -0
  26. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/cbmc.h +166 -0
  27. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/common.h +321 -0
  28. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/ct.c +21 -0
  29. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/ct.h +385 -0
  30. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/debug.c +73 -0
  31. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/debug.h +130 -0
  32. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/fips202.c +277 -0
  33. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/fips202.h +244 -0
  34. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/fips202x4.c +182 -0
  35. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/fips202x4.h +117 -0
  36. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/keccakf1600.c +438 -0
  37. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/keccakf1600.h +105 -0
  38. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/aarch64/auto.h +71 -0
  39. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/aarch64/src/fips202_native_aarch64.h +62 -0
  40. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/aarch64/src/keccak_f1600_x1_scalar_asm.S +376 -0
  41. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/aarch64/src/keccak_f1600_x1_v84a_asm.S +204 -0
  42. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/aarch64/src/keccak_f1600_x2_v84a_asm.S +259 -0
  43. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/aarch64/src/keccak_f1600_x4_v8a_scalar_hybrid_asm.S +1077 -0
  44. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/aarch64/src/keccak_f1600_x4_v8a_v84a_scalar_hybrid_asm.S +987 -0
  45. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/aarch64/src/keccakf1600_round_constants.c +41 -0
  46. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/aarch64/x1_scalar.h +26 -0
  47. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/aarch64/x1_v84a.h +35 -0
  48. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/aarch64/x2_v84a.h +37 -0
  49. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/aarch64/x4_v8a_scalar.h +27 -0
  50. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/aarch64/x4_v8a_v84a_scalar.h +36 -0
  51. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/api.h +69 -0
  52. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/armv81m/README.md +10 -0
  53. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/armv81m/mve.h +32 -0
  54. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/armv81m/src/fips202_native_armv81m.h +20 -0
  55. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/armv81m/src/keccak_f1600_x4_mve.S +638 -0
  56. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/armv81m/src/keccak_f1600_x4_mve.c +136 -0
  57. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/armv81m/src/keccakf1600_round_constants.c +52 -0
  58. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/auto.h +29 -0
  59. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/x86_64/src/KeccakP_1600_times4_SIMD256.c +488 -0
  60. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/x86_64/src/KeccakP_1600_times4_SIMD256.h +16 -0
  61. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/x86_64/xkcp.h +31 -0
  62. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/meta.h +247 -0
  63. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/aarch64_zetas.c +231 -0
  64. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/arith_native_aarch64.h +150 -0
  65. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/intt.S +753 -0
  66. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/mld_polyvecl_pointwise_acc_montgomery_l4.S +129 -0
  67. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/mld_polyvecl_pointwise_acc_montgomery_l5.S +145 -0
  68. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/mld_polyvecl_pointwise_acc_montgomery_l7.S +177 -0
  69. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/ntt.S +653 -0
  70. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/pointwise_montgomery.S +79 -0
  71. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/poly_caddq_asm.S +53 -0
  72. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/poly_chknorm_asm.S +55 -0
  73. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/poly_decompose_32_asm.S +85 -0
  74. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/poly_decompose_88_asm.S +85 -0
  75. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/poly_use_hint_32_asm.S +102 -0
  76. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/poly_use_hint_88_asm.S +110 -0
  77. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/polyz_unpack_17_asm.S +72 -0
  78. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/polyz_unpack_19_asm.S +69 -0
  79. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/polyz_unpack_table.c +40 -0
  80. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/rej_uniform_asm.S +189 -0
  81. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/rej_uniform_eta2_asm.S +135 -0
  82. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/rej_uniform_eta4_asm.S +128 -0
  83. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/rej_uniform_eta_table.c +543 -0
  84. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/rej_uniform_table.c +62 -0
  85. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/api.h +649 -0
  86. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/meta.h +23 -0
  87. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/meta.h +315 -0
  88. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/arith_native_x86_64.h +124 -0
  89. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/consts.c +157 -0
  90. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/consts.h +27 -0
  91. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/intt.S +2311 -0
  92. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/ntt.S +2383 -0
  93. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/nttunpack.S +239 -0
  94. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/pointwise.S +131 -0
  95. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/pointwise_acc_l4.S +139 -0
  96. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/pointwise_acc_l5.S +155 -0
  97. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/pointwise_acc_l7.S +187 -0
  98. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/poly_caddq_avx2.c +61 -0
  99. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/poly_chknorm_avx2.c +52 -0
  100. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/poly_decompose_32_avx2.c +155 -0
  101. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/poly_decompose_88_avx2.c +155 -0
  102. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/poly_use_hint_32_avx2.c +102 -0
  103. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/poly_use_hint_88_avx2.c +104 -0
  104. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/polyz_unpack_17_avx2.c +91 -0
  105. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/polyz_unpack_19_avx2.c +93 -0
  106. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/rej_uniform_avx2.c +126 -0
  107. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/rej_uniform_eta2_avx2.c +155 -0
  108. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/rej_uniform_eta4_avx2.c +139 -0
  109. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/rej_uniform_table.c +160 -0
  110. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/packing.c +293 -0
  111. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/packing.h +224 -0
  112. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/params.h +77 -0
  113. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/poly.c +991 -0
  114. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/poly.h +393 -0
  115. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/poly_kl.c +946 -0
  116. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/poly_kl.h +360 -0
  117. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/polyvec.c +877 -0
  118. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/polyvec.h +725 -0
  119. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/randombytes.h +26 -0
  120. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/reduce.h +139 -0
  121. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/rounding.h +249 -0
  122. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/sign.c +1511 -0
  123. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/sign.h +806 -0
  124. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/symmetric.h +68 -0
  125. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/sys.h +268 -0
  126. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/zetas.inc +55 -0
  127. data/ext/pqcrypto/vendor/mlkem-native/BUILDING.md +104 -0
  128. data/ext/pqcrypto/vendor/mlkem-native/LICENSE +294 -0
  129. data/ext/pqcrypto/vendor/mlkem-native/META.yml +30 -0
  130. data/ext/pqcrypto/vendor/mlkem-native/README.md +223 -0
  131. data/ext/pqcrypto/vendor/mlkem-native/RELEASE.md +86 -0
  132. data/ext/pqcrypto/vendor/mlkem-native/SECURITY.md +8 -0
  133. data/ext/pqcrypto/vendor/mlkem-native/mlkem/README.md +23 -0
  134. data/ext/pqcrypto/vendor/mlkem-native/mlkem/mlkem_native.c +660 -0
  135. data/ext/pqcrypto/vendor/mlkem-native/mlkem/mlkem_native.h +538 -0
  136. data/ext/pqcrypto/vendor/mlkem-native/mlkem/mlkem_native_asm.S +681 -0
  137. data/ext/pqcrypto/vendor/mlkem-native/mlkem/mlkem_native_config.h +709 -0
  138. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/cbmc.h +174 -0
  139. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/common.h +274 -0
  140. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/compress.c +717 -0
  141. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/compress.h +688 -0
  142. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/debug.c +64 -0
  143. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/debug.h +128 -0
  144. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/fips202.c +251 -0
  145. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/fips202.h +158 -0
  146. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/fips202x4.c +208 -0
  147. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/fips202x4.h +80 -0
  148. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/keccakf1600.c +463 -0
  149. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/keccakf1600.h +98 -0
  150. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/aarch64/auto.h +70 -0
  151. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/aarch64/src/fips202_native_aarch64.h +69 -0
  152. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/aarch64/src/keccak_f1600_x1_scalar_asm.S +375 -0
  153. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/aarch64/src/keccak_f1600_x1_v84a_asm.S +203 -0
  154. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/aarch64/src/keccak_f1600_x2_v84a_asm.S +258 -0
  155. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/aarch64/src/keccak_f1600_x4_v8a_scalar_hybrid_asm.S +1076 -0
  156. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/aarch64/src/keccak_f1600_x4_v8a_v84a_scalar_hybrid_asm.S +986 -0
  157. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/aarch64/src/keccakf1600_round_constants.c +46 -0
  158. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/aarch64/x1_scalar.h +25 -0
  159. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/aarch64/x1_v84a.h +34 -0
  160. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/aarch64/x2_v84a.h +35 -0
  161. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/aarch64/x4_v8a_scalar.h +26 -0
  162. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/aarch64/x4_v8a_v84a_scalar.h +35 -0
  163. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/api.h +117 -0
  164. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/armv81m/README.md +10 -0
  165. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/armv81m/mve.h +79 -0
  166. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/armv81m/src/fips202_native_armv81m.h +35 -0
  167. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/armv81m/src/keccak_f1600_x4_mve.S +667 -0
  168. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/armv81m/src/keccak_f1600_x4_mve.c +40 -0
  169. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/armv81m/src/keccakf1600_round_constants.c +51 -0
  170. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/armv81m/src/state_extract_bytes_x4_mve.S +290 -0
  171. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/armv81m/src/state_xor_bytes_x4_mve.S +314 -0
  172. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/auto.h +28 -0
  173. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/x86_64/keccak_f1600_x4_avx2.h +33 -0
  174. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/x86_64/src/fips202_native_x86_64.h +41 -0
  175. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/x86_64/src/keccak_f1600_x4_avx2.S +451 -0
  176. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/x86_64/src/keccakf1600_constants.c +51 -0
  177. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/indcpa.c +622 -0
  178. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/indcpa.h +156 -0
  179. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/kem.c +446 -0
  180. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/kem.h +326 -0
  181. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/README.md +16 -0
  182. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/meta.h +122 -0
  183. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/aarch64_zetas.c +174 -0
  184. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/arith_native_aarch64.h +177 -0
  185. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/intt.S +628 -0
  186. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/ntt.S +562 -0
  187. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/poly_mulcache_compute_asm.S +127 -0
  188. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/poly_reduce_asm.S +150 -0
  189. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/poly_tobytes_asm.S +117 -0
  190. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/poly_tomont_asm.S +98 -0
  191. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/polyvec_basemul_acc_montgomery_cached_asm_k2.S +261 -0
  192. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/polyvec_basemul_acc_montgomery_cached_asm_k3.S +314 -0
  193. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/polyvec_basemul_acc_montgomery_cached_asm_k4.S +368 -0
  194. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/rej_uniform_asm.S +226 -0
  195. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/rej_uniform_table.c +542 -0
  196. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/api.h +637 -0
  197. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/meta.h +25 -0
  198. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/riscv64/README.md +11 -0
  199. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/riscv64/meta.h +128 -0
  200. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/riscv64/src/arith_native_riscv64.h +45 -0
  201. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/riscv64/src/rv64v_debug.c +81 -0
  202. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/riscv64/src/rv64v_debug.h +145 -0
  203. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/riscv64/src/rv64v_izetas.inc +27 -0
  204. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/riscv64/src/rv64v_poly.c +805 -0
  205. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/riscv64/src/rv64v_zetas.inc +27 -0
  206. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/riscv64/src/rv64v_zetas_basemul.inc +39 -0
  207. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/README.md +4 -0
  208. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/meta.h +304 -0
  209. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/arith_native_x86_64.h +309 -0
  210. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/compress_consts.c +94 -0
  211. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/compress_consts.h +45 -0
  212. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/consts.c +102 -0
  213. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/consts.h +25 -0
  214. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/intt.S +719 -0
  215. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/mulcache_compute.S +90 -0
  216. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/ntt.S +639 -0
  217. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/nttfrombytes.S +193 -0
  218. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/ntttobytes.S +181 -0
  219. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/nttunpack.S +174 -0
  220. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/poly_compress_d10.S +382 -0
  221. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/poly_compress_d11.S +448 -0
  222. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/poly_compress_d4.S +163 -0
  223. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/poly_compress_d5.S +220 -0
  224. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/poly_decompress_d10.S +228 -0
  225. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/poly_decompress_d11.S +277 -0
  226. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/poly_decompress_d4.S +180 -0
  227. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/poly_decompress_d5.S +192 -0
  228. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/polyvec_basemul_acc_montgomery_cached_asm_k2.S +502 -0
  229. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/polyvec_basemul_acc_montgomery_cached_asm_k3.S +750 -0
  230. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/polyvec_basemul_acc_montgomery_cached_asm_k4.S +998 -0
  231. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/reduce.S +218 -0
  232. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/rej_uniform_asm.S +103 -0
  233. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/rej_uniform_table.c +544 -0
  234. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/tomont.S +155 -0
  235. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/params.h +76 -0
  236. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/poly.c +572 -0
  237. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/poly.h +317 -0
  238. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/poly_k.c +502 -0
  239. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/poly_k.h +668 -0
  240. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/randombytes.h +60 -0
  241. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/sampling.c +362 -0
  242. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/sampling.h +118 -0
  243. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/symmetric.h +70 -0
  244. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/sys.h +260 -0
  245. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/verify.c +20 -0
  246. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/verify.h +464 -0
  247. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/zetas.inc +30 -0
  248. data/lib/pq_crypto/version.rb +1 -1
  249. data/lib/pq_crypto.rb +1 -1
  250. data/script/vendor_libs.rb +88 -159
  251. metadata +236 -160
  252. data/ext/pqcrypto/vendor/pqclean/common/aes.c +0 -639
  253. data/ext/pqcrypto/vendor/pqclean/common/aes.h +0 -64
  254. data/ext/pqcrypto/vendor/pqclean/common/compat.h +0 -73
  255. data/ext/pqcrypto/vendor/pqclean/common/crypto_declassify.h +0 -7
  256. data/ext/pqcrypto/vendor/pqclean/common/fips202.c +0 -928
  257. data/ext/pqcrypto/vendor/pqclean/common/fips202.h +0 -166
  258. data/ext/pqcrypto/vendor/pqclean/common/keccak2x/feat.S +0 -168
  259. data/ext/pqcrypto/vendor/pqclean/common/keccak2x/fips202x2.c +0 -684
  260. data/ext/pqcrypto/vendor/pqclean/common/keccak2x/fips202x2.h +0 -60
  261. data/ext/pqcrypto/vendor/pqclean/common/keccak4x/KeccakP-1600-times4-SIMD256.c +0 -1028
  262. data/ext/pqcrypto/vendor/pqclean/common/keccak4x/KeccakP-1600-times4-SnP.h +0 -50
  263. data/ext/pqcrypto/vendor/pqclean/common/keccak4x/KeccakP-1600-unrolling.macros +0 -198
  264. data/ext/pqcrypto/vendor/pqclean/common/keccak4x/Makefile +0 -8
  265. data/ext/pqcrypto/vendor/pqclean/common/keccak4x/Makefile.Microsoft_nmake +0 -8
  266. data/ext/pqcrypto/vendor/pqclean/common/keccak4x/SIMD256-config.h +0 -3
  267. data/ext/pqcrypto/vendor/pqclean/common/keccak4x/align.h +0 -34
  268. data/ext/pqcrypto/vendor/pqclean/common/keccak4x/brg_endian.h +0 -142
  269. data/ext/pqcrypto/vendor/pqclean/common/nistseedexpander.c +0 -101
  270. data/ext/pqcrypto/vendor/pqclean/common/nistseedexpander.h +0 -39
  271. data/ext/pqcrypto/vendor/pqclean/common/randombytes.c +0 -355
  272. data/ext/pqcrypto/vendor/pqclean/common/randombytes.h +0 -27
  273. data/ext/pqcrypto/vendor/pqclean/common/sha2.c +0 -769
  274. data/ext/pqcrypto/vendor/pqclean/common/sha2.h +0 -173
  275. data/ext/pqcrypto/vendor/pqclean/common/sp800-185.c +0 -156
  276. data/ext/pqcrypto/vendor/pqclean/common/sp800-185.h +0 -27
  277. data/ext/pqcrypto/vendor/pqclean/crypto_kem/ml-kem-1024/clean/LICENSE +0 -5
  278. data/ext/pqcrypto/vendor/pqclean/crypto_kem/ml-kem-1024/clean/Makefile +0 -19
  279. data/ext/pqcrypto/vendor/pqclean/crypto_kem/ml-kem-1024/clean/Makefile.Microsoft_nmake +0 -23
  280. data/ext/pqcrypto/vendor/pqclean/crypto_kem/ml-kem-1024/clean/api.h +0 -18
  281. data/ext/pqcrypto/vendor/pqclean/crypto_kem/ml-kem-1024/clean/cbd.c +0 -83
  282. data/ext/pqcrypto/vendor/pqclean/crypto_kem/ml-kem-1024/clean/cbd.h +0 -11
  283. data/ext/pqcrypto/vendor/pqclean/crypto_kem/ml-kem-1024/clean/indcpa.c +0 -327
  284. data/ext/pqcrypto/vendor/pqclean/crypto_kem/ml-kem-1024/clean/indcpa.h +0 -22
  285. data/ext/pqcrypto/vendor/pqclean/crypto_kem/ml-kem-1024/clean/kem.c +0 -164
  286. data/ext/pqcrypto/vendor/pqclean/crypto_kem/ml-kem-1024/clean/kem.h +0 -23
  287. data/ext/pqcrypto/vendor/pqclean/crypto_kem/ml-kem-1024/clean/ntt.c +0 -146
  288. data/ext/pqcrypto/vendor/pqclean/crypto_kem/ml-kem-1024/clean/ntt.h +0 -14
  289. data/ext/pqcrypto/vendor/pqclean/crypto_kem/ml-kem-1024/clean/params.h +0 -36
  290. data/ext/pqcrypto/vendor/pqclean/crypto_kem/ml-kem-1024/clean/poly.c +0 -311
  291. data/ext/pqcrypto/vendor/pqclean/crypto_kem/ml-kem-1024/clean/poly.h +0 -37
  292. data/ext/pqcrypto/vendor/pqclean/crypto_kem/ml-kem-1024/clean/polyvec.c +0 -198
  293. data/ext/pqcrypto/vendor/pqclean/crypto_kem/ml-kem-1024/clean/polyvec.h +0 -26
  294. data/ext/pqcrypto/vendor/pqclean/crypto_kem/ml-kem-1024/clean/reduce.c +0 -41
  295. data/ext/pqcrypto/vendor/pqclean/crypto_kem/ml-kem-1024/clean/reduce.h +0 -13
  296. data/ext/pqcrypto/vendor/pqclean/crypto_kem/ml-kem-1024/clean/symmetric-shake.c +0 -71
  297. data/ext/pqcrypto/vendor/pqclean/crypto_kem/ml-kem-1024/clean/symmetric.h +0 -30
  298. data/ext/pqcrypto/vendor/pqclean/crypto_kem/ml-kem-1024/clean/verify.c +0 -67
  299. data/ext/pqcrypto/vendor/pqclean/crypto_kem/ml-kem-1024/clean/verify.h +0 -13
  300. data/ext/pqcrypto/vendor/pqclean/crypto_kem/ml-kem-512/clean/LICENSE +0 -5
  301. data/ext/pqcrypto/vendor/pqclean/crypto_kem/ml-kem-512/clean/Makefile +0 -19
  302. data/ext/pqcrypto/vendor/pqclean/crypto_kem/ml-kem-512/clean/Makefile.Microsoft_nmake +0 -23
  303. data/ext/pqcrypto/vendor/pqclean/crypto_kem/ml-kem-512/clean/api.h +0 -18
  304. data/ext/pqcrypto/vendor/pqclean/crypto_kem/ml-kem-512/clean/cbd.c +0 -108
  305. data/ext/pqcrypto/vendor/pqclean/crypto_kem/ml-kem-512/clean/cbd.h +0 -11
  306. data/ext/pqcrypto/vendor/pqclean/crypto_kem/ml-kem-512/clean/indcpa.c +0 -327
  307. data/ext/pqcrypto/vendor/pqclean/crypto_kem/ml-kem-512/clean/indcpa.h +0 -22
  308. data/ext/pqcrypto/vendor/pqclean/crypto_kem/ml-kem-512/clean/kem.c +0 -164
  309. data/ext/pqcrypto/vendor/pqclean/crypto_kem/ml-kem-512/clean/kem.h +0 -23
  310. data/ext/pqcrypto/vendor/pqclean/crypto_kem/ml-kem-512/clean/ntt.c +0 -146
  311. data/ext/pqcrypto/vendor/pqclean/crypto_kem/ml-kem-512/clean/ntt.h +0 -14
  312. data/ext/pqcrypto/vendor/pqclean/crypto_kem/ml-kem-512/clean/params.h +0 -36
  313. data/ext/pqcrypto/vendor/pqclean/crypto_kem/ml-kem-512/clean/poly.c +0 -299
  314. data/ext/pqcrypto/vendor/pqclean/crypto_kem/ml-kem-512/clean/poly.h +0 -37
  315. data/ext/pqcrypto/vendor/pqclean/crypto_kem/ml-kem-512/clean/polyvec.c +0 -188
  316. data/ext/pqcrypto/vendor/pqclean/crypto_kem/ml-kem-512/clean/polyvec.h +0 -26
  317. data/ext/pqcrypto/vendor/pqclean/crypto_kem/ml-kem-512/clean/reduce.c +0 -41
  318. data/ext/pqcrypto/vendor/pqclean/crypto_kem/ml-kem-512/clean/reduce.h +0 -13
  319. data/ext/pqcrypto/vendor/pqclean/crypto_kem/ml-kem-512/clean/symmetric-shake.c +0 -71
  320. data/ext/pqcrypto/vendor/pqclean/crypto_kem/ml-kem-512/clean/symmetric.h +0 -30
  321. data/ext/pqcrypto/vendor/pqclean/crypto_kem/ml-kem-512/clean/verify.c +0 -67
  322. data/ext/pqcrypto/vendor/pqclean/crypto_kem/ml-kem-512/clean/verify.h +0 -13
  323. data/ext/pqcrypto/vendor/pqclean/crypto_kem/ml-kem-768/clean/LICENSE +0 -5
  324. data/ext/pqcrypto/vendor/pqclean/crypto_kem/ml-kem-768/clean/Makefile +0 -19
  325. data/ext/pqcrypto/vendor/pqclean/crypto_kem/ml-kem-768/clean/Makefile.Microsoft_nmake +0 -23
  326. data/ext/pqcrypto/vendor/pqclean/crypto_kem/ml-kem-768/clean/api.h +0 -18
  327. data/ext/pqcrypto/vendor/pqclean/crypto_kem/ml-kem-768/clean/cbd.c +0 -83
  328. data/ext/pqcrypto/vendor/pqclean/crypto_kem/ml-kem-768/clean/cbd.h +0 -11
  329. data/ext/pqcrypto/vendor/pqclean/crypto_kem/ml-kem-768/clean/indcpa.c +0 -327
  330. data/ext/pqcrypto/vendor/pqclean/crypto_kem/ml-kem-768/clean/indcpa.h +0 -22
  331. data/ext/pqcrypto/vendor/pqclean/crypto_kem/ml-kem-768/clean/kem.c +0 -164
  332. data/ext/pqcrypto/vendor/pqclean/crypto_kem/ml-kem-768/clean/kem.h +0 -23
  333. data/ext/pqcrypto/vendor/pqclean/crypto_kem/ml-kem-768/clean/ntt.c +0 -146
  334. data/ext/pqcrypto/vendor/pqclean/crypto_kem/ml-kem-768/clean/ntt.h +0 -14
  335. data/ext/pqcrypto/vendor/pqclean/crypto_kem/ml-kem-768/clean/params.h +0 -36
  336. data/ext/pqcrypto/vendor/pqclean/crypto_kem/ml-kem-768/clean/poly.c +0 -299
  337. data/ext/pqcrypto/vendor/pqclean/crypto_kem/ml-kem-768/clean/poly.h +0 -37
  338. data/ext/pqcrypto/vendor/pqclean/crypto_kem/ml-kem-768/clean/polyvec.c +0 -188
  339. data/ext/pqcrypto/vendor/pqclean/crypto_kem/ml-kem-768/clean/polyvec.h +0 -26
  340. data/ext/pqcrypto/vendor/pqclean/crypto_kem/ml-kem-768/clean/reduce.c +0 -41
  341. data/ext/pqcrypto/vendor/pqclean/crypto_kem/ml-kem-768/clean/reduce.h +0 -13
  342. data/ext/pqcrypto/vendor/pqclean/crypto_kem/ml-kem-768/clean/symmetric-shake.c +0 -71
  343. data/ext/pqcrypto/vendor/pqclean/crypto_kem/ml-kem-768/clean/symmetric.h +0 -30
  344. data/ext/pqcrypto/vendor/pqclean/crypto_kem/ml-kem-768/clean/verify.c +0 -67
  345. data/ext/pqcrypto/vendor/pqclean/crypto_kem/ml-kem-768/clean/verify.h +0 -13
  346. data/ext/pqcrypto/vendor/pqclean/crypto_sign/ml-dsa-44/clean/LICENSE +0 -5
  347. data/ext/pqcrypto/vendor/pqclean/crypto_sign/ml-dsa-44/clean/Makefile +0 -19
  348. data/ext/pqcrypto/vendor/pqclean/crypto_sign/ml-dsa-44/clean/Makefile.Microsoft_nmake +0 -23
  349. data/ext/pqcrypto/vendor/pqclean/crypto_sign/ml-dsa-44/clean/api.h +0 -50
  350. data/ext/pqcrypto/vendor/pqclean/crypto_sign/ml-dsa-44/clean/ntt.c +0 -98
  351. data/ext/pqcrypto/vendor/pqclean/crypto_sign/ml-dsa-44/clean/ntt.h +0 -10
  352. data/ext/pqcrypto/vendor/pqclean/crypto_sign/ml-dsa-44/clean/packing.c +0 -261
  353. data/ext/pqcrypto/vendor/pqclean/crypto_sign/ml-dsa-44/clean/packing.h +0 -31
  354. data/ext/pqcrypto/vendor/pqclean/crypto_sign/ml-dsa-44/clean/params.h +0 -44
  355. data/ext/pqcrypto/vendor/pqclean/crypto_sign/ml-dsa-44/clean/poly.c +0 -848
  356. data/ext/pqcrypto/vendor/pqclean/crypto_sign/ml-dsa-44/clean/poly.h +0 -52
  357. data/ext/pqcrypto/vendor/pqclean/crypto_sign/ml-dsa-44/clean/polyvec.c +0 -415
  358. data/ext/pqcrypto/vendor/pqclean/crypto_sign/ml-dsa-44/clean/polyvec.h +0 -65
  359. data/ext/pqcrypto/vendor/pqclean/crypto_sign/ml-dsa-44/clean/reduce.c +0 -69
  360. data/ext/pqcrypto/vendor/pqclean/crypto_sign/ml-dsa-44/clean/reduce.h +0 -17
  361. data/ext/pqcrypto/vendor/pqclean/crypto_sign/ml-dsa-44/clean/rounding.c +0 -98
  362. data/ext/pqcrypto/vendor/pqclean/crypto_sign/ml-dsa-44/clean/rounding.h +0 -14
  363. data/ext/pqcrypto/vendor/pqclean/crypto_sign/ml-dsa-44/clean/sign.c +0 -407
  364. data/ext/pqcrypto/vendor/pqclean/crypto_sign/ml-dsa-44/clean/sign.h +0 -47
  365. data/ext/pqcrypto/vendor/pqclean/crypto_sign/ml-dsa-44/clean/symmetric-shake.c +0 -26
  366. data/ext/pqcrypto/vendor/pqclean/crypto_sign/ml-dsa-44/clean/symmetric.h +0 -34
  367. data/ext/pqcrypto/vendor/pqclean/crypto_sign/ml-dsa-65/clean/LICENSE +0 -5
  368. data/ext/pqcrypto/vendor/pqclean/crypto_sign/ml-dsa-65/clean/Makefile +0 -19
  369. data/ext/pqcrypto/vendor/pqclean/crypto_sign/ml-dsa-65/clean/Makefile.Microsoft_nmake +0 -23
  370. data/ext/pqcrypto/vendor/pqclean/crypto_sign/ml-dsa-65/clean/api.h +0 -50
  371. data/ext/pqcrypto/vendor/pqclean/crypto_sign/ml-dsa-65/clean/ntt.c +0 -98
  372. data/ext/pqcrypto/vendor/pqclean/crypto_sign/ml-dsa-65/clean/ntt.h +0 -10
  373. data/ext/pqcrypto/vendor/pqclean/crypto_sign/ml-dsa-65/clean/packing.c +0 -261
  374. data/ext/pqcrypto/vendor/pqclean/crypto_sign/ml-dsa-65/clean/packing.h +0 -31
  375. data/ext/pqcrypto/vendor/pqclean/crypto_sign/ml-dsa-65/clean/params.h +0 -44
  376. data/ext/pqcrypto/vendor/pqclean/crypto_sign/ml-dsa-65/clean/poly.c +0 -799
  377. data/ext/pqcrypto/vendor/pqclean/crypto_sign/ml-dsa-65/clean/poly.h +0 -52
  378. data/ext/pqcrypto/vendor/pqclean/crypto_sign/ml-dsa-65/clean/polyvec.c +0 -415
  379. data/ext/pqcrypto/vendor/pqclean/crypto_sign/ml-dsa-65/clean/polyvec.h +0 -65
  380. data/ext/pqcrypto/vendor/pqclean/crypto_sign/ml-dsa-65/clean/reduce.c +0 -69
  381. data/ext/pqcrypto/vendor/pqclean/crypto_sign/ml-dsa-65/clean/reduce.h +0 -17
  382. data/ext/pqcrypto/vendor/pqclean/crypto_sign/ml-dsa-65/clean/rounding.c +0 -92
  383. data/ext/pqcrypto/vendor/pqclean/crypto_sign/ml-dsa-65/clean/rounding.h +0 -14
  384. data/ext/pqcrypto/vendor/pqclean/crypto_sign/ml-dsa-65/clean/sign.c +0 -407
  385. data/ext/pqcrypto/vendor/pqclean/crypto_sign/ml-dsa-65/clean/sign.h +0 -47
  386. data/ext/pqcrypto/vendor/pqclean/crypto_sign/ml-dsa-65/clean/symmetric-shake.c +0 -26
  387. data/ext/pqcrypto/vendor/pqclean/crypto_sign/ml-dsa-65/clean/symmetric.h +0 -34
  388. data/ext/pqcrypto/vendor/pqclean/crypto_sign/ml-dsa-87/clean/LICENSE +0 -5
  389. data/ext/pqcrypto/vendor/pqclean/crypto_sign/ml-dsa-87/clean/Makefile +0 -19
  390. data/ext/pqcrypto/vendor/pqclean/crypto_sign/ml-dsa-87/clean/Makefile.Microsoft_nmake +0 -23
  391. data/ext/pqcrypto/vendor/pqclean/crypto_sign/ml-dsa-87/clean/api.h +0 -50
  392. data/ext/pqcrypto/vendor/pqclean/crypto_sign/ml-dsa-87/clean/ntt.c +0 -98
  393. data/ext/pqcrypto/vendor/pqclean/crypto_sign/ml-dsa-87/clean/ntt.h +0 -10
  394. data/ext/pqcrypto/vendor/pqclean/crypto_sign/ml-dsa-87/clean/packing.c +0 -261
  395. data/ext/pqcrypto/vendor/pqclean/crypto_sign/ml-dsa-87/clean/packing.h +0 -31
  396. data/ext/pqcrypto/vendor/pqclean/crypto_sign/ml-dsa-87/clean/params.h +0 -44
  397. data/ext/pqcrypto/vendor/pqclean/crypto_sign/ml-dsa-87/clean/poly.c +0 -823
  398. data/ext/pqcrypto/vendor/pqclean/crypto_sign/ml-dsa-87/clean/poly.h +0 -52
  399. data/ext/pqcrypto/vendor/pqclean/crypto_sign/ml-dsa-87/clean/polyvec.c +0 -415
  400. data/ext/pqcrypto/vendor/pqclean/crypto_sign/ml-dsa-87/clean/polyvec.h +0 -65
  401. data/ext/pqcrypto/vendor/pqclean/crypto_sign/ml-dsa-87/clean/reduce.c +0 -69
  402. data/ext/pqcrypto/vendor/pqclean/crypto_sign/ml-dsa-87/clean/reduce.h +0 -17
  403. data/ext/pqcrypto/vendor/pqclean/crypto_sign/ml-dsa-87/clean/rounding.c +0 -92
  404. data/ext/pqcrypto/vendor/pqclean/crypto_sign/ml-dsa-87/clean/rounding.h +0 -14
  405. data/ext/pqcrypto/vendor/pqclean/crypto_sign/ml-dsa-87/clean/sign.c +0 -407
  406. data/ext/pqcrypto/vendor/pqclean/crypto_sign/ml-dsa-87/clean/sign.h +0 -47
  407. data/ext/pqcrypto/vendor/pqclean/crypto_sign/ml-dsa-87/clean/symmetric-shake.c +0 -26
  408. data/ext/pqcrypto/vendor/pqclean/crypto_sign/ml-dsa-87/clean/symmetric.h +0 -34
@@ -0,0 +1,723 @@
1
+ /*
2
+ * Copyright (c) The mldsa-native project authors
3
+ * SPDX-License-Identifier: Apache-2.0 OR ISC OR MIT
4
+ */
5
+
6
+ /* References
7
+ * ==========
8
+ *
9
+ * - [FIPS140_3_IG]
10
+ * Implementation Guidance for FIPS 140-3 and the Cryptographic Module
11
+ * Validation Program
12
+ * National Institute of Standards and Technology
13
+ * https://csrc.nist.gov/projects/cryptographic-module-validation-program/fips-140-3-ig-announcements
14
+ *
15
+ * - [FIPS204]
16
+ * FIPS 204 Module-Lattice-Based Digital Signature Standard
17
+ * National Institute of Standards and Technology
18
+ * https://csrc.nist.gov/pubs/fips/204/final
19
+ */
20
+
21
+ #ifndef MLD_CONFIG_H
22
+ #define MLD_CONFIG_H
23
+
24
+ /******************************************************************************
25
+ * Name: MLD_CONFIG_PARAMETER_SET
26
+ *
27
+ * Description: Specifies the parameter set for ML-DSA
28
+ * - MLD_CONFIG_PARAMETER_SET=44 corresponds to ML-DSA-44
29
+ * - MLD_CONFIG_PARAMETER_SET=65 corresponds to ML-DSA-65
30
+ * - MLD_CONFIG_PARAMETER_SET=87 corresponds to ML-DSA-87
31
+ *
32
+ * If you want to support multiple parameter sets, build the
33
+ * library multiple times and set MLD_CONFIG_MULTILEVEL_BUILD.
34
+ * See MLD_CONFIG_MULTILEVEL_BUILD for how to do this while
35
+ * minimizing code duplication.
36
+ *
37
+ * This can also be set using CFLAGS.
38
+ *
39
+ *****************************************************************************/
40
+ #ifndef MLD_CONFIG_PARAMETER_SET
41
+ #define MLD_CONFIG_PARAMETER_SET \
42
+ 44 /* Change this for different security strengths */
43
+ #endif
44
+
45
+ /******************************************************************************
46
+ * Name: MLD_CONFIG_FILE
47
+ *
48
+ * Description: If defined, this is a header that will be included instead
49
+ * of the default configuration file mldsa/mldsa_native_config.h.
50
+ *
51
+ * When you need to build mldsa-native in multiple configurations,
52
+ * using varying MLD_CONFIG_FILE can be more convenient
53
+ * then configuring everything through CFLAGS.
54
+ *
55
+ * To use, MLD_CONFIG_FILE _must_ be defined prior
56
+ * to the inclusion of any mldsa-native headers. For example,
57
+ * it can be set by passing `-DMLD_CONFIG_FILE="..."`
58
+ * on the command line.
59
+ *
60
+ *****************************************************************************/
61
+ /* #define MLD_CONFIG_FILE "mldsa_native_config.h" */
62
+
63
+ /******************************************************************************
64
+ * Name: MLD_CONFIG_NAMESPACE_PREFIX
65
+ *
66
+ * Description: The prefix to use to namespace global symbols from mldsa/.
67
+ *
68
+ * In a multi-level build, level-dependent symbols will
69
+ * additionally be prefixed with the parameter set (44/65/87).
70
+ *
71
+ * This can also be set using CFLAGS.
72
+ *
73
+ *****************************************************************************/
74
+ #if !defined(MLD_CONFIG_NAMESPACE_PREFIX)
75
+ #define MLD_CONFIG_NAMESPACE_PREFIX MLD_DEFAULT_NAMESPACE_PREFIX
76
+ #endif
77
+
78
+ /******************************************************************************
79
+ * Name: MLD_CONFIG_MULTILEVEL_BUILD
80
+ *
81
+ * Description: Set this if the build is part of a multi-level build supporting
82
+ * multiple parameter sets.
83
+ *
84
+ * If you need only a single parameter set, keep this unset.
85
+ *
86
+ * To build mldsa-native with support for all parameter sets,
87
+ * build it three times -- once per parameter set -- and set the
88
+ * option MLD_CONFIG_MULTILEVEL_WITH_SHARED for exactly one of
89
+ * them, and MLD_CONFIG_MULTILEVEL_NO_SHARED for the others.
90
+ * MLD_CONFIG_MULTILEVEL_BUILD should be set for all of them.
91
+ *
92
+ * See examples/multilevel_build for an example.
93
+ *
94
+ * This can also be set using CFLAGS.
95
+ *
96
+ *****************************************************************************/
97
+ /* #define MLD_CONFIG_MULTILEVEL_BUILD */
98
+
99
+ /******************************************************************************
100
+ * Name: MLD_CONFIG_EXTERNAL_API_QUALIFIER
101
+ *
102
+ * Description: If set, this option provides an additional function
103
+ * qualifier to be added to declarations of mldsa-native's
104
+ * public API.
105
+ *
106
+ * The primary use case for this option are single-CU builds
107
+ * where the public API exposed by mldsa-native is wrapped by
108
+ * another API in the consuming application. In this case,
109
+ * even mldsa-native's public API can be marked `static`.
110
+ *
111
+ *****************************************************************************/
112
+ /* #define MLD_CONFIG_EXTERNAL_API_QUALIFIER */
113
+
114
+ /******************************************************************************
115
+ * Name: MLD_CONFIG_NO_RANDOMIZED_API
116
+ *
117
+ * Description: If this option is set, mldsa-native will be built without the
118
+ * randomized API functions (crypto_sign_keypair,
119
+ * crypto_sign, crypto_sign_signature, and
120
+ * crypto_sign_signature_extmu).
121
+ * This allows users to build mldsa-native without providing a
122
+ * randombytes() implementation if they only need the
123
+ * internal deterministic API
124
+ * (crypto_sign_keypair_internal, crypto_sign_signature_internal).
125
+ *
126
+ * NOTE: This option is incompatible with MLD_CONFIG_KEYGEN_PCT
127
+ * as the current PCT implementation requires
128
+ * crypto_sign_signature().
129
+ *
130
+ *****************************************************************************/
131
+ /* #define MLD_CONFIG_NO_RANDOMIZED_API */
132
+
133
+ /******************************************************************************
134
+ * Name: MLD_CONFIG_NO_SUPERCOP
135
+ *
136
+ * Description: By default, mldsa_native.h exposes the mldsa-native API in the
137
+ * SUPERCOP naming convention (crypto_sign_xxx). If you don't need
138
+ * this, set MLD_CONFIG_NO_SUPERCOP.
139
+ *
140
+ * NOTE: You must set this for a multi-level build as the SUPERCOP
141
+ * naming does not disambiguate between the parameter sets.
142
+ *
143
+ *****************************************************************************/
144
+ /* #define MLD_CONFIG_NO_SUPERCOP */
145
+
146
+ /******************************************************************************
147
+ * Name: MLD_CONFIG_CONSTANTS_ONLY
148
+ *
149
+ * Description: If you only need the size constants (MLDSA_PUBLICKEYBYTES, etc.)
150
+ * but no function declarations, set MLD_CONFIG_CONSTANTS_ONLY.
151
+ *
152
+ * This only affects the public header mldsa_native.h, not
153
+ * the implementation.
154
+ *
155
+ *****************************************************************************/
156
+ /* #define MLD_CONFIG_CONSTANTS_ONLY */
157
+
158
+ /******************************************************************************
159
+ *
160
+ * Build-only configuration options
161
+ *
162
+ * The remaining configurations are build-options only.
163
+ * They do not affect the API described in mldsa_native.h.
164
+ *
165
+ *****************************************************************************/
166
+
167
+ #if defined(MLD_BUILD_INTERNAL)
168
+ /******************************************************************************
169
+ * Name: MLD_CONFIG_MULTILEVEL_WITH_SHARED
170
+ *
171
+ * Description: This is for multi-level builds of mldsa-native only. If you
172
+ * need only a single parameter set, keep this unset.
173
+ *
174
+ * If this is set, all MLD_CONFIG_PARAMETER_SET-independent
175
+ * code will be included in the build, including code needed only
176
+ * for other parameter sets.
177
+ *
178
+ * Example: TODO: add example
179
+ *
180
+ * To build mldsa-native with support for all parameter sets,
181
+ * build it three times -- once per parameter set -- and set the
182
+ * option MLD_CONFIG_MULTILEVEL_WITH_SHARED for exactly one of
183
+ * them, and MLD_CONFIG_MULTILEVEL_NO_SHARED for the others.
184
+ *
185
+ * See examples/multilevel_build_mldsa for an example.
186
+ *
187
+ * This can also be set using CFLAGS.
188
+ *
189
+ *****************************************************************************/
190
+ /* #define MLD_CONFIG_MULTILEVEL_WITH_SHARED */
191
+
192
+ /******************************************************************************
193
+ * Name: MLD_CONFIG_MULTILEVEL_NO_SHARED
194
+ *
195
+ * Description: This is for multi-level builds of mldsa-native only. If you
196
+ * need only a single parameter set, keep this unset.
197
+ *
198
+ * If this is set, no MLD_CONFIG_PARAMETER_SET-independent code
199
+ * will be included in the build.
200
+ *
201
+ * To build mldsa-native with support for all parameter sets,
202
+ * build it three times -- once per parameter set -- and set the
203
+ * option MLD_CONFIG_MULTILEVEL_WITH_SHARED for exactly one of
204
+ * them, and MLD_CONFIG_MULTILEVEL_NO_SHARED for the others.
205
+ *
206
+ * See examples/multilevel_build_mldsa for an example.
207
+ *
208
+ * This can also be set using CFLAGS.
209
+ *
210
+ *****************************************************************************/
211
+ /* #define MLD_CONFIG_MULTILEVEL_NO_SHARED */
212
+
213
+ /******************************************************************************
214
+ * Name: MLD_CONFIG_MONOBUILD_KEEP_SHARED_HEADERS
215
+ *
216
+ * Description: This is only relevant for single compilation unit (SCU)
217
+ * builds of mldsa-native. In this case, it determines whether
218
+ * directives defined in parameter-set-independent headers should
219
+ * be #undef'ined or not at the of the SCU file. This is needed
220
+ * in multilevel builds.
221
+ *
222
+ * See examples/multilevel_build_native for an example.
223
+ *
224
+ * This can also be set using CFLAGS.
225
+ *
226
+ *****************************************************************************/
227
+ /* #define MLD_CONFIG_MONOBUILD_KEEP_SHARED_HEADERS */
228
+
229
+ /******************************************************************************
230
+ * Name: MLD_CONFIG_USE_NATIVE_BACKEND_ARITH
231
+ *
232
+ * Description: Determines whether an native arithmetic backend should be used.
233
+ *
234
+ * The arithmetic backend covers performance critical functions
235
+ * such as the number-theoretic transform (NTT).
236
+ *
237
+ * If this option is unset, the C backend will be used.
238
+ *
239
+ * If this option is set, the arithmetic backend to be use is
240
+ * determined by MLD_CONFIG_ARITH_BACKEND_FILE: If the latter is
241
+ * unset, the default backend for your the target architecture
242
+ * will be used. If set, it must be the name of a backend metadata
243
+ * file.
244
+ *
245
+ * This can also be set using CFLAGS.
246
+ *
247
+ *****************************************************************************/
248
+ #if !defined(MLD_CONFIG_USE_NATIVE_BACKEND_ARITH)
249
+ /* #define MLD_CONFIG_USE_NATIVE_BACKEND_ARITH */
250
+ #endif
251
+
252
+ /******************************************************************************
253
+ * Name: MLD_CONFIG_ARITH_BACKEND_FILE
254
+ *
255
+ * Description: The arithmetic backend to use.
256
+ *
257
+ * If MLD_CONFIG_USE_NATIVE_BACKEND_ARITH is unset, this option
258
+ * is ignored.
259
+ *
260
+ * If MLD_CONFIG_USE_NATIVE_BACKEND_ARITH is set, this option must
261
+ * either be undefined or the filename of an arithmetic backend.
262
+ * If unset, the default backend will be used.
263
+ *
264
+ * This can be set using CFLAGS.
265
+ *
266
+ *****************************************************************************/
267
+ #if defined(MLD_CONFIG_USE_NATIVE_BACKEND_ARITH) && \
268
+ !defined(MLD_CONFIG_ARITH_BACKEND_FILE)
269
+ #define MLD_CONFIG_ARITH_BACKEND_FILE "native/meta.h"
270
+ #endif
271
+
272
+ /******************************************************************************
273
+ * Name: MLD_CONFIG_USE_NATIVE_BACKEND_FIPS202
274
+ *
275
+ * Description: Determines whether an native FIPS202 backend should be used.
276
+ *
277
+ * The FIPS202 backend covers 1x/2x/4x-fold Keccak-f1600, which is
278
+ * the performance bottleneck of SHA3 and SHAKE.
279
+ *
280
+ * If this option is unset, the C backend will be used.
281
+ *
282
+ * If this option is set, the FIPS202 backend to be use is
283
+ * determined by MLD_CONFIG_FIPS202_BACKEND_FILE: If the latter is
284
+ * unset, the default backend for your the target architecture
285
+ * will be used. If set, it must be the name of a backend metadata
286
+ * file.
287
+ *
288
+ * This can also be set using CFLAGS.
289
+ *
290
+ *****************************************************************************/
291
+ #if !defined(MLD_CONFIG_USE_NATIVE_BACKEND_FIPS202)
292
+ /* #define MLD_CONFIG_USE_NATIVE_BACKEND_FIPS202 */
293
+ #endif
294
+
295
+ /******************************************************************************
296
+ * Name: MLD_CONFIG_FIPS202_BACKEND_FILE
297
+ *
298
+ * Description: The FIPS-202 backend to use.
299
+ *
300
+ * If MLD_CONFIG_USE_NATIVE_BACKEND_FIPS202 is set, this option
301
+ * must either be undefined or the filename of a FIPS202 backend.
302
+ * If unset, the default backend will be used.
303
+ *
304
+ * This can be set using CFLAGS.
305
+ *
306
+ *****************************************************************************/
307
+ #if defined(MLD_CONFIG_USE_NATIVE_BACKEND_FIPS202) && \
308
+ !defined(MLD_CONFIG_FIPS202_BACKEND_FILE)
309
+ #define MLD_CONFIG_FIPS202_BACKEND_FILE "fips202/native/auto.h"
310
+ #endif
311
+
312
+ /******************************************************************************
313
+ * Name: MLD_CONFIG_FIPS202_CUSTOM_HEADER
314
+ *
315
+ * Description: Custom header to use for FIPS-202
316
+ *
317
+ * This should only be set if you intend to use a custom
318
+ * FIPS-202 implementation, different from the one shipped
319
+ * with mldsa-native.
320
+ *
321
+ * If set, it must be the name of a file serving as the
322
+ * replacement for mldsa/src/fips202/fips202.h, and exposing
323
+ * the same API (see FIPS202.md).
324
+ *
325
+ *****************************************************************************/
326
+ /* #define MLD_CONFIG_FIPS202_CUSTOM_HEADER "SOME_FILE.h" */
327
+
328
+ /******************************************************************************
329
+ * Name: MLD_CONFIG_FIPS202X4_CUSTOM_HEADER
330
+ *
331
+ * Description: Custom header to use for FIPS-202-X4
332
+ *
333
+ * This should only be set if you intend to use a custom
334
+ * FIPS-202 implementation, different from the one shipped
335
+ * with mldsa-native.
336
+ *
337
+ * If set, it must be the name of a file serving as the
338
+ * replacement for mldsa/src/fips202/fips202x4.h, and exposing
339
+ * the same API (see FIPS202.md).
340
+ *
341
+ *****************************************************************************/
342
+ /* #define MLD_CONFIG_FIPS202X4_CUSTOM_HEADER "SOME_FILE.h" */
343
+
344
+ /******************************************************************************
345
+ * Name: MLD_CONFIG_CUSTOM_ZEROIZE
346
+ *
347
+ * Description: In compliance with @[FIPS204, Section 3.6.3], mldsa-native,
348
+ * zeroizes intermediate stack buffers before returning from
349
+ * function calls.
350
+ *
351
+ * Set this option and define `mld_zeroize` if you want to
352
+ * use a custom method to zeroize intermediate stack buffers.
353
+ * The default implementation uses SecureZeroMemory on Windows
354
+ * and a memset + compiler barrier otherwise. If neither of those
355
+ * is available on the target platform, compilation will fail,
356
+ * and you will need to use MLD_CONFIG_CUSTOM_ZEROIZE to provide
357
+ * a custom implementation of `mld_zeroize()`.
358
+ *
359
+ * WARNING:
360
+ * The explicit stack zeroization conducted by mldsa-native
361
+ * reduces the likelihood of data leaking on the stack, but
362
+ * does not eliminate it! The C standard makes no guarantee about
363
+ * where a compiler allocates structures and whether/where it makes
364
+ * copies of them. Also, in addition to entire structures, there
365
+ * may also be potentially exploitable leakage of individual values
366
+ * on the stack.
367
+ *
368
+ * If you need bullet-proof zeroization of the stack, you need to
369
+ * consider additional measures instead of what this feature
370
+ * provides. In this case, you can set mld_zeroize to a
371
+ * no-op.
372
+ *
373
+ *****************************************************************************/
374
+ /* #define MLD_CONFIG_CUSTOM_ZEROIZE
375
+ #if !defined(__ASSEMBLER__)
376
+ #include <stdint.h>
377
+ #include "src/src.h"
378
+ static MLD_INLINE void mld_zeroize(void *ptr, size_t len)
379
+ {
380
+ ... your implementation ...
381
+ }
382
+ #endif
383
+ */
384
+
385
+ /******************************************************************************
386
+ * Name: MLD_CONFIG_CUSTOM_RANDOMBYTES
387
+ *
388
+ * Description: mldsa-native does not provide a secure randombytes
389
+ * implementation. Such an implementation has to provided by the
390
+ * consumer.
391
+ *
392
+ * If this option is not set, mldsa-native expects a function
393
+ * int randombytes(uint8_t *out, size_t outlen).
394
+ *
395
+ * Set this option and define `mld_randombytes` if you want to
396
+ * use a custom method to sample randombytes with a different name
397
+ * or signature.
398
+ *
399
+ *****************************************************************************/
400
+ /* #define MLD_CONFIG_CUSTOM_RANDOMBYTES
401
+ #if !defined(__ASSEMBLER__)
402
+ #include <stdint.h>
403
+ #include "src/src.h"
404
+ static MLD_INLINE int mld_randombytes(uint8_t *ptr, size_t len)
405
+ {
406
+ ... your implementation ...
407
+ return 0;
408
+ }
409
+ #endif
410
+ */
411
+
412
+ /******************************************************************************
413
+ * Name: MLD_CONFIG_CUSTOM_CAPABILITY_FUNC
414
+ *
415
+ * Description: mldsa-native backends may rely on specific hardware features.
416
+ * Those backends will only be included in an mldsa-native build
417
+ * if support for the respective features is enabled at
418
+ * compile-time. However, when building for a heteroneous set
419
+ * of CPUs to run the resulting binary/library on, feature
420
+ * detection at _runtime_ is needed to decided whether a backend
421
+ * can be used or not.
422
+ *
423
+ * Set this option and define `mld_sys_check_capability` if you
424
+ * want to use a custom method to dispatch between implementations.
425
+ *
426
+ * Return value 1 indicates that a capability is supported.
427
+ * Return value 0 indicates that a capability is not supported.
428
+ *
429
+ * If this option is not set, mldsa-native uses compile-time
430
+ * feature detection only to decide which backend to use.
431
+ *
432
+ * If you compile mldsa-native on a system with different
433
+ * capabilities than the system that the resulting binary/library
434
+ * will be run on, you must use this option.
435
+ *
436
+ *****************************************************************************/
437
+ /* #define MLD_CONFIG_CUSTOM_CAPABILITY_FUNC
438
+ static MLD_INLINE int mld_sys_check_capability(mld_sys_cap cap)
439
+ {
440
+ ... your implementation ...
441
+ }
442
+ */
443
+
444
+ /******************************************************************************
445
+ * Name: MLD_CONFIG_CUSTOM_ALLOC_FREE [EXPERIMENTAL]
446
+ *
447
+ * Description: Set this option and define `MLD_CUSTOM_ALLOC` and
448
+ * `MLD_CUSTOM_FREE` if you want to use custom allocation for
449
+ * large local structures or buffers.
450
+ *
451
+ * By default, all buffers/structures are allocated on the stack.
452
+ * If this option is set, most of them will be allocated via
453
+ * MLD_CUSTOM_ALLOC.
454
+ *
455
+ * Parameters to MLD_CUSTOM_ALLOC:
456
+ * - T* v: Target pointer to declare.
457
+ * - T: Type of structure to be allocated
458
+ * - N: Number of elements to be allocated.
459
+ *
460
+ * Parameters to MLD_CUSTOM_FREE:
461
+ * - T* v: Target pointer to free. May be NULL.
462
+ * - T: Type of structure to be freed.
463
+ * - N: Number of elements to be freed.
464
+ *
465
+ * WARNING: This option is experimental!
466
+ * Its scope, configuration and function/macro signatures may
467
+ * change at any time. We expect a stable API for v2.
468
+ *
469
+ * NOTE: Even if this option is set, some allocations further down
470
+ * the call stack will still be made from the stack. Those will
471
+ * likely be added to the scope of this option in the future.
472
+ *
473
+ * NOTE: MLD_CUSTOM_ALLOC need not guarantee a successful
474
+ * allocation nor include error handling. Upon failure, the
475
+ * target pointer should simply be set to NULL. The calling
476
+ * code will handle this case and invoke MLD_CUSTOM_FREE.
477
+ *
478
+ *****************************************************************************/
479
+ /* #define MLD_CONFIG_CUSTOM_ALLOC_FREE
480
+ #if !defined(__ASSEMBLER__)
481
+ #include <stdlib.h>
482
+ #define MLD_CUSTOM_ALLOC(v, T, N) \
483
+ T* (v) = (T *)aligned_alloc(MLD_DEFAULT_ALIGN, \
484
+ MLD_ALIGN_UP(sizeof(T) * (N)))
485
+ #define MLD_CUSTOM_FREE(v, T, N) free(v)
486
+ #endif
487
+ */
488
+
489
+ /******************************************************************************
490
+ * Name: MLD_CONFIG_CUSTOM_MEMCPY
491
+ *
492
+ * Description: Set this option and define `mld_memcpy` if you want to
493
+ * use a custom method to copy memory instead of the standard
494
+ * library memcpy function.
495
+ *
496
+ * The custom implementation must have the same signature and
497
+ * behavior as the standard memcpy function:
498
+ * void *mld_memcpy(void *dest, const void *src, size_t n)
499
+ *
500
+ *****************************************************************************/
501
+ /* #define MLD_CONFIG_CUSTOM_MEMCPY
502
+ #if !defined(__ASSEMBLER__)
503
+ #include <stdint.h>
504
+ #include "src/src.h"
505
+ static MLD_INLINE void *mld_memcpy(void *dest, const void *src, size_t n)
506
+ {
507
+ ... your implementation ...
508
+ }
509
+ #endif
510
+ */
511
+
512
+ /******************************************************************************
513
+ * Name: MLD_CONFIG_CUSTOM_MEMSET
514
+ *
515
+ * Description: Set this option and define `mld_memset` if you want to
516
+ * use a custom method to set memory instead of the standard
517
+ * library memset function.
518
+ *
519
+ * The custom implementation must have the same signature and
520
+ * behavior as the standard memset function:
521
+ * void *mld_memset(void *s, int c, size_t n)
522
+ *
523
+ *****************************************************************************/
524
+ /* #define MLD_CONFIG_CUSTOM_MEMSET
525
+ #if !defined(__ASSEMBLER__)
526
+ #include <stdint.h>
527
+ #include "src/src.h"
528
+ static MLD_INLINE void *mld_memset(void *s, int c, size_t n)
529
+ {
530
+ ... your implementation ...
531
+ }
532
+ #endif
533
+ */
534
+
535
+ /******************************************************************************
536
+ * Name: MLD_CONFIG_INTERNAL_API_QUALIFIER
537
+ *
538
+ * Description: If set, this option provides an additional function
539
+ * qualifier to be added to declarations of internal API.
540
+ *
541
+ * The primary use case for this option are single-CU builds,
542
+ * in which case this option can be set to `static`.
543
+ *
544
+ *****************************************************************************/
545
+ /* #define MLD_CONFIG_INTERNAL_API_QUALIFIER */
546
+
547
+ /******************************************************************************
548
+ * Name: MLD_CONFIG_CT_TESTING_ENABLED
549
+ *
550
+ * Description: If set, mldsa-native annotates data as secret / public using
551
+ * valgrind's annotations VALGRIND_MAKE_MEM_UNDEFINED and
552
+ * VALGRIND_MAKE_MEM_DEFINED, enabling various checks for secret-
553
+ * dependent control flow of variable time execution (depending
554
+ * on the exact version of valgrind installed).
555
+ *
556
+ *****************************************************************************/
557
+ /* #define MLD_CONFIG_CT_TESTING_ENABLED */
558
+
559
+ /******************************************************************************
560
+ * Name: MLD_CONFIG_NO_ASM
561
+ *
562
+ * Description: If this option is set, mldsa-native will be built without
563
+ * use of native code or inline assembly.
564
+ *
565
+ * By default, inline assembly is used to implement value barriers.
566
+ * Without inline assembly, mldsa-native will use a global volatile
567
+ * 'opt blocker' instead; see ct.h.
568
+ *
569
+ * Inline assembly is also used to implement a secure zeroization
570
+ * function on non-Windows platforms. If this option is set and
571
+ * the target platform is not Windows, you MUST set
572
+ * MLD_CONFIG_CUSTOM_ZEROIZE and provide a custom zeroization
573
+ * function.
574
+ *
575
+ * If this option is set, MLD_CONFIG_USE_NATIVE_BACKEND_FIPS202 and
576
+ * and MLD_CONFIG_USE_NATIVE_BACKEND_ARITH will be ignored, and no
577
+ * native backends will be used.
578
+ *
579
+ *****************************************************************************/
580
+ /* #define MLD_CONFIG_NO_ASM */
581
+
582
+ /******************************************************************************
583
+ * Name: MLD_CONFIG_NO_ASM_VALUE_BARRIER
584
+ *
585
+ * Description: If this option is set, mldsa-native will be built without
586
+ * use of native code or inline assembly for value barriers.
587
+ *
588
+ * By default, inline assembly (if available) is used to implement
589
+ * value barriers.
590
+ * Without inline assembly, mldsa-native will use a global volatile
591
+ * 'opt blocker' instead; see ct.h.
592
+ *
593
+ *****************************************************************************/
594
+ /* #define MLD_CONFIG_NO_ASM_VALUE_BARRIER */
595
+
596
+ /******************************************************************************
597
+ * Name: MLD_CONFIG_KEYGEN_PCT
598
+ *
599
+ * Description: Compliance with @[FIPS140_3_IG, p.87] requires a
600
+ * Pairwise Consistency Test (PCT) to be carried out on a freshly
601
+ * generated keypair before it can be exported.
602
+ *
603
+ * Set this option if such a check should be implemented.
604
+ * In this case, crypto_sign_keypair_internal and
605
+ * crypto_sign_keypair will return a non-zero error code if the
606
+ * PCT failed.
607
+ *
608
+ * NOTE: This feature will drastically lower the performance of
609
+ * key generation.
610
+ *
611
+ *****************************************************************************/
612
+ /* #define MLD_CONFIG_KEYGEN_PCT */
613
+
614
+ /******************************************************************************
615
+ * Name: MLD_CONFIG_KEYGEN_PCT_BREAKAGE_TEST
616
+ *
617
+ * Description: If this option is set, the user must provide a runtime
618
+ * function `static inline int mld_break_pct() { ... }` to
619
+ * indicate whether the PCT should be made fail.
620
+ *
621
+ * This option only has an effect if MLD_CONFIG_KEYGEN_PCT is set.
622
+ *
623
+ *****************************************************************************/
624
+ /* #define MLD_CONFIG_KEYGEN_PCT_BREAKAGE_TEST
625
+ #if !defined(__ASSEMBLER__)
626
+ #include "src/src.h"
627
+ static MLD_INLINE int mld_break_pct(void)
628
+ {
629
+ ... return 0/1 depending on whether PCT should be broken ...
630
+ }
631
+ #endif
632
+ */
633
+
634
+ /******************************************************************************
635
+ * Name: MLD_CONFIG_SERIAL_FIPS202_ONLY
636
+ *
637
+ * Description: Set this to use a FIPS202 implementation with global state
638
+ * that supports only one active Keccak computation at a time
639
+ * (e.g. some hardware accelerators).
640
+ *
641
+ * If this option is set, ML-DSA will use FIPS202 operations
642
+ * serially, ensuring that only one SHAKE context is active
643
+ * at any given time.
644
+ *
645
+ * This allows offloading Keccak computations to a hardware
646
+ * accelerator that holds only a single Keccak state locally,
647
+ * rather than requiring support for multiple concurrent
648
+ * Keccak states.
649
+ *
650
+ * NOTE: Depending on the target CPU, this may reduce
651
+ * performance when using software FIPS202 implementations.
652
+ * Only enable this when you have to.
653
+ *
654
+ *****************************************************************************/
655
+ /* #define MLD_CONFIG_SERIAL_FIPS202_ONLY */
656
+
657
+ /******************************************************************************
658
+ * Name: MLD_CONFIG_CONTEXT_PARAMETER
659
+ *
660
+ * Description: Set this to add a context parameter that is provided to public
661
+ * API functions and is then available in custom callbacks.
662
+ *
663
+ * The type of the context parameter is configured via
664
+ * MLD_CONFIG_CONTEXT_PARAMETER_TYPE.
665
+ *
666
+ *****************************************************************************/
667
+ /* #define MLD_CONFIG_CONTEXT_PARAMETER */
668
+
669
+ /******************************************************************************
670
+ * Name: MLD_CONFIG_CONTEXT_PARAMETER_TYPE
671
+ *
672
+ * Description: Set this to define the type for the context parameter used by
673
+ * MLD_CONFIG_CONTEXT_PARAMETER.
674
+ *
675
+ * This is only relevant if MLD_CONFIG_CONTEXT_PARAMETER is set.
676
+ *
677
+ *****************************************************************************/
678
+ /* #define MLD_CONFIG_CONTEXT_PARAMETER_TYPE void* */
679
+
680
+ /******************************************************************************
681
+ * Name: MLD_CONFIG_REDUCE_RAM [EXPERIMENTAL]
682
+ *
683
+ * Description: Set this to reduce RAM usage.
684
+ * This trades memory for performance.
685
+ *
686
+ * For expected memory usage, see the MLD_TOTAL_ALLOC_* constants
687
+ * defined in mldsa_native.h.
688
+ *
689
+ * This option is useful for embedded systems with tight RAM
690
+ * constraints but relaxed performance requirements.
691
+ *
692
+ * WARNING: This option is experimental!
693
+ * CBMC proofs do not currently cover this configuration option.
694
+ * Its scope and configuration may change at any time.
695
+ *
696
+ *****************************************************************************/
697
+ /* #define MLD_CONFIG_REDUCE_RAM */
698
+
699
+ /************************* Config internals ********************************/
700
+
701
+ #endif /* MLD_BUILD_INTERNAL */
702
+
703
+ /* Default namespace
704
+ *
705
+ * Don't change this. If you need a different namespace, re-define
706
+ * MLD_CONFIG_NAMESPACE_PREFIX above instead, and remove the following.
707
+ *
708
+ * The default MLDSA namespace is
709
+ *
710
+ * PQCP_MLDSA_NATIVE_MLDSA<LEVEL>_
711
+ *
712
+ * e.g., PQCP_MLDSA_NATIVE_MLDSA44_
713
+ */
714
+
715
+ #if MLD_CONFIG_PARAMETER_SET == 44
716
+ #define MLD_DEFAULT_NAMESPACE_PREFIX PQCP_MLDSA_NATIVE_MLDSA44
717
+ #elif MLD_CONFIG_PARAMETER_SET == 65
718
+ #define MLD_DEFAULT_NAMESPACE_PREFIX PQCP_MLDSA_NATIVE_MLDSA65
719
+ #elif MLD_CONFIG_PARAMETER_SET == 87
720
+ #define MLD_DEFAULT_NAMESPACE_PREFIX PQCP_MLDSA_NATIVE_MLDSA87
721
+ #endif
722
+
723
+ #endif /* !MLD_CONFIG_H */