pq_crypto 0.6.0 → 0.6.2

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 (154) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +12 -0
  3. data/SECURITY.md +7 -0
  4. data/ext/pqcrypto/extconf.rb +2 -0
  5. data/ext/pqcrypto/pqcrypto_ruby_secure.c +139 -0
  6. data/ext/pqcrypto/pqcrypto_secure.c +532 -0
  7. data/ext/pqcrypto/pqcrypto_secure.h +20 -0
  8. data/ext/pqcrypto/pqcrypto_version.h +1 -1
  9. data/ext/pqcrypto/vendor/.vendored +4 -4
  10. data/ext/pqcrypto/vendor/mldsa-native/README.md +23 -10
  11. data/ext/pqcrypto/vendor/mldsa-native/mldsa/README.md +23 -0
  12. data/ext/pqcrypto/vendor/mldsa-native/mldsa/mldsa_native.c +114 -58
  13. data/ext/pqcrypto/vendor/mldsa-native/mldsa/mldsa_native.h +498 -461
  14. data/ext/pqcrypto/vendor/mldsa-native/mldsa/mldsa_native_asm.S +145 -85
  15. data/ext/pqcrypto/vendor/mldsa-native/mldsa/mldsa_native_config.h +456 -422
  16. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/cbmc.h +47 -25
  17. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/common.h +26 -14
  18. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/ct.h +56 -81
  19. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/debug.h +17 -24
  20. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/fips202.c +33 -40
  21. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/fips202.h +67 -87
  22. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/fips202x4.c +19 -14
  23. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/fips202x4.h +13 -5
  24. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/keccakf1600.c +84 -10
  25. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/keccakf1600.h +10 -5
  26. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/aarch64/auto.h +6 -0
  27. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/aarch64/src/fips202_native_aarch64.h +22 -15
  28. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/aarch64/src/keccak_f1600_x1_scalar_aarch64_asm.S +376 -0
  29. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/aarch64/src/keccak_f1600_x1_v84a_aarch64_asm.S +204 -0
  30. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/aarch64/src/keccak_f1600_x2_v84a_aarch64_asm.S +259 -0
  31. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/aarch64/src/keccak_f1600_x4_v8a_scalar_hybrid_aarch64_asm.S +1077 -0
  32. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/aarch64/src/keccak_f1600_x4_v8a_v84a_scalar_hybrid_aarch64_asm.S +987 -0
  33. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/aarch64/src/keccakf1600_round_constants.c +16 -10
  34. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/aarch64/x1_scalar.h +2 -1
  35. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/aarch64/x1_v84a.h +1 -1
  36. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/aarch64/x2_v84a.h +4 -2
  37. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/aarch64/x4_v8a_scalar.h +2 -2
  38. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/aarch64/x4_v8a_v84a_scalar.h +1 -1
  39. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/api.h +60 -0
  40. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/armv81m/mve.h +48 -0
  41. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/armv81m/src/fips202_native_armv81m.h +18 -1
  42. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/armv81m/src/keccak_f1600_x4_mve.S +658 -582
  43. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/armv81m/src/keccak_f1600_x4_mve.c +5 -100
  44. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/armv81m/src/keccakf1600_round_constants.c +26 -25
  45. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/armv81m/src/state_extract_bytes_x4_mve.S +334 -0
  46. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/armv81m/src/state_xor_bytes_x4_mve.S +355 -0
  47. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/auto.h +8 -3
  48. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/x86_64/{xkcp.h → keccak_f1600_x4_avx2.h} +11 -8
  49. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/x86_64/src/fips202_native_x86_64.h +44 -0
  50. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/x86_64/src/keccak_f1600_x4_avx2_asm.S +454 -0
  51. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/x86_64/src/keccakf1600_constants.c +52 -0
  52. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/meta.h +37 -28
  53. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/aarch64_zetas.c +213 -196
  54. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/arith_native_aarch64.h +248 -64
  55. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/intt_aarch64_asm.S +753 -0
  56. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/mld_polyvecl_pointwise_acc_montgomery_l4_aarch64_asm.S +129 -0
  57. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/mld_polyvecl_pointwise_acc_montgomery_l5_aarch64_asm.S +145 -0
  58. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/mld_polyvecl_pointwise_acc_montgomery_l7_aarch64_asm.S +177 -0
  59. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/ntt_aarch64_asm.S +653 -0
  60. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/pointwise_montgomery_aarch64_asm.S +84 -0
  61. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/poly_caddq_aarch64_asm.S +53 -0
  62. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/poly_chknorm_aarch64_asm.S +55 -0
  63. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/poly_decompose_32_aarch64_asm.S +86 -0
  64. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/poly_decompose_88_aarch64_asm.S +86 -0
  65. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/poly_use_hint_32_aarch64_asm.S +103 -0
  66. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/poly_use_hint_88_aarch64_asm.S +111 -0
  67. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/polyz_unpack_17_aarch64_asm.S +75 -0
  68. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/polyz_unpack_19_aarch64_asm.S +72 -0
  69. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/polyz_unpack_table.c +23 -11
  70. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/rej_uniform_aarch64_asm.S +189 -0
  71. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/rej_uniform_eta2_aarch64_asm.S +137 -0
  72. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/rej_uniform_eta4_aarch64_asm.S +130 -0
  73. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/rej_uniform_eta_table.c +520 -516
  74. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/rej_uniform_table.c +34 -33
  75. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/api.h +202 -242
  76. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/meta.h +25 -17
  77. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/arith_native_x86_64.h +112 -28
  78. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/consts.c +1 -1
  79. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/consts.h +1 -1
  80. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/intt_avx2_asm.S +2311 -0
  81. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/ntt_avx2_asm.S +2383 -0
  82. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/nttunpack_avx2_asm.S +238 -0
  83. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/pointwise_acc_l4_avx2_asm.S +139 -0
  84. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/pointwise_acc_l5_avx2_asm.S +155 -0
  85. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/pointwise_acc_l7_avx2_asm.S +187 -0
  86. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/pointwise_avx2_asm.S +130 -0
  87. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/poly_caddq_avx2_asm.S +190 -0
  88. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/poly_decompose_32_avx2.c +6 -4
  89. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/poly_decompose_88_avx2.c +6 -4
  90. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/poly_use_hint_32_avx2.c +9 -8
  91. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/poly_use_hint_88_avx2.c +10 -9
  92. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/polyz_unpack_17_avx2.c +8 -5
  93. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/polyz_unpack_19_avx2.c +8 -5
  94. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/rej_uniform_eta2_avx2.c +6 -4
  95. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/rej_uniform_eta4_avx2.c +6 -4
  96. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/rej_uniform_table.c +130 -129
  97. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/packing.c +109 -180
  98. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/packing.h +169 -150
  99. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/poly.c +56 -40
  100. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/poly.h +149 -164
  101. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/poly_kl.c +52 -57
  102. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/poly_kl.h +132 -167
  103. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/polyvec.c +57 -424
  104. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/polyvec.h +167 -474
  105. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/polyvec_lazy.c +308 -0
  106. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/polyvec_lazy.h +653 -0
  107. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/reduce.h +22 -29
  108. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/rounding.h +37 -43
  109. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/sign.c +511 -367
  110. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/sign.h +456 -417
  111. data/lib/pq_crypto/hybrid_kem.rb +1 -1
  112. data/lib/pq_crypto/internal.rb +23 -0
  113. data/lib/pq_crypto/kem.rb +27 -34
  114. data/lib/pq_crypto/pkcs8/der.rb +68 -0
  115. data/lib/pq_crypto/pkcs8/private_key_choice.rb +186 -0
  116. data/lib/pq_crypto/pkcs8.rb +51 -468
  117. data/lib/pq_crypto/serialization.rb +19 -29
  118. data/lib/pq_crypto/signature.rb +28 -35
  119. data/lib/pq_crypto/version.rb +1 -1
  120. data/lib/pq_crypto.rb +10 -0
  121. data/script/vendor_libs.rb +3 -3
  122. metadata +44 -35
  123. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/aarch64/src/keccak_f1600_x1_scalar_asm.S +0 -376
  124. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/aarch64/src/keccak_f1600_x1_v84a_asm.S +0 -204
  125. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/aarch64/src/keccak_f1600_x2_v84a_asm.S +0 -259
  126. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/aarch64/src/keccak_f1600_x4_v8a_scalar_hybrid_asm.S +0 -1077
  127. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/aarch64/src/keccak_f1600_x4_v8a_v84a_scalar_hybrid_asm.S +0 -987
  128. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/x86_64/src/KeccakP_1600_times4_SIMD256.c +0 -488
  129. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/x86_64/src/KeccakP_1600_times4_SIMD256.h +0 -16
  130. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/intt.S +0 -753
  131. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/mld_polyvecl_pointwise_acc_montgomery_l4.S +0 -129
  132. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/mld_polyvecl_pointwise_acc_montgomery_l5.S +0 -145
  133. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/mld_polyvecl_pointwise_acc_montgomery_l7.S +0 -177
  134. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/ntt.S +0 -653
  135. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/pointwise_montgomery.S +0 -79
  136. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/poly_caddq_asm.S +0 -53
  137. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/poly_chknorm_asm.S +0 -55
  138. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/poly_decompose_32_asm.S +0 -85
  139. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/poly_decompose_88_asm.S +0 -85
  140. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/poly_use_hint_32_asm.S +0 -102
  141. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/poly_use_hint_88_asm.S +0 -110
  142. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/polyz_unpack_17_asm.S +0 -72
  143. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/polyz_unpack_19_asm.S +0 -69
  144. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/rej_uniform_asm.S +0 -189
  145. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/rej_uniform_eta2_asm.S +0 -135
  146. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/rej_uniform_eta4_asm.S +0 -128
  147. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/intt.S +0 -2311
  148. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/ntt.S +0 -2383
  149. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/nttunpack.S +0 -239
  150. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/pointwise.S +0 -131
  151. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/pointwise_acc_l4.S +0 -139
  152. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/pointwise_acc_l5.S +0 -155
  153. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/pointwise_acc_l7.S +0 -187
  154. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/poly_caddq_avx2.c +0 -61
