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
@@ -85,6 +85,9 @@
85
85
  #include "src/native/x86_64/src/consts.c"
86
86
  #include "src/native/x86_64/src/rej_uniform_table.c"
87
87
  #endif
88
+ #if defined(MLD_SYS_RISCV32)
89
+ #include "src/native/rv32im/src/rv32im_zetas.c"
90
+ #endif
88
91
  #endif /* MLD_CONFIG_USE_NATIVE_BACKEND_ARITH */
89
92
 
90
93
  #if defined(MLD_CONFIG_USE_NATIVE_BACKEND_FIPS202)
@@ -211,6 +214,8 @@
211
214
  #undef MLD_COMMON_H
212
215
  #undef MLD_CONCAT
213
216
  #undef MLD_CONCAT_
217
+ #undef MLD_CT_TESTING_DECLASSIFY
218
+ #undef MLD_CT_TESTING_SECRET
214
219
  #undef MLD_EMPTY_CU
215
220
  #undef MLD_ERR_FAIL
216
221
  #undef MLD_ERR_INVALID_ARG
@@ -225,6 +230,7 @@
225
230
  #undef MLD_FIPS202X4_HEADER_FILE
226
231
  #undef MLD_FIPS202_HEADER_FILE
227
232
  #undef MLD_FREE
233
+ #undef MLD_HAVE_INLINE_ASM
228
234
  #undef MLD_INTERNAL_API
229
235
  #undef MLD_INTERNAL_DATA_DECLARATION
230
236
  #undef MLD_INTERNAL_DATA_DEFINITION
@@ -240,8 +246,7 @@
240
246
  #undef mld_pack_sig_c
241
247
  #undef mld_pack_sig_h
242
248
  #undef mld_pack_sig_z
243
- #undef mld_pack_sk_rho_key_tr_s2
244
- #undef mld_pack_sk_s1
249
+ #undef mld_pack_sk_rho_key_tr
245
250
  #undef mld_sig_unpack_hints
246
251
  #undef mld_unpack_pk_t1
247
252
  #undef mld_unpack_sk
@@ -267,13 +272,19 @@
267
272
  #undef MLDSA_PK_RHO_OFFSET
268
273
  #undef MLDSA_PK_T1_BYTES
269
274
  #undef MLDSA_PK_T1_OFFSET
275
+ #undef MLDSA_POLYETA_PACKEDBITS
270
276
  #undef MLDSA_POLYETA_PACKEDBYTES
271
277
  #undef MLDSA_POLYT0_PACKEDBYTES
278
+ #undef MLDSA_POLYT1_PACKEDBITS
272
279
  #undef MLDSA_POLYT1_PACKEDBYTES
273
280
  #undef MLDSA_POLYVECH_PACKEDBYTES
281
+ #undef MLDSA_POLYW1_PACKEDBITS
282
+ #undef MLDSA_POLYW1_PACKEDBITS_32
283
+ #undef MLDSA_POLYW1_PACKEDBITS_88
274
284
  #undef MLDSA_POLYW1_PACKEDBYTES
275
285
  #undef MLDSA_POLYW1_PACKEDBYTES_32
276
286
  #undef MLDSA_POLYW1_PACKEDBYTES_88
287
+ #undef MLDSA_POLYZ_PACKEDBITS
277
288
  #undef MLDSA_POLYZ_PACKEDBYTES
278
289
  #undef MLDSA_Q
279
290
  #undef MLDSA_Q_HALF
@@ -316,24 +327,22 @@
316
327
  #undef mld_polyeta_pack
317
328
  #undef mld_polyeta_unpack
318
329
  #undef mld_polyw1_pack
330
+ #undef mld_polyw1_unpack
319
331
  #undef mld_polyz_pack
320
332
  #undef mld_polyz_unpack
321
333
  /* mldsa/src/polyvec.h */
322
334
  #undef MLD_POLYVEC_H
323
335
  #undef mld_polyveck
324
336
  #undef mld_polyveck_caddq
325
- #undef mld_polyveck_chknorm
326
- #undef mld_polyveck_decompose
337
+ #undef mld_polyveck_decompose_pack_w1
327
338
  #undef mld_polyveck_invntt_tomont
328
339
  #undef mld_polyveck_ntt
329
- #undef mld_polyveck_pack_eta
330
- #undef mld_polyveck_pack_w1
331
340
  #undef mld_polyveck_reduce
