pq_crypto 0.6.4 → 0.6.6

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 (213) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +180 -0
  3. data/README.md +7 -0
  4. data/ext/pqcrypto/extconf.rb +4 -1
  5. data/ext/pqcrypto/pq_externalmu.c +35 -0
  6. data/ext/pqcrypto/pqcrypto_native_api.h +85 -75
  7. data/ext/pqcrypto/pqcrypto_ruby_secure.c +16 -9
  8. data/ext/pqcrypto/pqcrypto_secure.c +43 -33
  9. data/ext/pqcrypto/pqcrypto_secure.h +52 -47
  10. data/ext/pqcrypto/pqcrypto_version.h +1 -1
  11. data/ext/pqcrypto/vendor/.vendored +7 -7
  12. data/ext/pqcrypto/vendor/mldsa-native/BUILDING.md +5 -2
  13. data/ext/pqcrypto/vendor/mldsa-native/LICENSE +21 -2
  14. data/ext/pqcrypto/vendor/mldsa-native/README.md +20 -7
  15. data/ext/pqcrypto/vendor/mldsa-native/RELEASE.md +160 -0
  16. data/ext/pqcrypto/vendor/mldsa-native/SECURITY.md +1 -1
  17. data/ext/pqcrypto/vendor/mldsa-native/mldsa/README.md +2 -2
  18. data/ext/pqcrypto/vendor/mldsa-native/mldsa/mldsa_native.c +85 -59
  19. data/ext/pqcrypto/vendor/mldsa-native/mldsa/mldsa_native.h +292 -348
  20. data/ext/pqcrypto/vendor/mldsa-native/mldsa/mldsa_native_asm.S +122 -76
  21. data/ext/pqcrypto/vendor/mldsa-native/mldsa/mldsa_native_config.h +184 -86
  22. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/cbmc.h +49 -4
  23. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/common.h +49 -81
  24. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/context.h +152 -0
  25. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/ct.h +25 -12
  26. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/debug.c +2 -0
  27. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/debug.h +2 -0
  28. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/fips202x4.c +2 -2
  29. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/keccakf1600.c +9 -11
  30. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/aarch64/auto.h +19 -11
  31. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/aarch64/src/keccak_f1600_x1_scalar_aarch64_asm.S +6 -4
  32. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/aarch64/src/keccak_f1600_x1_v84a_aarch64_asm.S +7 -4
  33. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/aarch64/src/keccak_f1600_x2_v84a_aarch64_asm.S +7 -4
  34. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/aarch64/src/keccak_f1600_x4_v8a_scalar_hybrid_aarch64_asm.S +12 -9
  35. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/aarch64/src/keccak_f1600_x4_v8a_v84a_scalar_hybrid_aarch64_asm.S +12 -9
  36. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/aarch64/x1_scalar.h +1 -1
  37. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/aarch64/x1_v84a.h +3 -2
  38. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/aarch64/x2_v84a.h +3 -2
  39. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/aarch64/x4_v8a_scalar.h +6 -1
  40. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/aarch64/x4_v8a_v84a_scalar.h +3 -2
  41. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/api.h +11 -11
  42. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/armv81m/mve.h +9 -22
  43. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/armv81m/src/keccak_f1600_x4_mve.S +8 -5
  44. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/armv81m/src/keccak_f1600_x4_mve.c +1 -0
  45. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/armv81m/src/{state_extract_bytes_x4_mve.S → keccak_f1600_x4_state_extract_bytes_mve.S} +14 -14
  46. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/armv81m/src/{state_xor_bytes_x4_mve.S → keccak_f1600_x4_state_xor_bytes_mve.S} +12 -12
  47. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/auto.h +5 -4
  48. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/x86_64/keccak_f1600_x4_avx2.h +2 -2
  49. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/x86_64/src/fips202_native_x86_64.h +1 -0
  50. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/x86_64/src/keccak_f1600_x4_avx2_asm.S +36 -2
  51. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/meta.h +62 -4
  52. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/arith_native_aarch64.h +87 -54
  53. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/{intt_aarch64_asm.S → mldsa_intt_aarch64_asm.S} +39 -6
  54. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/{ntt_aarch64_asm.S → mldsa_ntt_aarch64_asm.S} +39 -6
  55. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/{pointwise_montgomery_aarch64_asm.S → mldsa_pointwise_montgomery_aarch64_asm.S} +25 -3
  56. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/{poly_caddq_aarch64_asm.S → mldsa_poly_caddq_aarch64_asm.S} +19 -3
  57. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/{poly_chknorm_aarch64_asm.S → mldsa_poly_chknorm_aarch64_asm.S} +24 -3
  58. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/{poly_decompose_32_aarch64_asm.S → mldsa_poly_decompose_32_aarch64_asm.S} +25 -3
  59. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/{poly_decompose_88_aarch64_asm.S → mldsa_poly_decompose_88_aarch64_asm.S} +25 -3
  60. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/{poly_use_hint_32_aarch64_asm.S → mldsa_poly_use_hint_32_aarch64_asm.S} +25 -3
  61. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/{poly_use_hint_88_aarch64_asm.S → mldsa_poly_use_hint_88_aarch64_asm.S} +25 -3
  62. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/{mld_polyvecl_pointwise_acc_montgomery_l4_aarch64_asm.S → mldsa_polyvecl_pointwise_acc_montgomery_l4_aarch64_asm.S} +31 -3
  63. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/{mld_polyvecl_pointwise_acc_montgomery_l5_aarch64_asm.S → mldsa_polyvecl_pointwise_acc_montgomery_l5_aarch64_asm.S} +31 -3
  64. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/{mld_polyvecl_pointwise_acc_montgomery_l7_aarch64_asm.S → mldsa_polyvecl_pointwise_acc_montgomery_l7_aarch64_asm.S} +31 -3
  65. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/{polyz_unpack_17_aarch64_asm.S → mldsa_polyz_unpack_17_aarch64_asm.S} +31 -3
  66. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/{polyz_unpack_19_aarch64_asm.S → mldsa_polyz_unpack_19_aarch64_asm.S} +31 -3
  67. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/{rej_uniform_aarch64_asm.S → mldsa_rej_uniform_aarch64_asm.S} +48 -15
  68. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/{rej_uniform_eta2_aarch64_asm.S → mldsa_rej_uniform_eta2_aarch64_asm.S} +42 -9
  69. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/{rej_uniform_eta4_aarch64_asm.S → mldsa_rej_uniform_eta4_aarch64_asm.S} +42 -9
  70. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/api.h +11 -3
  71. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/meta.h +3 -2
  72. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/meta.h +28 -28
  73. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/arith_native_x86_64.h +171 -49
  74. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/{intt_avx2_asm.S → mldsa_intt_avx2_asm.S} +23 -1
  75. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/{ntt_avx2_asm.S → mldsa_ntt_avx2_asm.S} +23 -1
  76. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/{nttunpack_avx2_asm.S → mldsa_nttunpack_avx2_asm.S} +17 -1
  77. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/{pointwise_acc_l4_avx2_asm.S → mldsa_pointwise_acc_l4_avx2_asm.S} +37 -3
  78. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/{pointwise_acc_l5_avx2_asm.S → mldsa_pointwise_acc_l5_avx2_asm.S} +37 -3
  79. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/{pointwise_acc_l7_avx2_asm.S → mldsa_pointwise_acc_l7_avx2_asm.S} +37 -3
  80. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/{pointwise_avx2_asm.S → mldsa_pointwise_avx2_asm.S} +31 -3
  81. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/{poly_caddq_avx2_asm.S → mldsa_poly_caddq_avx2_asm.S} +18 -9
  82. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/mldsa_poly_chknorm_avx2_asm.S +176 -0
  83. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/mldsa_poly_decompose_32_avx2_asm.S +490 -0
  84. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/mldsa_poly_decompose_88_avx2_asm.S +489 -0
  85. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/mldsa_poly_use_hint_32_avx2_asm.S +123 -0
  86. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/mldsa_poly_use_hint_88_avx2_asm.S +125 -0
  87. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/mldsa_polyz_unpack_17_avx2_asm.S +355 -0
  88. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/mldsa_polyz_unpack_19_avx2_asm.S +355 -0
  89. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/mldsa_rej_uniform_avx2_asm.S +132 -0
  90. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/mldsa_rej_uniform_eta2_avx2_asm.S +205 -0
  91. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/mldsa_rej_uniform_eta4_avx2_asm.S +176 -0
  92. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/packing.c +27 -36
  93. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/packing.h +42 -8
  94. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/params.h +93 -17
  95. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/poly.c +74 -15
  96. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/poly.h +97 -11
  97. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/poly_kl.c +7 -38
  98. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/poly_kl.h +49 -7
  99. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/polyvec.c +16 -17
  100. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/polyvec.h +26 -9
  101. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/polyvec_lazy.c +3 -0
  102. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/polyvec_lazy.h +18 -19
  103. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/reduce.h +15 -3
  104. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/rounding.h +28 -6
  105. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/sign.c +311 -246
  106. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/sign.h +245 -240
  107. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/sys.h +64 -5
  108. data/ext/pqcrypto/vendor/mlkem-native/BUILDING.md +5 -2
  109. data/ext/pqcrypto/vendor/mlkem-native/LICENSE +21 -3
  110. data/ext/pqcrypto/vendor/mlkem-native/README.md +4 -6
  111. data/ext/pqcrypto/vendor/mlkem-native/RELEASE.md +211 -0
  112. data/ext/pqcrypto/vendor/mlkem-native/mlkem/README.md +2 -2
  113. data/ext/pqcrypto/vendor/mlkem-native/mlkem/mlkem_native.c +25 -34
  114. data/ext/pqcrypto/vendor/mlkem-native/mlkem/mlkem_native.h +79 -142
  115. data/ext/pqcrypto/vendor/mlkem-native/mlkem/mlkem_native_asm.S +62 -71
  116. data/ext/pqcrypto/vendor/mlkem-native/mlkem/mlkem_native_config.h +77 -39
  117. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/cbmc.h +25 -0
  118. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/common.h +48 -34
  119. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/compress.c +25 -5
  120. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/compress.h +14 -0
  121. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/context.h +51 -0
  122. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/fips202.h +2 -2
  123. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/keccakf1600.c +8 -8
  124. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/aarch64/auto.h +20 -12
  125. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/aarch64/src/keccak_f1600_x1_scalar_aarch64_asm.S +5 -3
  126. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/aarch64/src/keccak_f1600_x1_v84a_aarch64_asm.S +5 -2
  127. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/aarch64/src/keccak_f1600_x2_v84a_aarch64_asm.S +5 -2
  128. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/aarch64/src/keccak_f1600_x4_v8a_scalar_hybrid_aarch64_asm.S +10 -7
  129. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/aarch64/src/keccak_f1600_x4_v8a_v84a_scalar_hybrid_aarch64_asm.S +10 -7
  130. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/aarch64/x1_scalar.h +1 -1
  131. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/aarch64/x1_v84a.h +3 -2
  132. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/aarch64/x2_v84a.h +3 -2
  133. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/aarch64/x4_v8a_scalar.h +6 -1
  134. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/aarch64/x4_v8a_v84a_scalar.h +3 -2
  135. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/api.h +11 -11
  136. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/armv81m/mve.h +8 -22
  137. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/armv81m/src/keccak_f1600_x4_mve.S +8 -5
  138. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/armv81m/src/{state_extract_bytes_x4_mve.S → keccak_f1600_x4_state_extract_bytes_mve.S} +14 -14
  139. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/armv81m/src/{state_xor_bytes_x4_mve.S → keccak_f1600_x4_state_xor_bytes_mve.S} +12 -12
  140. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/x86_64/keccak_f1600_x4_avx2.h +2 -2
  141. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/x86_64/src/keccak_f1600_x4_avx2_asm.S +36 -2
  142. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/indcpa.c +22 -0
  143. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/indcpa.h +20 -11
  144. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/kem.c +39 -11
  145. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/kem.h +64 -15
  146. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/meta.h +44 -2
  147. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/aarch64_zetas.c +2 -0
  148. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/arith_native_aarch64.h +11 -10
  149. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/{intt_aarch64_asm.S → mlkem_intt_aarch64_asm.S} +16 -9
  150. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/{ntt_aarch64_asm.S → mlkem_ntt_aarch64_asm.S} +10 -7
  151. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/{poly_mulcache_compute_aarch64_asm.S → mlkem_poly_mulcache_compute_aarch64_asm.S} +6 -3
  152. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/{poly_reduce_aarch64_asm.S → mlkem_poly_reduce_aarch64_asm.S} +6 -3
  153. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/{poly_tobytes_aarch64_asm.S → mlkem_poly_tobytes_aarch64_asm.S} +12 -5
  154. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/{poly_tomont_aarch64_asm.S → mlkem_poly_tomont_aarch64_asm.S} +11 -5
  155. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/{polyvec_basemul_acc_montgomery_cached_k2_aarch64_asm.S → mlkem_polyvec_basemul_acc_montgomery_cached_k2_aarch64_asm.S} +6 -3
  156. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/{polyvec_basemul_acc_montgomery_cached_k3_aarch64_asm.S → mlkem_polyvec_basemul_acc_montgomery_cached_k3_aarch64_asm.S} +6 -3
  157. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/{polyvec_basemul_acc_montgomery_cached_k4_aarch64_asm.S → mlkem_polyvec_basemul_acc_montgomery_cached_k4_aarch64_asm.S} +6 -3
  158. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/{rej_uniform_aarch64_asm.S → mlkem_rej_uniform_aarch64_asm.S} +17 -17
  159. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/api.h +21 -8
  160. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/meta.h +1 -1
  161. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/ppc64le/meta.h +4 -0
  162. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/ppc64le/src/{intt_ppc_asm.S → mlkem_intt_ppc_asm.S} +29 -5
  163. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/ppc64le/src/{ntt_ppc_asm.S → mlkem_ntt_ppc_asm.S} +22 -1
  164. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/ppc64le/src/{poly_tomont_ppc_asm.S → mlkem_poly_tomont_ppc_asm.S} +25 -3
  165. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/ppc64le/src/{reduce_ppc_asm.S → mlkem_reduce_ppc_asm.S} +22 -1
  166. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/riscv64/meta.h +4 -0
  167. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/riscv64/src/arith_native_riscv64.h +4 -0
  168. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/riscv64/src/rv64v_poly.c +6 -2
  169. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/meta.h +45 -25
  170. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/arith_native_x86_64.h +20 -20
  171. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/compress_consts.c +14 -3
  172. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/compress_consts.h +8 -0
  173. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/{intt_avx2_asm.S → mlkem_intt_avx2_asm.S} +27 -3
  174. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/{ntt_avx2_asm.S → mlkem_ntt_avx2_asm.S} +23 -1
  175. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/{nttfrombytes_avx2_asm.S → mlkem_nttfrombytes_avx2_asm.S} +27 -3
  176. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/{ntttobytes_avx2_asm.S → mlkem_ntttobytes_avx2_asm.S} +27 -3
  177. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/{nttunpack_avx2_asm.S → mlkem_nttunpack_avx2_asm.S} +17 -1
  178. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/{poly_compress_d10_avx2_asm.S → mlkem_poly_compress_d10_avx2_asm.S} +34 -3
  179. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/{poly_compress_d11_avx2_asm.S → mlkem_poly_compress_d11_avx2_asm.S} +33 -2
  180. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/{poly_compress_d4_avx2_asm.S → mlkem_poly_compress_d4_avx2_asm.S} +34 -3
  181. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/{poly_compress_d5_avx2_asm.S → mlkem_poly_compress_d5_avx2_asm.S} +33 -2
  182. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/{poly_decompress_d10_avx2_asm.S → mlkem_poly_decompress_d10_avx2_asm.S} +32 -3
  183. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/{poly_decompress_d11_avx2_asm.S → mlkem_poly_decompress_d11_avx2_asm.S} +32 -2
  184. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/{poly_decompress_d4_avx2_asm.S → mlkem_poly_decompress_d4_avx2_asm.S} +32 -3
  185. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/{poly_decompress_d5_avx2_asm.S → mlkem_poly_decompress_d5_avx2_asm.S} +32 -2
  186. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/{poly_mulcache_compute_avx2_asm.S → mlkem_poly_mulcache_compute_avx2_asm.S} +29 -1
  187. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/{polyvec_basemul_acc_montgomery_cached_k2_avx2_asm.S → mlkem_polyvec_basemul_acc_montgomery_cached_k2_avx2_asm.S} +35 -1
  188. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/{polyvec_basemul_acc_montgomery_cached_k3_avx2_asm.S → mlkem_polyvec_basemul_acc_montgomery_cached_k3_avx2_asm.S} +35 -1
  189. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/{polyvec_basemul_acc_montgomery_cached_k4_avx2_asm.S → mlkem_polyvec_basemul_acc_montgomery_cached_k4_avx2_asm.S} +35 -1
  190. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/{reduce_avx2_asm.S → mlkem_reduce_avx2_asm.S} +17 -1
  191. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/{rej_uniform_avx2_asm.S → mlkem_rej_uniform_avx2_asm.S} +40 -7
  192. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/{tomont_avx2_asm.S → mlkem_tomont_avx2_asm.S} +20 -3
  193. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/poly.c +7 -2
  194. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/poly.h +6 -0
  195. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/poly_k.c +25 -4
  196. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/poly_k.h +33 -4
  197. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/sampling.c +4 -0
  198. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/sampling.h +4 -0
  199. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/sys.h +21 -3
  200. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/verify.h +11 -10
  201. data/lib/pq_crypto/version.rb +1 -1
  202. data/script/vendor_libs.rb +6 -6
  203. metadata +79 -79
  204. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/poly_chknorm_avx2.c +0 -52
  205. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/poly_decompose_32_avx2.c +0 -157
  206. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/poly_decompose_88_avx2.c +0 -157
  207. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/poly_use_hint_32_avx2.c +0 -103
  208. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/poly_use_hint_88_avx2.c +0 -105
  209. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/polyz_unpack_17_avx2.c +0 -94
  210. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/polyz_unpack_19_avx2.c +0 -96
  211. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/rej_uniform_avx2.c +0 -126
  212. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/rej_uniform_eta2_avx2.c +0 -157
  213. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/rej_uniform_eta4_avx2.c +0 -141