@@ -65,6 +65,7 @@
65
65
  #include "src/poly.c"
66
66
  #include "src/poly_kl.c"
67
67
  #include "src/polyvec.c"
68
+ #include "src/polyvec_lazy.c"
68
69
  #include "src/sign.c"
69
70
 
70
71
  #if !defined(MLD_CONFIG_FIPS202_CUSTOM_HEADER)
@@ -82,7 +83,6 @@
82
83
  #endif /* MLD_SYS_AARCH64 */
83
84
  #if defined(MLD_SYS_X86_64)
84
85
  #include "src/native/x86_64/src/consts.c"
85
- #include "src/native/x86_64/src/poly_caddq_avx2.c"
86
86
  #include "src/native/x86_64/src/poly_chknorm_avx2.c"
87
87
  #include "src/native/x86_64/src/poly_decompose_32_avx2.c"
88
88
  #include "src/native/x86_64/src/poly_decompose_88_avx2.c"
@@ -102,7 +102,7 @@
102
102
  #include "src/fips202/native/aarch64/src/keccakf1600_round_constants.c"
103
103
  #endif
104
104
  #if defined(MLD_SYS_X86_64)
105
- #include "src/fips202/native/x86_64/src/KeccakP_1600_times4_SIMD256.c"
105
+ #include "src/fips202/native/x86_64/src/keccakf1600_constants.c"
106
106
  #endif