332
341
  #undef mld_polyveck_unpack_eta
342
+ #undef mld_polyveck_unpack_eta_chknorm
333
343
  #undef mld_polyvecl
334
344
  #undef mld_polyvecl_chknorm
335
345
  #undef mld_polyvecl_ntt
336
- #undef mld_polyvecl_pack_eta
337
346
  #undef mld_polyvecl_pointwise_acc_montgomery
338
347
  #undef mld_polyvecl_uniform_gamma1
339
348
  #undef mld_polyvecl_unpack_eta
@@ -390,6 +399,9 @@
390
399
  #undef mld_yvec_init_eager
391
400
  #undef mld_yvec_init_lazy
392
401
  #undef mld_yvec_lazy
402
+ #undef mld_yvec_scratch
403
+ #undef mld_yvec_scratch_eager
404
+ #undef mld_yvec_scratch_lazy
393
405
  /* mldsa/src/rounding.h */
394
406
  #undef MLD_2_POW_D
395
407
  #undef MLD_ROUNDING_H
@@ -432,6 +444,8 @@
432
444
  /*
433
445
  * Undefine macros from MLD_CONFIG_PARAMETER_SET-generic files
434
446
  */
447
+ /* mldsa/src/capability.h */
448
+ #undef MLD_CAPABILITY_H
435
449
  /* mldsa/src/context.h */
436
450
  #undef MLD_CONTEXT_H
437
451
  #undef MLD_CONTEXT_PARAMETERS_0
@@ -484,10 +498,11 @@
484
498
  #undef mld_polyt1_unpack
485
499
  #undef mld_polyw1_pack_32
486
500
  #undef mld_polyw1_pack_88
501
+ #undef mld_polyw1_unpack_32
502
+ #undef mld_polyw1_unpack_88
487
503
  /* mldsa/src/randombytes.h */
488
504
  #undef MLD_RANDOMBYTES_H
489
505
  /* mldsa/src/reduce.h */
490
- #undef MLD_MONT
491
506
  #undef MLD_REDUCE32_DOMAIN_MAX
492
507
  #undef MLD_REDUCE32_RANGE_MAX
493
508
  #undef MLD_REDUCE_H
@@ -515,38 +530,6 @@
515
530
  #undef mld_xof256_x4_init
516
531
  #undef mld_xof256_x4_release
517
532
  #undef mld_xof256_x4_squeezeblocks
518
- /* mldsa/src/sys.h */
519
- #undef MLD_ALIGN
520
- #undef MLD_ALIGN_UP
521
- #undef MLD_ALWAYS_INLINE
522
- #undef MLD_CET_ENDBR
523
- #undef MLD_CT_TESTING_DECLASSIFY
524
- #undef MLD_CT_TESTING_SECRET
525
- #undef MLD_DEFAULT_ALIGN
526
- #undef MLD_HAVE_INLINE_ASM
527
- #undef MLD_INLINE
528
- #undef MLD_MUST_CHECK_RETURN_VALUE
529
- #undef MLD_NOINLINE
530
- #undef MLD_RESTRICT
531
- #undef MLD_STATIC_TESTABLE
532
- #undef MLD_SYSV_ABI
533
- #undef MLD_SYSV_ABI_SUPPORTED
534
- #undef MLD_SYS_AARCH64
535
- #undef MLD_SYS_AARCH64_EB
536
- #undef MLD_SYS_AARCH64_NEON
537
- #undef MLD_SYS_APPLE
538
- #undef MLD_SYS_ARMV81M_MVE
539
- #undef MLD_SYS_BIG_ENDIAN
540
- #undef MLD_SYS_H
541
- #undef MLD_SYS_LINUX
542
- #undef MLD_SYS_LITTLE_ENDIAN
543
- #undef MLD_SYS_PPC64LE
544
- #undef MLD_SYS_RISCV32
545
- #undef MLD_SYS_RISCV64
546
- #undef MLD_SYS_RISCV64_RVV
547
- #undef MLD_SYS_WINDOWS
548
- #undef MLD_SYS_X86_64
549
- #undef MLD_SYS_X86_64_AVX2
550
533
  /* mldsa/src/cbmc.h */
551
534
  #undef MLD_CBMC_H
552
535
  #undef __contract__