@@ -27,10 +27,32 @@
27
27
  #include "../../../common.h"
28
28
  #if defined(MLK_ARITH_BACKEND_X86_64_DEFAULT) && \
29
29
  !defined(MLK_CONFIG_MULTILEVEL_NO_SHARED)
30
+ /*yaml
31
+ Name: ntt_avx2_asm
32
+ Description: x86_64 AVX2 forward NTT
33
+ Signature: void mlk_ntt_avx2_asm(int16_t *r, const int16_t *qdata)
34
+ ABI:
35
+ Architecture: x86_64
36
+ CallingConvention: SysV
37
+ Features: [AVX2]
38
+ rdi:
39
+ type: buffer
40
+ size_bytes: 512
41
+ permissions: read/write
42
+ c_parameter: int16_t *r
43
+ description: Input/output polynomial (256 x int16_t)
44
+ rsi:
45
+ type: buffer
46
+ size_bytes: 1248
47
+ permissions: read-only
48
+ c_parameter: const int16_t *qdata
49
+ description: Precomputed constants (624 x int16_t)
50
+ */
51
+
30
52
 
31
53
  /*
32
54
  * WARNING: This file is auto-derived from the mlkem-native source file
33
- * dev/x86_64/src/ntt_avx2_asm.S using scripts/simpasm. Do not modify it directly.
55
+ * dev/x86_64/src/mlkem_ntt_avx2_asm.S using scripts/simpasm. Do not modify it directly.
34
56
  */