107
107
  #if defined(MLD_SYS_ARMV81M_MVE)
108
108
  #include "src/fips202/native/armv81m/src/keccak_f1600_x4_mve.c"
@@ -175,8 +175,10 @@
175
175
  #undef MLD_ERR_FAIL
176
176
  #undef MLD_ERR_OUT_OF_MEMORY
177
177
  #undef MLD_ERR_RNG_FAIL
178
+ #undef MLD_ERR_SIGN_ATTEMPTS_EXHAUSTED
178
179
  #undef MLD_H
179
180
  #undef MLD_MAX3_
181
+ #undef MLD_MAX4_
180
182
  #undef MLD_PREHASH_NONE
181
183
  #undef MLD_PREHASH_SHA2_224
182
184
  #undef MLD_PREHASH_SHA2_256
@@ -194,18 +196,21 @@
194
196
  #undef MLD_TOTAL_ALLOC_44_KEYPAIR
195
197
  #undef MLD_TOTAL_ALLOC_44_KEYPAIR_NO_PCT
196
198
  #undef MLD_TOTAL_ALLOC_44_KEYPAIR_PCT
199
+ #undef MLD_TOTAL_ALLOC_44_PK_FROM_SK
197
200
  #undef MLD_TOTAL_ALLOC_44_SIGN