@@ -644,13 +627,25 @@
644
627
  /*
645
628
  * Undefine macros from native code (FIPS202, x86_64)
646
629
  */
630
+ /* mldsa/src/fips202/native/x86_64/auto.h */
631
+ #undef MLD_FIPS202_NATIVE_X86_64_AUTO_H
632
+ /* mldsa/src/fips202/native/x86_64/keccak_f1600_x1_avx512.h */
633
+ #undef MLD_FIPS202_NATIVE_X86_64_KECCAK_F1600_X1_AVX512_H
634
+ #undef MLD_FIPS202_X86_64_NEED_X1_AVX512
635
+ #undef MLD_USE_NATIVE_FIPS202_X1
647
636
  /* mldsa/src/fips202/native/x86_64/keccak_f1600_x4_avx2.h */
648
637
  #undef MLD_FIPS202_NATIVE_X86_64_KECCAK_F1600_X4_AVX2_H
649
638
  #undef MLD_FIPS202_X86_64_NEED_X4_AVX2
650
639
  #undef MLD_USE_NATIVE_FIPS202_X4
640
+ /* mldsa/src/fips202/native/x86_64/keccak_f1600_x4_avx512.h */
641
+ #undef MLD_FIPS202_NATIVE_X86_64_KECCAK_F1600_X4_AVX512_H
642
+ #undef MLD_FIPS202_X86_64_NEED_X4_AVX512
643
+ #undef MLD_USE_NATIVE_FIPS202_X4
651
644
  /* mldsa/src/fips202/native/x86_64/src/fips202_native_x86_64.h */
652
645
  #undef MLD_FIPS202_NATIVE_X86_64_SRC_FIPS202_NATIVE_X86_64_H
646
+ #undef mld_keccak_f1600_x1_avx512_asm
653
647
  #undef mld_keccak_f1600_x4_avx2_asm
648
+ #undef mld_keccak_f1600_x4_avx512_asm
654
649
  #undef mld_keccak_rho56
655
650
  #undef mld_keccak_rho8
656
651
  #undef mld_keccakf1600_round_constants
@@ -799,5 +794,63 @@
799
794
  #undef MLD_NATIVE_X86_64_SRC_CONSTS_H
800
795
  #undef mld_qdata
801
796
  #endif /* MLD_SYS_X86_64 */
797
+ #if defined(MLD_SYS_RISCV32)
798
+ /*
799
+ * Undefine macros from native code (Arith, RV32IM)
800
+ */
801
+ /* mldsa/src/native/rv32im/fastmul.h */
802
+ #undef MLD_ARITH_BACKEND_RV32IM
803
+ #undef MLD_NATIVE_RV32IM_FASTMUL_H
804
+ #undef MLD_RV32IM_NEED_FASTMUL
805
+ #undef MLD_USE_NATIVE_INTT
806
+ #undef MLD_USE_NATIVE_NTT
807
+ #undef MLD_USE_NATIVE_POINTWISE_MONTGOMERY
808
+ /* mldsa/src/native/rv32im/slowmul.h */
809
+ #undef MLD_ARITH_BACKEND_RV32IM
810
+ #undef MLD_NATIVE_RV32IM_SLOWMUL_H
811
+ #undef MLD_RV32IM_NEED_SLOWMUL
812
+ #undef MLD_USE_NATIVE_INTT
813
+ #undef MLD_USE_NATIVE_NTT
814
+ #undef MLD_USE_NATIVE_POINTWISE_MONTGOMERY
815
+ /* mldsa/src/native/rv32im/src/arith_native_rv32im.h */
816
+ #undef MLD_NATIVE_RV32IM_SRC_ARITH_NATIVE_RV32IM_H
817
+ #undef mld_intt_rv32im_fastmul_asm
818
+ #undef mld_intt_rv32im_slowmul_asm
819
+ #undef mld_ntt_rv32im_fastmul_asm
820
+ #undef mld_ntt_rv32im_slowmul_asm
821
+ #undef mld_poly_pointwise_montgomery_rv32im_asm
822
+ #undef mld_rv32im_ntt_zetas
823
+ #endif /* MLD_SYS_RISCV32 */
802
824
  #endif /* MLD_CONFIG_USE_NATIVE_BACKEND_ARITH */