35
57
 
36
58
  .text
@@ -20,11 +20,35 @@
20
20
  #include "../../../common.h"
21
21
 
22
22
  #if defined(MLK_ARITH_BACKEND_X86_64_DEFAULT) && \
23
- !defined(MLK_CONFIG_MULTILEVEL_NO_SHARED)
23
+ !defined(MLK_CONFIG_MULTILEVEL_NO_SHARED) && \
24
+ (!defined(MLK_CONFIG_NO_ENCAPS_API) || \
25
+ !defined(MLK_CONFIG_NO_DECAPS_API))
26
+ /*yaml
27
+ Name: nttfrombytes_avx2_asm
28
+ Description: x86_64 AVX2 polynomial deserialization in NTT domain
29
+ Signature: void mlk_nttfrombytes_avx2_asm(int16_t *r, const uint8_t *a)
30
+ ABI:
31
+ Architecture: x86_64
32
+ CallingConvention: SysV
33
+ Features: [AVX2]
34
+ rdi:
35
+ type: buffer
36
+ size_bytes: 512
37
+ permissions: write-only
38
+ c_parameter: int16_t *r
39
+ description: Output polynomial (256 x int16_t)
40
+ rsi:
41
+ type: buffer
42
+ size_bytes: 384
43
+ permissions: read-only
44
+ c_parameter: const uint8_t *a
45
+ description: Input byte array (MLKEM_POLYBYTES = 384)
46
+ */
47
+
24
48
 