198
201
  #undef MLD_TOTAL_ALLOC_44_VERIFY
199
202
  #undef MLD_TOTAL_ALLOC_65
200
203
  #undef MLD_TOTAL_ALLOC_65_KEYPAIR
201
204
  #undef MLD_TOTAL_ALLOC_65_KEYPAIR_NO_PCT
202
205
  #undef MLD_TOTAL_ALLOC_65_KEYPAIR_PCT
206
+ #undef MLD_TOTAL_ALLOC_65_PK_FROM_SK
203
207
  #undef MLD_TOTAL_ALLOC_65_SIGN
204
208
  #undef MLD_TOTAL_ALLOC_65_VERIFY
205
209
  #undef MLD_TOTAL_ALLOC_87
206
210
  #undef MLD_TOTAL_ALLOC_87_KEYPAIR
207
211
  #undef MLD_TOTAL_ALLOC_87_KEYPAIR_NO_PCT
208
212
  #undef MLD_TOTAL_ALLOC_87_KEYPAIR_PCT
213
+ #undef MLD_TOTAL_ALLOC_87_PK_FROM_SK
209
214
  #undef MLD_TOTAL_ALLOC_87_SIGN
210
215
  #undef MLD_TOTAL_ALLOC_87_VERIFY
211
216
  #undef crypto_sign
@@ -216,6 +221,7 @@
216
221
  /* mldsa/src/common.h */
217
222
  #undef MLD_ADD_PARAM_SET
218
223
  #undef MLD_ALLOC
224
+ #undef MLD_ANY_ERROR
219
225
  #undef MLD_APPLY
220
226
  #undef MLD_ASM_FN_SIZE
221
227
  #undef MLD_ASM_FN_SYMBOL
@@ -238,27 +244,30 @@
238
244
  #undef MLD_ERR_FAIL
239
245
  #undef MLD_ERR_OUT_OF_MEMORY
240
246
  #undef MLD_ERR_RNG_FAIL
247
+ #undef MLD_ERR_SIGN_ATTEMPTS_EXHAUSTED
241
248
  #undef MLD_EXTERNAL_API
242
249
  #undef MLD_FIPS202X4_HEADER_FILE
243
250
  #undef MLD_FIPS202_HEADER_FILE
244
251
  #undef MLD_FREE
245
252
  #undef MLD_INTERNAL_API
253
+ #undef MLD_INTERNAL_DATA_DECLARATION
254
+ #undef MLD_INTERNAL_DATA_DEFINITION
246
255
  #undef MLD_MULTILEVEL_BUILD