825
+ /* mldsa/src/sys.h */
826
+ #undef MLD_ALIGN
827
+ #undef MLD_ALIGN_UP
828
+ #undef MLD_ALWAYS_INLINE
829
+ #undef MLD_CET_ENDBR
830
+ #undef MLD_DEFAULT_ALIGN
831
+ #undef MLD_INLINE
832
+ #undef MLD_MUST_CHECK_RETURN_VALUE
833
+ #undef MLD_NOINLINE
834
+ #undef MLD_RESTRICT
835
+ #undef MLD_STATIC_TESTABLE
836
+ #undef MLD_SYSV_ABI
837
+ #undef MLD_SYSV_ABI_SUPPORTED
838
+ #undef MLD_SYS_AARCH64
839
+ #undef MLD_SYS_AARCH64_EB
840
+ #undef MLD_SYS_AARCH64_NEON
841
+ #undef MLD_SYS_APPLE
842
+ #undef MLD_SYS_ARMV81M_MVE
843
+ #undef MLD_SYS_BIG_ENDIAN
844
+ #undef MLD_SYS_H
845
+ #undef MLD_SYS_LINUX
846
+ #undef MLD_SYS_LITTLE_ENDIAN
847
+ #undef MLD_SYS_PPC64LE
848
+ #undef MLD_SYS_RISCV32
849
+ #undef MLD_SYS_RISCV32_M
850
+ #undef MLD_SYS_RISCV64
851
+ #undef MLD_SYS_RISCV64_RVV
852
+ #undef MLD_SYS_WINDOWS
853
+ #undef MLD_SYS_X86_64
854
+ #undef MLD_SYS_X86_64_AVX2
855
+ #undef MLD_SYS_X86_64_AVX512
803
856
  #endif /* !MLD_CONFIG_MONOBUILD_KEEP_SHARED_HEADERS */
@@ -26,7 +26,9 @@
26
26
  * # API conventions
27
27
  *
28
28
  * Conventions shared by all functions below (return values, pointer validity,
29
- * output buffers on error) are documented in API-CONVENTIONS.md.
29
+ * buffer overlap, output buffers on error) are documented in
30
+ * API-CONVENTIONS.md. In particular, buffers passed to the same function must
31
+ * not overlap.
30
32
  *
31
33
  * # Multi-level builds
32
34
  *
@@ -35,6 +37,10 @@
35
37
  * in the configuration file and include this header multiple times, setting
36
38
  * MLD_CONFIG_PARAMETER_SET accordingly for each, and #undef'ing the MLD_H
37
39
  * guard to allow multiple inclusions.
40
+ *
41
+ * In this case, the configuration file must also set
42
+ * MLD_CONFIG_MULTILEVEL_BUILD. Without it, the parameter set is not appended
43
+ * to the namespace prefix and all inclusions declare the same symbol names.
38
44
  */
39
45
 
40
46
  /******************************* Key sizes ************************************/
@@ -128,11 +134,7 @@
128
134
  * string longer than 255 bytes. */
129
135
  #define MLD_ERR_INVALID_ARG (-9)
130
136
 
131
- /********************* Namespacing and Qualifiers *****************************/
132
-
133
- #define MLD_API_CONCAT_(x, y) x##y
134
- #define MLD_API_CONCAT(x, y) MLD_API_CONCAT_(x, y)
135
- #define MLD_API_CONCAT_UNDERSCORE(x, y) MLD_API_CONCAT(MLD_API_CONCAT(x, _), y)
137
+ /****************************** Configuration *********************************/
136
138
 
137
139
  /* You need to make sure the config file is in the include path. */
138
140
  #if defined(MLD_CONFIG_FILE)
@@ -141,6 +143,32 @@
141
143
  #include "mldsa_native_config.h"
142
144
  #endif
143
145
 