25
49
  /*
26
50
  * WARNING: This file is auto-derived from the mlkem-native source file
27
- * dev/x86_64/src/nttfrombytes_avx2_asm.S using scripts/simpasm. Do not modify it directly.
51
+ * dev/x86_64/src/mlkem_nttfrombytes_avx2_asm.S using scripts/simpasm. Do not modify it directly.
28
52
  */
29
53
 
30
54
  .text
@@ -186,7 +210,7 @@ MLK_ASM_FN_SYMBOL(nttfrombytes_avx2_asm)
186
210
  MLK_ASM_FN_SIZE(nttfrombytes_avx2_asm)
187
211
 
188
212
  #endif /* MLK_ARITH_BACKEND_X86_64_DEFAULT && !MLK_CONFIG_MULTILEVEL_NO_SHARED \
189
- */
213
+ && (!MLK_CONFIG_NO_ENCAPS_API || !MLK_CONFIG_NO_DECAPS_API) */
190
214
 
191
215
  #if defined(__ELF__)
192
216
  .section .note.GNU-stack,"",%progbits
@@ -20,11 +20,35 @@
20
20
  #include "../../../common.h"
21
21
 
22
22
  #if defined(MLK_ARITH_BACKEND_X86_64_DEFAULT) && \
23
- !defined(MLK_CONFIG_MULTILEVEL_NO_SHARED)
23
+ !defined(MLK_CONFIG_MULTILEVEL_NO_SHARED) && \
24
+ (!defined(MLK_CONFIG_NO_KEYPAIR_API) || \
25
+ !defined(MLK_CONFIG_NO_ENCAPS_API))
26
+ /*yaml
27
+ Name: ntttobytes_avx2_asm
28
+ Description: x86_64 AVX2 polynomial serialization in NTT domain
29
+ Signature: void mlk_ntttobytes_avx2_asm(uint8_t *r, const int16_t *a)
30
+ ABI:
31
+ Architecture: x86_64
32
+ CallingConvention: SysV
33
+ Features: [AVX2]
34
+ rdi:
35
+ type: buffer
36
+ size_bytes: 384
37
+ permissions: write-only
38
+ c_parameter: uint8_t *r
39
+ description: Output byte array (MLKEM_POLYBYTES = 384)
40
+ rsi:
41
+ type: buffer
42
+ size_bytes: 512
43
+ permissions: read-only
44
+ c_parameter: const int16_t *a
45
+ description: Input polynomial (256 x int16_t)
46
+ */
47
+
24
48
 
25
49
  /*
26
50
  * WARNING: This file is auto-derived from the mlkem-native source file
27
- * dev/x86_64/src/ntttobytes_avx2_asm.S using scripts/simpasm. Do not modify it directly.
51
+ * dev/x86_64/src/mlkem_ntttobytes_avx2_asm.S using scripts/simpasm. Do not modify it directly.
28
52
  */
29
53
 
30
54
  .text
@@ -174,7 +198,7 @@ MLK_ASM_FN_SYMBOL(ntttobytes_avx2_asm)
174
198
  MLK_ASM_FN_SIZE(ntttobytes_avx2_asm)
175
199
 
176
200
  #endif /* MLK_ARITH_BACKEND_X86_64_DEFAULT && !MLK_CONFIG_MULTILEVEL_NO_SHARED \
177
- */
201
+ && (!MLK_CONFIG_NO_KEYPAIR_API || !MLK_CONFIG_NO_ENCAPS_API) */
178
202
 
179
203
  #if defined(__ELF__)
180
204
  .section .note.GNU-stack,"",%progbits
@@ -21,10 +21,26 @@
21
21
 
22
22
  #if defined(MLK_ARITH_BACKEND_X86_64_DEFAULT) && \
23
23
  !defined(MLK_CONFIG_MULTILEVEL_NO_SHARED)
24
+ /*yaml
25
+ Name: nttunpack_avx2_asm
26
+ Description: x86_64 AVX2 NTT unpack from custom to bitreversed order
27
+ Signature: void mlk_nttunpack_avx2_asm(int16_t *r)
28
+ ABI:
29
+ Architecture: x86_64
30
+ CallingConvention: SysV
31
+ Features: [AVX2]
32
+ rdi:
33
+ type: buffer
34
+ size_bytes: 512
35
+ permissions: read/write
36
+ c_parameter: int16_t *r
37
+ description: Input/output polynomial (256 x int16_t)
38
+ */
39
+
24
40
 
25
41
  /*
26
42
  * WARNING: This file is auto-derived from the mlkem-native source file
27
- * dev/x86_64/src/nttunpack_avx2_asm.S using scripts/simpasm. Do not modify it directly.
43
+ * dev/x86_64/src/mlkem_nttunpack_avx2_asm.S using scripts/simpasm. Do not modify it directly.
28
44
  */
29
45
 
30
46
  .text
@@ -31,11 +31,41 @@
31
31
  #include "../../../common.h"
32
32
  #if defined(MLK_ARITH_BACKEND_X86_64_DEFAULT) && \
33
33
  !defined(MLK_CONFIG_MULTILEVEL_NO_SHARED) && \
34
+ (!defined(MLK_CONFIG_NO_ENCAPS_API) || \
35
+ !defined(MLK_CONFIG_NO_DECAPS_API)) && \
34
36
  (defined(MLK_CONFIG_MULTILEVEL_WITH_SHARED) || MLKEM_K == 2 || MLKEM_K == 3)