247
256
  #undef MLD_NAMESPACE
248
257
  #undef MLD_NAMESPACE_KL
249
258
  #undef MLD_NAMESPACE_PREFIX
250
259
  #undef MLD_NAMESPACE_PREFIX_KL
251
- #undef MLD_UNION_OR_STRUCT
252
260
  #undef mld_memcpy
253
261
  #undef mld_memset
254
262
  /* mldsa/src/packing.h */
255
263
  #undef MLD_PACKING_H
256
- #undef mld_pack_pk
257
- #undef mld_pack_sig_c_h
264
+ #undef mld_pack_sig_c
265
+ #undef mld_pack_sig_h
258
266
  #undef mld_pack_sig_z
259
- #undef mld_pack_sk
260
- #undef mld_unpack_pk
261
- #undef mld_unpack_sig
267
+ #undef mld_pack_sk_rho_key_tr_s2
268
+ #undef mld_pack_sk_s1
269
+ #undef mld_sig_unpack_hints
270
+ #undef mld_unpack_pk_t1
262
271
  #undef mld_unpack_sk
263
272
  /* mldsa/src/params.h */
264
273
  #undef MLDSA_BETA
@@ -293,7 +302,6 @@
293
302
  #undef MLD_POLY_KL_H
294
303
  #undef mld_poly_challenge
295
304
  #undef mld_poly_decompose
296
- #undef mld_poly_make_hint
297
305
  #undef mld_poly_uniform_eta
298
306
  #undef mld_poly_uniform_eta_4x
299
307
  #undef mld_poly_uniform_gamma1
@@ -306,29 +314,16 @@
306
314
  #undef mld_polyz_unpack
307
315
  /* mldsa/src/polyvec.h */
308
316
  #undef MLD_POLYVEC_H
309
- #undef mld_polymat
310
- #undef mld_polymat_get_row
311
- #undef mld_polyvec_matrix_expand
312
- #undef mld_polyvec_matrix_pointwise_montgomery
313
317
  #undef mld_polyveck
314
- #undef mld_polyveck_add
315
318
  #undef mld_polyveck_caddq
316
319
  #undef mld_polyveck_chknorm
317
320
  #undef mld_polyveck_decompose
318
321
  #undef mld_polyveck_invntt_tomont
319
- #undef mld_polyveck_make_hint
320
322
  #undef mld_polyveck_ntt
321
323
  #undef mld_polyveck_pack_eta
322
- #undef mld_polyveck_pack_t0
323
324
  #undef mld_polyveck_pack_w1
324
- #undef mld_polyveck_pointwise_poly_montgomery
325
- #undef mld_polyveck_power2round
326
325
  #undef mld_polyveck_reduce
327
- #undef mld_polyveck_shiftl
328
- #undef mld_polyveck_sub
329
326
  #undef mld_polyveck_unpack_eta
330
- #undef mld_polyveck_unpack_t0
331
- #undef mld_polyveck_use_hint
332
327
  #undef mld_polyvecl
333
328
  #undef mld_polyvecl_chknorm
334
329
  #undef mld_polyvecl_ntt
@@ -337,6 +332,58 @@
337
332
  #undef mld_polyvecl_uniform_gamma1
338
333
  #undef mld_polyvecl_unpack_eta
339
334
  #undef mld_polyvecl_unpack_z