146
+ /* Hash algorithm constants for domain separation */
147
+ #define MLD_PREHASH_NONE 0
148
+ #define MLD_PREHASH_SHA2_224 1
149
+ #define MLD_PREHASH_SHA2_256 2
150
+ #define MLD_PREHASH_SHA2_384 3
151
+ #define MLD_PREHASH_SHA2_512 4
152
+ #define MLD_PREHASH_SHA2_512_224 5
153
+ #define MLD_PREHASH_SHA2_512_256 6
154
+ #define MLD_PREHASH_SHA3_224 7
155
+ #define MLD_PREHASH_SHA3_256 8
156
+ #define MLD_PREHASH_SHA3_384 9
157
+ #define MLD_PREHASH_SHA3_512 10
158
+ #define MLD_PREHASH_SHAKE_128 11
159
+ #define MLD_PREHASH_SHAKE_256 12
160
+
161
+ /* Maximum formatted domain separation message length */
162
+ #define MLD_DOMAIN_SEPARATION_MAX_BYTES (2 + 255 + 11 + 64)
163
+
164
+ /********************* Namespacing and Qualifiers *****************************/
165
+
166
+ #if !defined(MLD_CONFIG_CONSTANTS_ONLY)
167
+
168
+ #define MLD_API_CONCAT_(x, y) x##y
169
+ #define MLD_API_CONCAT(x, y) MLD_API_CONCAT_(x, y)
170
+ #define MLD_API_CONCAT_UNDERSCORE(x, y) MLD_API_CONCAT(MLD_API_CONCAT(x, _), y)
171
+
144
172
  /* Namespace prefix for the public API symbols. For multi-level builds, the
145
173
  * parameter set is appended to disambiguate the security levels. */
146
174
  #if defined(MLD_CONFIG_MULTILEVEL_BUILD)
@@ -165,28 +193,8 @@
165
193
  #define MLD_API_QUALIFIER
166
194
  #endif
167
195
 
168
- /* Hash algorithm constants for domain separation */
169
- #define MLD_PREHASH_NONE 0
170
- #define MLD_PREHASH_SHA2_224 1
171
- #define MLD_PREHASH_SHA2_256 2
172
- #define MLD_PREHASH_SHA2_384 3
173
- #define MLD_PREHASH_SHA2_512 4
174
- #define MLD_PREHASH_SHA2_512_224 5
175
- #define MLD_PREHASH_SHA2_512_256 6
176
- #define MLD_PREHASH_SHA3_224 7
177
- #define MLD_PREHASH_SHA3_256 8
178
- #define MLD_PREHASH_SHA3_384 9
179
- #define MLD_PREHASH_SHA3_512 10
180
- #define MLD_PREHASH_SHAKE_128 11
181
- #define MLD_PREHASH_SHAKE_256 12
182
-
183
- /* Maximum formatted domain separation message length */
184
- #define MLD_DOMAIN_SEPARATION_MAX_BYTES (2 + 255 + 11 + 64)
185
-
186
196
  /****************************** Function API **********************************/
187
197
 
188
- #if !defined(MLD_CONFIG_CONSTANTS_ONLY)
189
-
190
198
  #include <stddef.h>
191
199
  #include <stdint.h>
192
200
 