37
+ /*yaml
38
+ Name: poly_compress_d10_avx2_asm
39
+ Description: x86_64 AVX2 polynomial compression (d=10)
40
+ Signature: void mlk_poly_compress_d10_avx2_asm(uint8_t *r, const int16_t *a, const uint8_t *data)
41
+ ABI:
42
+ Architecture: x86_64
43
+ CallingConvention: SysV
44
+ Features: [AVX2]
45
+ rdi:
46
+ type: buffer
47
+ size_bytes: 320
48
+ permissions: write-only
49
+ c_parameter: uint8_t *r
50
+ description: Output compressed polynomial
51
+ rsi:
52
+ type: buffer
53
+ size_bytes: 512
54
+ permissions: read-only
55
+ c_parameter: const int16_t *a
56
+ description: Input polynomial (256 x int16_t)
57
+ rdx:
58
+ type: buffer
59
+ size_bytes: 32
60
+ permissions: read-only
61
+ c_parameter: const uint8_t *data
62
+ description: Precomputed compression constants
63
+ */
64
+
35
65
 
36
66
  /*
37
67
  * WARNING: This file is auto-derived from the mlkem-native source file
38
- * dev/x86_64/src/poly_compress_d10_avx2_asm.S using scripts/simpasm. Do not modify it directly.
68
+ * dev/x86_64/src/mlkem_poly_compress_d10_avx2_asm.S using scripts/simpasm. Do not modify it directly.
39
69
  */
40
70
 
41
71
  .text
@@ -374,8 +404,9 @@ MLK_ASM_FN_SYMBOL(poly_compress_d10_avx2_asm)
374
404
  MLK_ASM_FN_SIZE(poly_compress_d10_avx2_asm)
375
405
 
376
406
  #endif /* MLK_ARITH_BACKEND_X86_64_DEFAULT && !MLK_CONFIG_MULTILEVEL_NO_SHARED \
377
- && (MLK_CONFIG_MULTILEVEL_WITH_SHARED || MLKEM_K == 2 || MLKEM_K == \
378
- 3) */
407
+ && (!MLK_CONFIG_NO_ENCAPS_API || !MLK_CONFIG_NO_DECAPS_API) && \
408
+ (MLK_CONFIG_MULTILEVEL_WITH_SHARED || MLKEM_K == 2 || MLKEM_K == 3) \
409
+ */
379
410
 
380
411
  #if defined(__ELF__)
381
412
  .section .note.GNU-stack,"",%progbits
@@ -33,11 +33,41 @@
33
33
 
34
34
  #if defined(MLK_ARITH_BACKEND_X86_64_DEFAULT) && \
35
35
  !defined(MLK_CONFIG_MULTILEVEL_NO_SHARED) && \
36
+ (!defined(MLK_CONFIG_NO_ENCAPS_API) || \
37
+ !defined(MLK_CONFIG_NO_DECAPS_API)) && \
36
38
  (defined(MLK_CONFIG_MULTILEVEL_WITH_SHARED) || MLKEM_K == 4)
39
+ /*yaml
40
+ Name: poly_compress_d11_avx2_asm
41
+ Description: x86_64 AVX2 polynomial compression (d=11)
42
+ Signature: void mlk_poly_compress_d11_avx2_asm(uint8_t *r, const int16_t *a, const uint8_t *data)
43
+ ABI:
44
+ Architecture: x86_64
45
+ CallingConvention: SysV
46
+ Features: [AVX2]
47
+ rdi:
48
+ type: buffer
49
+ size_bytes: 352
50
+ permissions: write-only
51
+ c_parameter: uint8_t *r
52
+ description: Output compressed polynomial
53
+ rsi:
54
+ type: buffer
55
+ size_bytes: 512
56
+ permissions: read-only
57
+ c_parameter: const int16_t *a
58
+ description: Input polynomial (256 x int16_t)
59
+ rdx:
60
+ type: buffer
61
+ size_bytes: 64
62
+ permissions: read-only
63
+ c_parameter: const uint8_t *data
64
+ description: Precomputed compression constants
65
+ */
66
+
37
67
 
38
68
  /*
39
69
  * WARNING: This file is auto-derived from the mlkem-native source file
40
- * dev/x86_64/src/poly_compress_d11_avx2_asm.S using scripts/simpasm. Do not modify it directly.
70
+ * dev/x86_64/src/mlkem_poly_compress_d11_avx2_asm.S using scripts/simpasm. Do not modify it directly.
41
71
  */
42
72
 
43
73
  .text
@@ -441,7 +471,8 @@ MLK_ASM_FN_SYMBOL(poly_compress_d11_avx2_asm)
441
471
  MLK_ASM_FN_SIZE(poly_compress_d11_avx2_asm)
442
472
 
443
473
  #endif /* MLK_ARITH_BACKEND_X86_64_DEFAULT && !MLK_CONFIG_MULTILEVEL_NO_SHARED \
444
- && (MLK_CONFIG_MULTILEVEL_WITH_SHARED || MLKEM_K == 4) */
474
+ && (!MLK_CONFIG_NO_ENCAPS_API || !MLK_CONFIG_NO_DECAPS_API) && \
475
+ (MLK_CONFIG_MULTILEVEL_WITH_SHARED || MLKEM_K == 4) */
445
476
 
446
477
  #if defined(__ELF__)
447
478
  .section .note.GNU-stack,"",%progbits
@@ -31,11 +31,41 @@
31
31
  #include "../../../common.h"
32
32
  #if defined(MLK_ARITH_BACKEND_X86_64_DEFAULT) && \
33
33
  !defined(MLK_CONFIG_MULTILEVEL_NO_SHARED) && \
34
+ (!defined(MLK_CONFIG_NO_ENCAPS_API) || \
35
+ !defined(MLK_CONFIG_NO_DECAPS_API)) && \
34
36
  (defined(MLK_CONFIG_MULTILEVEL_WITH_SHARED) || MLKEM_K == 2 || MLKEM_K == 3)
37
+ /*yaml
38
+ Name: poly_compress_d4_avx2_asm
39
+ Description: x86_64 AVX2 polynomial compression (d=4)
40
+ Signature: void mlk_poly_compress_d4_avx2_asm(uint8_t *r, const int16_t *a, const uint8_t *data)
41
+ ABI:
42
+ Architecture: x86_64
43
+ CallingConvention: SysV
44
+ Features: [AVX2]
45
+ rdi:
46
+ type: buffer
47
+ size_bytes: 128
48
+ permissions: write-only
49
+ c_parameter: uint8_t *r
50
+ description: Output compressed polynomial
51
+ rsi:
52
+ type: buffer
53
+ size_bytes: 512
54
+ permissions: read-only
55
+ c_parameter: const int16_t *a
56
+ description: Input polynomial (256 x int16_t)
57
+ rdx:
58
+ type: buffer
59
+ size_bytes: 32
60
+ permissions: read-only
61
+ c_parameter: const uint8_t *data
62
+ description: Precomputed compression constants
63
+ */
64
+
35
65
 