335
+ /* mldsa/src/polyvec_lazy.h */
336
+ #undef MLD_POLYVEC_LAZY_H
337
+ #undef mld_poly_permute_bitrev_to_custom_optional
338
+ #undef mld_polymat
339
+ #undef mld_polymat_eager
340
+ #undef mld_polymat_lazy
341
+ #undef mld_polyvec_matrix_expand
342
+ #undef mld_polyvec_matrix_expand_eager
343
+ #undef mld_polyvec_matrix_expand_lazy
344
+ #undef mld_polyvec_matrix_pointwise_montgomery
345
+ #undef mld_polyvec_matrix_pointwise_montgomery_row
346
+ #undef mld_polyvec_matrix_pointwise_montgomery_row_eager
347
+ #undef mld_polyvec_matrix_pointwise_montgomery_row_lazy
348
+ #undef mld_polyvec_matrix_pointwise_montgomery_yvec
349
+ #undef mld_polyvec_matrix_pointwise_montgomery_yvec_eager
350
+ #undef mld_polyvec_matrix_pointwise_montgomery_yvec_lazy
351
+ #undef mld_sk_s1hat
352
+ #undef mld_sk_s1hat_eager
353
+ #undef mld_sk_s1hat_get_poly
354
+ #undef mld_sk_s1hat_get_poly_eager
355
+ #undef mld_sk_s1hat_get_poly_lazy
356
+ #undef mld_sk_s1hat_lazy
357
+ #undef mld_sk_s2hat
358
+ #undef mld_sk_s2hat_eager
359
+ #undef mld_sk_s2hat_get_poly
360
+ #undef mld_sk_s2hat_get_poly_eager
361
+ #undef mld_sk_s2hat_get_poly_lazy
362
+ #undef mld_sk_s2hat_lazy
363
+ #undef mld_sk_t0hat
364
+ #undef mld_sk_t0hat_eager
365
+ #undef mld_sk_t0hat_get_poly
366
+ #undef mld_sk_t0hat_get_poly_eager
367
+ #undef mld_sk_t0hat_get_poly_lazy
368
+ #undef mld_sk_t0hat_lazy
369
+ #undef mld_unpack_sk_s1hat
370
+ #undef mld_unpack_sk_s1hat_eager
371
+ #undef mld_unpack_sk_s1hat_lazy
372
+ #undef mld_unpack_sk_s2hat
373
+ #undef mld_unpack_sk_s2hat_eager
374
+ #undef mld_unpack_sk_s2hat_lazy
375
+ #undef mld_unpack_sk_t0hat
376
+ #undef mld_unpack_sk_t0hat_eager
377
+ #undef mld_unpack_sk_t0hat_lazy
378
+ #undef mld_yvec
379
+ #undef mld_yvec_eager
380
+ #undef mld_yvec_get_poly
381
+ #undef mld_yvec_get_poly_eager
382
+ #undef mld_yvec_get_poly_lazy
383
+ #undef mld_yvec_init
384
+ #undef mld_yvec_init_eager
385
+ #undef mld_yvec_init_lazy
386
+ #undef mld_yvec_lazy
340
387
  /* mldsa/src/rounding.h */
341
388
  #undef MLD_2_POW_D
342
389
  #undef MLD_ROUNDING_H
@@ -539,11 +586,11 @@
539
586
  #undef MLD_FIPS202_NATIVE_AARCH64_AUTO_H
540
587
  /* mldsa/src/fips202/native/aarch64/src/fips202_native_aarch64.h */
541
588
  #undef MLD_FIPS202_NATIVE_AARCH64_SRC_FIPS202_NATIVE_AARCH64_H
542
- #undef mld_keccak_f1600_x1_scalar_asm
543
- #undef mld_keccak_f1600_x1_v84a_asm
544
- #undef mld_keccak_f1600_x2_v84a_asm
545
- #undef mld_keccak_f1600_x4_v8a_scalar_hybrid_asm
546
- #undef mld_keccak_f1600_x4_v8a_v84a_scalar_hybrid_asm
589
+ #undef mld_keccak_f1600_x1_scalar_aarch64_asm
590
+ #undef mld_keccak_f1600_x1_v84a_aarch64_asm
591
+ #undef mld_keccak_f1600_x2_v84a_aarch64_asm
592
+ #undef mld_keccak_f1600_x4_v8a_scalar_hybrid_aarch64_asm
593
+ #undef mld_keccak_f1600_x4_v8a_v84a_scalar_hybrid_aarch64_asm
547
594
  #undef mld_keccakf1600_round_constants