@@ -309,8 +317,8 @@ int MLD_API_NAMESPACE(keypair)(
309
317
  * message representative mu (when externalmu != 0).
310
318
  * @param mlen Length of m. Must equal MLDSA_CRHBYTES when
311
319
  * externalmu != 0.
312
- * @param[in] pre Pointer to prefix string. Ignored when
313
- * externalmu != 0.
320
+ * @param[in] pre Pointer to prefix string. May be NULL if
321
+ * prelen == 0. Ignored when externalmu != 0.
314
322
  * @param prelen Length of prefix string. Ignored when
315
323
  * externalmu != 0.
316
324
  * @param[in] rnd Random seed.
@@ -380,8 +388,10 @@ int MLD_API_NAMESPACE(signature_internal)(
380
388
  * @retval MLD_ERR_SIGN_ATTEMPTS_EXHAUSTED The rejection-sampling loop exceeded
381
389
  * MLD_CONFIG_MAX_SIGNING_ATTEMPTS
382
390
  * iterations.
383
- * @retval MLD_ERR_SIGNING_PAUSED A MLD_CONFIG_SIGN_HOOK_ATTEMPT hook
384
- * paused signing; re-invoke to resume.
391
+ * @retval MLD_ERR_SIGNING_PAUSED This should currently never happen:
392
+ * signing hooks require
393
+ * MLD_CONFIG_NO_RANDOMIZED_API, which
394
+ * removes this function.
385
395
  * @retval MLD_ERR_INVALID_ARG The context string exceeded 255
386
396
  * bytes.
387
397
  */
@@ -426,8 +436,10 @@ int MLD_API_NAMESPACE(signature)(
426
436
  * @retval MLD_ERR_SIGN_ATTEMPTS_EXHAUSTED The rejection-sampling loop exceeded
427
437
  * MLD_CONFIG_MAX_SIGNING_ATTEMPTS
428
438
  * iterations.
429
- * @retval MLD_ERR_SIGNING_PAUSED A MLD_CONFIG_SIGN_HOOK_ATTEMPT hook
430
- * paused signing; re-invoke to resume.
439
+ * @retval MLD_ERR_SIGNING_PAUSED This should currently never happen:
440
+ * signing hooks require
441
+ * MLD_CONFIG_NO_RANDOMIZED_API, which
442
+ * removes this function.
431
443
  */
432
444
  MLD_API_QUALIFIER
433
445
  MLD_API_MUST_CHECK_RETURN_VALUE
@@ -458,7 +470,8 @@ int MLD_API_NAMESPACE(signature_extmu)(
458
470
  * externalmu != 0).
459
471
  * @param mlen Length of m. Must equal MLDSA_CRHBYTES when
460
472
  * externalmu != 0.
461
- * @param[in] pre Pointer to prefix string. Ignored when externalmu != 0.
473
+ * @param[in] pre Pointer to prefix string. May be NULL if prelen == 0.
474
+ * Ignored when externalmu != 0.
462
475
  * @param prelen Length of prefix string. Ignored when externalmu != 0.
463
476
  * @param[in] pk Bit-packed public key.
464
477
  * @param externalmu 0: m/mlen is the raw message; mu = H(H(pk), pre, m) is
@@ -780,6 +793,7 @@ int MLD_API_NAMESPACE(verify_pre_hash_shake256)(
780
793
  #endif /* !MLD_CONFIG_CORE_API_ONLY */
781
794
 
782
795
  #if !defined(MLD_CONFIG_CORE_API_ONLY)
796
+ #if !defined(MLD_CONFIG_NO_SIGN_API) || !defined(MLD_CONFIG_NO_VERIFY_API)
783
797
  /**
784
798
  * Prepare domain separation prefix for ML-DSA signing.
785
799
  *
@@ -815,14 +829,15 @@ int MLD_API_NAMESPACE(verify_pre_hash_shake256)(
815
829
  * @return The total length of the formatted prefix, or 0 on error.
816
830
  * Errors are:
817
831
  * - The context string exceeded 255 bytes.
818
- * - For HashML-DSA: hashalg was unsupported, ph was NULL, or phlen
819
- * did not match the output length of hashalg.
832
+ * - For HashML-DSA: hashalg was unsupported, or phlen did not match
833
+ * the output length of hashalg.
820
834
  */
821
835
  MLD_API_QUALIFIER
822
836
  MLD_API_MUST_CHECK_RETURN_VALUE
823
837
  size_t MLD_API_NAMESPACE(prepare_domain_separation_prefix)(
824
838
  uint8_t prefix[MLD_DOMAIN_SEPARATION_MAX_BYTES], const uint8_t *ph,
825
839
  size_t phlen, const uint8_t *ctx, size_t ctxlen, int hashalg);
840
+ #endif /* !MLD_CONFIG_NO_SIGN_API || !MLD_CONFIG_NO_VERIFY_API */
826
841
 
827
842
  #if !defined(MLD_CONFIG_NO_KEYPAIR_API)
828
843
  /**
@@ -888,36 +903,36 @@ int MLD_API_NAMESPACE(pk_from_sk)(
888
903
  */
889
904
  /* check-magic: off */
890
905
  #if !defined(MLD_CONFIG_REDUCE_RAM)
891
- #define MLD_TOTAL_ALLOC_44_KEYPAIR_NO_PCT 26912
892
- #define MLD_TOTAL_ALLOC_44_KEYPAIR_PCT 48480
893
- #define MLD_TOTAL_ALLOC_44_PK_FROM_SK 28480
894
- #define MLD_TOTAL_ALLOC_44_SIGN 44704
906
+ #define MLD_TOTAL_ALLOC_44_KEYPAIR_NO_PCT 22816
907
+ #define MLD_TOTAL_ALLOC_44_KEYPAIR_PCT 48224
908
+ #define MLD_TOTAL_ALLOC_44_PK_FROM_SK 25408
909
+ #define MLD_TOTAL_ALLOC_44_SIGN 44448
895
910
  #define MLD_TOTAL_ALLOC_44_VERIFY 24448
896
- #define MLD_TOTAL_ALLOC_65_KEYPAIR_NO_PCT 44320
897
- #define MLD_TOTAL_ALLOC_65_KEYPAIR_PCT 74624
898
- #define MLD_TOTAL_ALLOC_65_PK_FROM_SK 46720
899
- #define MLD_TOTAL_ALLOC_65_SIGN 69312
911
+ #define MLD_TOTAL_ALLOC_65_KEYPAIR_NO_PCT 38176
912
+ #define MLD_TOTAL_ALLOC_65_KEYPAIR_PCT 73344
913
+ #define MLD_TOTAL_ALLOC_65_PK_FROM_SK 41600
914
+ #define MLD_TOTAL_ALLOC_65_SIGN 68032
900
915
  #define MLD_TOTAL_ALLOC_65_VERIFY 39872
901
- #define MLD_TOTAL_ALLOC_87_KEYPAIR_NO_PCT 75040
902
- #define MLD_TOTAL_ALLOC_87_KEYPAIR_PCT 115488
903
- #define MLD_TOTAL_ALLOC_87_PK_FROM_SK 78272
904
- #define MLD_TOTAL_ALLOC_87_SIGN 108224
916
+ #define MLD_TOTAL_ALLOC_87_KEYPAIR_NO_PCT 66848
917
+ #define MLD_TOTAL_ALLOC_87_KEYPAIR_PCT 114464
918
+ #define MLD_TOTAL_ALLOC_87_PK_FROM_SK 71104
919
+ #define MLD_TOTAL_ALLOC_87_SIGN 107200
905
920
  #define MLD_TOTAL_ALLOC_87_VERIFY 68800
906
921
  #else /* !MLD_CONFIG_REDUCE_RAM */
907
- #define MLD_TOTAL_ALLOC_44_KEYPAIR_NO_PCT 11584
908
- #define MLD_TOTAL_ALLOC_44_KEYPAIR_PCT 16896
909
- #define MLD_TOTAL_ALLOC_44_PK_FROM_SK 13152
910
- #define MLD_TOTAL_ALLOC_44_SIGN 13120
922
+ #define MLD_TOTAL_ALLOC_44_KEYPAIR_NO_PCT 7488
923
+ #define MLD_TOTAL_ALLOC_44_KEYPAIR_PCT 13568
924
+ #define MLD_TOTAL_ALLOC_44_PK_FROM_SK 10080
925
+ #define MLD_TOTAL_ALLOC_44_SIGN 9792
911
926
  #define MLD_TOTAL_ALLOC_44_VERIFY 9120
912
- #define MLD_TOTAL_ALLOC_65_KEYPAIR_NO_PCT 14656
913
- #define MLD_TOTAL_ALLOC_65_KEYPAIR_PCT 22560
914
- #define MLD_TOTAL_ALLOC_65_PK_FROM_SK 17056
915
- #define MLD_TOTAL_ALLOC_65_SIGN 17248
927
+ #define MLD_TOTAL_ALLOC_65_KEYPAIR_NO_PCT 8512
928
+ #define MLD_TOTAL_ALLOC_65_KEYPAIR_PCT 17184
929
+ #define MLD_TOTAL_ALLOC_65_PK_FROM_SK 11936
930
+ #define MLD_TOTAL_ALLOC_65_SIGN 11872
916
931
  #define MLD_TOTAL_ALLOC_65_VERIFY 10208
917
- #define MLD_TOTAL_ALLOC_87_KEYPAIR_NO_PCT 18752
918
- #define MLD_TOTAL_ALLOC_87_KEYPAIR_PCT 28608
919
- #define MLD_TOTAL_ALLOC_87_PK_FROM_SK 21984
920
- #define MLD_TOTAL_ALLOC_87_SIGN 21344
932
+ #define MLD_TOTAL_ALLOC_87_KEYPAIR_NO_PCT 10560
933
+ #define MLD_TOTAL_ALLOC_87_KEYPAIR_PCT 21440
934
+ #define MLD_TOTAL_ALLOC_87_PK_FROM_SK 14816
935
+ #define MLD_TOTAL_ALLOC_87_SIGN 14176
921
936
  #define MLD_TOTAL_ALLOC_87_VERIFY 12512
922
937
  #endif /* MLD_CONFIG_REDUCE_RAM */
923
938
  /* check-magic: on */