36
66
  /*
37
67
  * WARNING: This file is auto-derived from the mlkem-native source file
38
- * dev/x86_64/src/poly_compress_d4_avx2_asm.S using scripts/simpasm. Do not modify it directly.
68
+ * dev/x86_64/src/mlkem_poly_compress_d4_avx2_asm.S using scripts/simpasm. Do not modify it directly.
39
69
  */
40
70
 
41
71
  .text
@@ -155,8 +185,9 @@ MLK_ASM_FN_SYMBOL(poly_compress_d4_avx2_asm)
155
185
  MLK_ASM_FN_SIZE(poly_compress_d4_avx2_asm)
156
186
 
157
187
  #endif /* MLK_ARITH_BACKEND_X86_64_DEFAULT && !MLK_CONFIG_MULTILEVEL_NO_SHARED \
158
- && (MLK_CONFIG_MULTILEVEL_WITH_SHARED || MLKEM_K == 2 || MLKEM_K == \
159
- 3) */
188
+ && (!MLK_CONFIG_NO_ENCAPS_API || !MLK_CONFIG_NO_DECAPS_API) && \
189
+ (MLK_CONFIG_MULTILEVEL_WITH_SHARED || MLKEM_K == 2 || MLKEM_K == 3) \
190
+ */
160
191
 
161
192
  #if defined(__ELF__)
162
193
  .section .note.GNU-stack,"",%progbits
@@ -31,11 +31,41 @@
31
31
  #include "../../../common.h"
32
32
  #if defined(MLK_ARITH_BACKEND_X86_64_DEFAULT) && \
33
33
  !defined(MLK_CONFIG_MULTILEVEL_NO_SHARED) && \
34
+ (!defined(MLK_CONFIG_NO_ENCAPS_API) || \
35
+ !defined(MLK_CONFIG_NO_DECAPS_API)) && \
34
36
  (defined(MLK_CONFIG_MULTILEVEL_WITH_SHARED) || MLKEM_K == 4)
37
+ /*yaml
38
+ Name: poly_compress_d5_avx2_asm
39
+ Description: x86_64 AVX2 polynomial compression (d=5)
40
+ Signature: void mlk_poly_compress_d5_avx2_asm(uint8_t *r, const int16_t *a, const uint8_t *data)
41
+ ABI:
42
+ Architecture: x86_64
43
+ CallingConvention: SysV
44
+ Features: [AVX2]
45
+ rdi:
46
+ type: buffer
47
+ size_bytes: 160
48
+ permissions: write-only
49
+ c_parameter: uint8_t *r
50
+ description: Output compressed polynomial
51
+ rsi:
52
+ type: buffer
53
+ size_bytes: 512
54
+ permissions: read-only
55
+ c_parameter: const int16_t *a
56
+ description: Input polynomial (256 x int16_t)
57
+ rdx:
58
+ type: buffer
59
+ size_bytes: 32
60
+ permissions: read-only
61
+ c_parameter: const uint8_t *data
62
+ description: Precomputed compression constants
63
+ */
64
+
35
65
 
36
66
  /*
37
67
  * WARNING: This file is auto-derived from the mlkem-native source file
38
- * dev/x86_64/src/poly_compress_d5_avx2_asm.S using scripts/simpasm. Do not modify it directly.
68
+ * dev/x86_64/src/mlkem_poly_compress_d5_avx2_asm.S using scripts/simpasm. Do not modify it directly.
39
69
  */
40
70
 
41
71
  .text
@@ -213,7 +243,8 @@ MLK_ASM_FN_SYMBOL(poly_compress_d5_avx2_asm)
213
243
  MLK_ASM_FN_SIZE(poly_compress_d5_avx2_asm)
214
244
 
215
245
  #endif /* MLK_ARITH_BACKEND_X86_64_DEFAULT && !MLK_CONFIG_MULTILEVEL_NO_SHARED \
216
- && (MLK_CONFIG_MULTILEVEL_WITH_SHARED || MLKEM_K == 4) */
246
+ && (!MLK_CONFIG_NO_ENCAPS_API || !MLK_CONFIG_NO_DECAPS_API) && \
247
+ (MLK_CONFIG_MULTILEVEL_WITH_SHARED || MLKEM_K == 4) */
217
248
 
218
249
  #if defined(__ELF__)
219
250
  .section .note.GNU-stack,"",%progbits
@@ -31,11 +31,40 @@
31
31
  #include "../../../common.h"
32
32
  #if defined(MLK_ARITH_BACKEND_X86_64_DEFAULT) && \
33
33
  !defined(MLK_CONFIG_MULTILEVEL_NO_SHARED) && \
34
+ !defined(MLK_CONFIG_NO_DECAPS_API) && \
34
35
  (defined(MLK_CONFIG_MULTILEVEL_WITH_SHARED) || MLKEM_K == 2 || MLKEM_K == 3)
36
+ /*yaml
37
+ Name: poly_decompress_d10_avx2_asm
38
+ Description: x86_64 AVX2 polynomial decompression (d=10)
39
+ Signature: void mlk_poly_decompress_d10_avx2_asm(int16_t *r, const uint8_t *a, const uint8_t *data)
40
+ ABI:
41
+ Architecture: x86_64
42
+ CallingConvention: SysV
43
+ Features: [AVX2]
44
+ rdi:
45
+ type: buffer
46
+ size_bytes: 512
47
+ permissions: write-only
48
+ c_parameter: int16_t *r
49
+ description: Output polynomial (256 x int16_t)
50
+ rsi:
51
+ type: buffer
52
+ size_bytes: 320
53
+ permissions: read-only
54
+ c_parameter: const uint8_t *a
55
+ description: Input compressed polynomial
56
+ rdx:
57
+ type: buffer
58
+ size_bytes: 32
59
+ permissions: read-only
60
+ c_parameter: const uint8_t *data
61
+ description: Precomputed decompression constants
62
+ */
63
+
35
64
 
36
65
  /*
37
66
  * WARNING: This file is auto-derived from the mlkem-native source file
38
- * dev/x86_64/src/poly_decompress_d10_avx2_asm.S using scripts/simpasm. Do not modify it directly.
67
+ * dev/x86_64/src/mlkem_poly_decompress_d10_avx2_asm.S using scripts/simpasm. Do not modify it directly.
39
68
  */
40
69
 
41
70
  .text
