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