548
595
  /* mldsa/src/fips202/native/aarch64/x1_scalar.h */
549
596
  #undef MLD_FIPS202_AARCH64_NEED_X1_SCALAR
@@ -570,13 +617,16 @@
570
617
  /*
571
618
  * Undefine macros from native code (FIPS202, x86_64)
572
619
  */
573
- /* mldsa/src/fips202/native/x86_64/src/KeccakP_1600_times4_SIMD256.h */
574
- #undef MLD_FIPS202_NATIVE_X86_64_SRC_KECCAKP_1600_TIMES4_SIMD256_H
575
- #undef mld_keccakf1600x4_permute24
576
- /* mldsa/src/fips202/native/x86_64/xkcp.h */
577
- #undef MLD_FIPS202_NATIVE_X86_64_XKCP_H
578
- #undef MLD_FIPS202_X86_64_XKCP
620
+ /* mldsa/src/fips202/native/x86_64/keccak_f1600_x4_avx2.h */
621
+ #undef MLD_FIPS202_NATIVE_X86_64_KECCAK_F1600_X4_AVX2_H
622
+ #undef MLD_FIPS202_X86_64_NEED_X4_AVX2
579
623
  #undef MLD_USE_FIPS202_X4_NATIVE
624
+ /* mldsa/src/fips202/native/x86_64/src/fips202_native_x86_64.h */
625
+ #undef MLD_FIPS202_NATIVE_X86_64_SRC_FIPS202_NATIVE_X86_64_H
626
+ #undef mld_keccak_f1600_x4_avx2_asm
627
+ #undef mld_keccak_rho56
628
+ #undef mld_keccak_rho8
629
+ #undef mld_keccakf1600_round_constants
580
630
  #endif /* MLD_SYS_X86_64 */
581
631
  #if defined(MLD_SYS_ARMV81M_MVE)
582
632
  /*
@@ -586,11 +636,17 @@
586
636
  #undef MLD_FIPS202_ARMV81M_NEED_X4
587
637
  #undef MLD_FIPS202_NATIVE_ARMV81M
588
638
  #undef MLD_FIPS202_NATIVE_ARMV81M_MVE_H
639
+ #undef MLD_USE_FIPS202_X4_EXTRACT_BYTES_NATIVE
589
640
  #undef MLD_USE_FIPS202_X4_NATIVE
641
+ #undef MLD_USE_FIPS202_X4_XOR_BYTES_NATIVE
590
642
  #undef mld_keccak_f1600_x4_native_impl
643
+ #undef mld_keccak_f1600_x4_state_extract_bytes
644
+ #undef mld_keccak_f1600_x4_state_xor_bytes
591
645
  /* mldsa/src/fips202/native/armv81m/src/fips202_native_armv81m.h */
592
646
  #undef MLD_FIPS202_NATIVE_ARMV81M_SRC_FIPS202_NATIVE_ARMV81M_H
593
647
  #undef mld_keccak_f1600_x4_mve_asm
648
+ #undef mld_keccak_f1600_x4_state_extract_bytes_asm
649
+ #undef mld_keccak_f1600_x4_state_xor_bytes_asm
594
650
  #undef mld_keccakf1600_round_constants
595
651
  #endif /* MLD_SYS_ARMV81M_MVE */
596
652
  #endif /* MLD_CONFIG_USE_NATIVE_BACKEND_FIPS202 */
@@ -636,25 +692,25 @@
636
692
  #undef mld_aarch64_intt_zetas_layer78
637
693
  #undef mld_aarch64_ntt_zetas_layer123456
638
694
  #undef mld_aarch64_ntt_zetas_layer78