@@ -220,8 +249,8 @@ MLK_ASM_FN_SYMBOL(poly_decompress_d10_avx2_asm)
220
249
  MLK_ASM_FN_SIZE(poly_decompress_d10_avx2_asm)
221
250
 
222
251
  #endif /* MLK_ARITH_BACKEND_X86_64_DEFAULT && !MLK_CONFIG_MULTILEVEL_NO_SHARED \
223
- && (MLK_CONFIG_MULTILEVEL_WITH_SHARED || MLKEM_K == 2 || MLKEM_K == \
224
- 3) */
252
+ && !MLK_CONFIG_NO_DECAPS_API && (MLK_CONFIG_MULTILEVEL_WITH_SHARED || \
253
+ MLKEM_K == 2 || MLKEM_K == 3) */
225
254
 
226
255
  #if defined(__ELF__)
227
256
  .section .note.GNU-stack,"",%progbits
@@ -33,11 +33,40 @@
33
33
  #include "../../../common.h"
34
34
  #if defined(MLK_ARITH_BACKEND_X86_64_DEFAULT) && \
35
35
  !defined(MLK_CONFIG_MULTILEVEL_NO_SHARED) && \
36
+ !defined(MLK_CONFIG_NO_DECAPS_API) && \
36
37
  (defined(MLK_CONFIG_MULTILEVEL_WITH_SHARED) || MLKEM_K == 4)
38
+ /*yaml
39
+ Name: poly_decompress_d11_avx2_asm
40
+ Description: x86_64 AVX2 polynomial decompression (d=11)
41
+ Signature: void mlk_poly_decompress_d11_avx2_asm(int16_t *r, const uint8_t *a, const uint8_t *data)
42
+ ABI:
43
+ Architecture: x86_64
44
+ CallingConvention: SysV
45
+ Features: [AVX2]
46
+ rdi:
47
+ type: buffer
48
+ size_bytes: 512
49
+ permissions: write-only
50
+ c_parameter: int16_t *r
51
+ description: Output polynomial (256 x int16_t)
52
+ rsi:
53
+ type: buffer
54
+ size_bytes: 352
55
+ permissions: read-only
56
+ c_parameter: const uint8_t *a
57
+ description: Input compressed polynomial
58
+ rdx:
59
+ type: buffer
60
+ size_bytes: 128
61
+ permissions: read-only
62
+ c_parameter: const uint8_t *data
63
+ description: Precomputed decompression constants
64
+ */
65
+
37
66
 
38
67
  /*
39
68
  * WARNING: This file is auto-derived from the mlkem-native source file
40
- * dev/x86_64/src/poly_decompress_d11_avx2_asm.S using scripts/simpasm. Do not modify it directly.
69
+ * dev/x86_64/src/mlkem_poly_decompress_d11_avx2_asm.S using scripts/simpasm. Do not modify it directly.
41
70
  */
42
71
 
43
72
  .text
@@ -270,7 +299,8 @@ MLK_ASM_FN_SYMBOL(poly_decompress_d11_avx2_asm)
270
299
  MLK_ASM_FN_SIZE(poly_decompress_d11_avx2_asm)
271
300
 
272
301
  #endif /* MLK_ARITH_BACKEND_X86_64_DEFAULT && !MLK_CONFIG_MULTILEVEL_NO_SHARED \
273
- && (MLK_CONFIG_MULTILEVEL_WITH_SHARED || MLKEM_K == 4) */
302
+ && !MLK_CONFIG_NO_DECAPS_API && (MLK_CONFIG_MULTILEVEL_WITH_SHARED || \
303
+ MLKEM_K == 4) */
274
304
 
275
305
  #if defined(__ELF__)
276
306
  .section .note.GNU-stack,"",%progbits
@@ -31,11 +31,40 @@
31
31
  #include "../../../common.h"
32
32
  #if defined(MLK_ARITH_BACKEND_X86_64_DEFAULT) && \
33
33
  !defined(MLK_CONFIG_MULTILEVEL_NO_SHARED) && \
34
+ !defined(MLK_CONFIG_NO_DECAPS_API) && \
34
35
  (defined(MLK_CONFIG_MULTILEVEL_WITH_SHARED) || MLKEM_K == 2 || MLKEM_K == 3)
36
+ /*yaml
37
+ Name: poly_decompress_d4_avx2_asm
38
+ Description: x86_64 AVX2 polynomial decompression (d=4)
39
+ Signature: void mlk_poly_decompress_d4_avx2_asm(int16_t *r, const uint8_t *a, const uint8_t *data)
40
+ ABI:
41
+ Architecture: x86_64
42
+ CallingConvention: SysV
43
+ Features: [AVX2]
44
+ rdi:
45
+ type: buffer
46
+ size_bytes: 512
47
+ permissions: write-only
48
+ c_parameter: int16_t *r
49
+ description: Output polynomial (256 x int16_t)
50
+ rsi:
51
+ type: buffer
52
+ size_bytes: 128
53
+ permissions: read-only
54
+ c_parameter: const uint8_t *a
55
+ description: Input compressed polynomial
56
+ rdx:
57
+ type: buffer
58
+ size_bytes: 32
59
+ permissions: read-only
60
+ c_parameter: const uint8_t *data
61
+ description: Precomputed decompression constants
62
+ */
63
+
35
64
 
36
65
  /*
37
66
  * WARNING: This file is auto-derived from the mlkem-native source file
38
- * dev/x86_64/src/poly_decompress_d4_avx2_asm.S using scripts/simpasm. Do not modify it directly.
67
+ * dev/x86_64/src/mlkem_poly_decompress_d4_avx2_asm.S using scripts/simpasm. Do not modify it directly.
39
68
  */
40
69
 
41
70
  .text
@@ -172,8 +201,8 @@ MLK_ASM_FN_SYMBOL(poly_decompress_d4_avx2_asm)
172
201
  MLK_ASM_FN_SIZE(poly_decompress_d4_avx2_asm)
173
202
 
174
203
  #endif /* MLK_ARITH_BACKEND_X86_64_DEFAULT && !MLK_CONFIG_MULTILEVEL_NO_SHARED \
175
- && (MLK_CONFIG_MULTILEVEL_WITH_SHARED || MLKEM_K == 2 || MLKEM_K == \
176
- 3) */
204
+ && !MLK_CONFIG_NO_DECAPS_API && (MLK_CONFIG_MULTILEVEL_WITH_SHARED || \
205
+ MLKEM_K == 2 || MLKEM_K == 3) */
177
206
 
178
207
  #if defined(__ELF__)
179
208
  .section .note.GNU-stack,"",%progbits
@@ -32,11 +32,40 @@
32
32
  #include "../../../common.h"
33
33
  #if defined(MLK_ARITH_BACKEND_X86_64_DEFAULT) && \
34
34
  !defined(MLK_CONFIG_MULTILEVEL_NO_SHARED) && \
35
+ !defined(MLK_CONFIG_NO_DECAPS_API) && \
35
36
  (defined(MLK_CONFIG_MULTILEVEL_WITH_SHARED) || MLKEM_K == 4)
37
+ /*yaml
38
+ Name: poly_decompress_d5_avx2_asm
39
+ Description: x86_64 AVX2 polynomial decompression (d=5)
40
+ Signature: void mlk_poly_decompress_d5_avx2_asm(int16_t *r, const uint8_t *a, const uint8_t *data)
41
+ ABI:
42
+ Architecture: x86_64
43
+ CallingConvention: SysV
44
+ Features: [AVX2]
45
+ rdi:
46
+ type: buffer
47
+ size_bytes: 512
48
+ permissions: write-only
49
+ c_parameter: int16_t *r
50
+ description: Output polynomial (256 x int16_t)
51
+ rsi:
52
+ type: buffer
53
+ size_bytes: 160
54
+ permissions: read-only
55
+ c_parameter: const uint8_t *a
56
+ description: Input compressed polynomial
57
+ rdx:
58
+ type: buffer
59
+ size_bytes: 96
60
+ permissions: read-only
61
+ c_parameter: const uint8_t *data
62
+ description: Precomputed decompression constants
63
+ */
64
+
36
65
 
37
66
  /*
38
67
  * WARNING: This file is auto-derived from the mlkem-native source file
39
- * dev/x86_64/src/poly_decompress_d5_avx2_asm.S using scripts/simpasm. Do not modify it directly.
68
+ * dev/x86_64/src/mlkem_poly_decompress_d5_avx2_asm.S using scripts/simpasm. Do not modify it directly.
40
69
  */
41
70
 
42
71
  .text
@@ -185,7 +214,8 @@ MLK_ASM_FN_SYMBOL(poly_decompress_d5_avx2_asm)
185
214
  MLK_ASM_FN_SIZE(poly_decompress_d5_avx2_asm)
186
215
 
187
216
  #endif /* MLK_ARITH_BACKEND_X86_64_DEFAULT && !MLK_CONFIG_MULTILEVEL_NO_SHARED \
188
- && (MLK_CONFIG_MULTILEVEL_WITH_SHARED || MLKEM_K == 4) */
217
+ && !MLK_CONFIG_NO_DECAPS_API && (MLK_CONFIG_MULTILEVEL_WITH_SHARED || \
218
+ MLKEM_K == 4) */
189
219
 
190
220
  #if defined(__ELF__)
191
221
  .section .note.GNU-stack,"",%progbits
@@ -6,10 +6,38 @@
6
6
  #include "../../../common.h"
7
7
  #if defined(MLK_ARITH_BACKEND_X86_64_DEFAULT) && \
8
8
  !defined(MLK_CONFIG_MULTILEVEL_NO_SHARED)
9
+ /*yaml
10
+ Name: poly_mulcache_compute_avx2_asm
11
+ Description: x86_64 AVX2 mulcache computation
12
+ Signature: void mlk_poly_mulcache_compute_avx2_asm(int16_t *out, const int16_t *in, const int16_t *qdata)
13
+ ABI:
14
+ Architecture: x86_64
15
+ CallingConvention: SysV
16
+ Features: [AVX2]
17
+ rdi:
18
+ type: buffer
19
+ size_bytes: 256
20
+ permissions: write-only
21
+ c_parameter: int16_t *out
22
+ description: Output mulcache (128 x int16_t)
23
+ rsi:
24
+ type: buffer
25
+ size_bytes: 512
26
+ permissions: read-only
27
+ c_parameter: const int16_t *in
28
+ description: Input polynomial (256 x int16_t)
29
+ rdx:
30
+ type: buffer
31
+ size_bytes: 1248
32
+ permissions: read-only
33
+ c_parameter: const int16_t *qdata
34
+ description: Precomputed constants (624 x int16_t)
35
+ */
36
+
9
37
 
10
38
  /*
11
39
  * WARNING: This file is auto-derived from the mlkem-native source file
12
- * dev/x86_64/src/poly_mulcache_compute_avx2_asm.S using scripts/simpasm. Do not modify it directly.
40
+ * dev/x86_64/src/mlkem_poly_mulcache_compute_avx2_asm.S using scripts/simpasm. Do not modify it directly.
13
41
  */
14
42
 
15
43
  .text
@@ -7,10 +7,44 @@
7
7
  #if defined(MLK_ARITH_BACKEND_X86_64_DEFAULT) && \
8
8
  !defined(MLK_CONFIG_MULTILEVEL_NO_SHARED) && \
9
9
  (defined(MLK_CONFIG_MULTILEVEL_WITH_SHARED) || MLKEM_K == 2)
10
+ /*yaml
11
+ Name: polyvec_basemul_acc_montgomery_cached_k2_avx2_asm
12
+ Description: x86_64 AVX2 base multiplication with accumulation (k=2)
13
+ Signature: void mlk_polyvec_basemul_acc_montgomery_cached_k2_avx2_asm(int16_t *r, const int16_t *a, const int16_t *b, const int16_t *b_cache)
14
+ ABI:
15
+ Architecture: x86_64
16
+ CallingConvention: SysV
17
+ Features: [AVX2]
18
+ rdi:
19
+ type: buffer
20
+ size_bytes: 512
21
+ permissions: read/write
22
+ c_parameter: int16_t *r
23
+ description: Output polynomial (256 x int16_t)
24
+ rsi:
25
+ type: buffer
26
+ size_bytes: 1024
27
+ permissions: read-only
28
+ c_parameter: const int16_t *a
29
+ description: Input polyvec a (2 x 256 x int16_t)
30
+ rdx:
31
+ type: buffer
32
+ size_bytes: 1024
33
+ permissions: read-only
34
+ c_parameter: const int16_t *b
35
+ description: Input polyvec b (2 x 256 x int16_t)
36
+ rcx:
37
+ type: buffer
38
+ size_bytes: 512
39
+ permissions: read-only
40
+ c_parameter: const int16_t *b_cache
41
+ description: Mulcache for b (2 x 128 x int16_t)
42
+ */
43
+
10
44
 
11
45
  /*
12
46
  * WARNING: This file is auto-derived from the mlkem-native source file
13
- * dev/x86_64/src/polyvec_basemul_acc_montgomery_cached_k2_avx2_asm.S using scripts/simpasm. Do not modify it directly.
47
+ * dev/x86_64/src/mlkem_polyvec_basemul_acc_montgomery_cached_k2_avx2_asm.S using scripts/simpasm. Do not modify it directly.
14
48
  */
15
49
 
16
50
  .text