639
- #undef mld_intt_asm
640
- #undef mld_ntt_asm
641
- #undef mld_poly_caddq_asm
642
- #undef mld_poly_chknorm_asm
643
- #undef mld_poly_decompose_32_asm
644
- #undef mld_poly_decompose_88_asm
645
- #undef mld_poly_pointwise_montgomery_asm
646
- #undef mld_poly_use_hint_32_asm
647
- #undef mld_poly_use_hint_88_asm
648
- #undef mld_polyvecl_pointwise_acc_montgomery_l4_asm
649
- #undef mld_polyvecl_pointwise_acc_montgomery_l5_asm
650
- #undef mld_polyvecl_pointwise_acc_montgomery_l7_asm
651
- #undef mld_polyz_unpack_17_asm
695
+ #undef mld_intt_aarch64_asm
696
+ #undef mld_ntt_aarch64_asm
697
+ #undef mld_poly_caddq_aarch64_asm
698
+ #undef mld_poly_chknorm_aarch64_asm
699
+ #undef mld_poly_decompose_32_aarch64_asm
700
+ #undef mld_poly_decompose_88_aarch64_asm
701
+ #undef mld_poly_pointwise_montgomery_aarch64_asm
702
+ #undef mld_poly_use_hint_32_aarch64_asm
703
+ #undef mld_poly_use_hint_88_aarch64_asm
704
+ #undef mld_polyvecl_pointwise_acc_montgomery_l4_aarch64_asm
705
+ #undef mld_polyvecl_pointwise_acc_montgomery_l5_aarch64_asm
706
+ #undef mld_polyvecl_pointwise_acc_montgomery_l7_aarch64_asm
707
+ #undef mld_polyz_unpack_17_aarch64_asm
652
708
  #undef mld_polyz_unpack_17_indices
653
- #undef mld_polyz_unpack_19_asm
709
+ #undef mld_polyz_unpack_19_aarch64_asm
654
710
  #undef mld_polyz_unpack_19_indices
655
- #undef mld_rej_uniform_asm
656
- #undef mld_rej_uniform_eta2_asm
657
- #undef mld_rej_uniform_eta4_asm
711
+ #undef mld_rej_uniform_aarch64_asm
712
+ #undef mld_rej_uniform_eta2_aarch64_asm
713
+ #undef mld_rej_uniform_eta4_aarch64_asm
658
714
  #undef mld_rej_uniform_eta_table
659
715
  #undef mld_rej_uniform_table
660
716
  #endif /* MLD_SYS_AARCH64 */
@@ -688,14 +744,14 @@
688
744
  #undef MLD_AVX2_REJ_UNIFORM_ETA2_BUFLEN
689
745
  #undef MLD_AVX2_REJ_UNIFORM_ETA4_BUFLEN
690
746
  #undef MLD_NATIVE_X86_64_SRC_ARITH_NATIVE_X86_64_H
691
- #undef mld_invntt_avx2
692
- #undef mld_ntt_avx2
693
- #undef mld_nttunpack_avx2
694
- #undef mld_pointwise_acc_l4_avx2
695
- #undef mld_pointwise_acc_l5_avx2
696
- #undef mld_pointwise_acc_l7_avx2
697
- #undef mld_pointwise_avx2
698
- #undef mld_poly_caddq_avx2
747
+ #undef mld_invntt_avx2_asm
748
+ #undef mld_ntt_avx2_asm
749
+ #undef mld_nttunpack_avx2_asm
750
+ #undef mld_pointwise_acc_l4_avx2_asm
751
+ #undef mld_pointwise_acc_l5_avx2_asm
752
+ #undef mld_pointwise_acc_l7_avx2_asm
753
+ #undef mld_pointwise_avx2_asm
754
+ #undef mld_poly_caddq_avx2_asm
699
755
  #undef mld_poly_chknorm_avx2
700
756
  #undef mld_poly_decompose_32_avx2
701
757
  #undef mld_poly_decompose_88_avx2