pq_crypto 0.6.1 → 0.6.3

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 (247) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +10 -0
  3. data/SECURITY.md +7 -0
  4. data/ext/pqcrypto/pqcrypto_version.h +1 -1
  5. data/ext/pqcrypto/vendor/.vendored +7 -7
  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/ext/pqcrypto/vendor/mlkem-native/README.md +6 -3
  108. data/ext/pqcrypto/vendor/mlkem-native/RELEASE.md +22 -0
  109. data/ext/pqcrypto/vendor/mlkem-native/mlkem/mlkem_native.c +77 -36
  110. data/ext/pqcrypto/vendor/mlkem-native/mlkem/mlkem_native.h +135 -146
  111. data/ext/pqcrypto/vendor/mlkem-native/mlkem/mlkem_native_asm.S +116 -72
  112. data/ext/pqcrypto/vendor/mlkem-native/mlkem/mlkem_native_config.h +351 -415
  113. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/cbmc.h +43 -20
  114. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/common.h +16 -8
  115. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/compress.c +57 -31
  116. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/compress.h +260 -349
  117. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/debug.h +17 -24
  118. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/fips202.c +35 -37
  119. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/fips202.h +43 -57
  120. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/fips202x4.c +14 -15
  121. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/fips202x4.h +5 -4
  122. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/keccakf1600.c +42 -6
  123. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/aarch64/src/fips202_native_aarch64.h +31 -20
  124. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/aarch64/src/{keccak_f1600_x1_scalar_asm.S → keccak_f1600_x1_scalar_aarch64_asm.S} +10 -10
  125. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/aarch64/src/{keccak_f1600_x1_v84a_asm.S → keccak_f1600_x1_v84a_aarch64_asm.S} +10 -10
  126. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/aarch64/src/{keccak_f1600_x2_v84a_asm.S → keccak_f1600_x2_v84a_aarch64_asm.S} +10 -10
  127. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/aarch64/src/{keccak_f1600_x4_v8a_scalar_hybrid_asm.S → keccak_f1600_x4_v8a_scalar_hybrid_aarch64_asm.S} +10 -10
  128. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/aarch64/src/{keccak_f1600_x4_v8a_v84a_scalar_hybrid_asm.S → keccak_f1600_x4_v8a_v84a_scalar_hybrid_aarch64_asm.S} +10 -10
  129. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/aarch64/src/keccakf1600_round_constants.c +10 -9
  130. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/aarch64/x1_scalar.h +2 -1
  131. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/aarch64/x1_v84a.h +1 -1
  132. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/aarch64/x2_v84a.h +4 -2
  133. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/aarch64/x4_v8a_scalar.h +2 -2
  134. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/aarch64/x4_v8a_v84a_scalar.h +1 -1
  135. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/armv81m/src/fips202_native_armv81m.h +2 -1
  136. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/armv81m/src/keccak_f1600_x4_mve.S +55 -9
  137. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/armv81m/src/keccakf1600_round_constants.c +26 -25
  138. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/armv81m/src/state_extract_bytes_x4_mve.S +58 -14
  139. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/armv81m/src/state_xor_bytes_x4_mve.S +57 -16
  140. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/auto.h +2 -1
  141. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/x86_64/keccak_f1600_x4_avx2.h +2 -2
  142. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/x86_64/src/fips202_native_x86_64.h +10 -7
  143. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/x86_64/src/{keccak_f1600_x4_avx2.S → keccak_f1600_x4_avx2_asm.S} +13 -11
  144. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/x86_64/src/keccakf1600_constants.c +12 -11
  145. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/indcpa.c +167 -136
  146. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/indcpa.h +75 -68
  147. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/kem.h +135 -157
  148. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/meta.h +15 -13
  149. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/aarch64_zetas.c +143 -135
  150. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/arith_native_aarch64.h +52 -46
  151. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/{intt.S → intt_aarch64_asm.S} +10 -10
  152. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/{ntt.S → ntt_aarch64_asm.S} +10 -10
  153. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/{poly_mulcache_compute_asm.S → poly_mulcache_compute_aarch64_asm.S} +10 -10
  154. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/{poly_reduce_asm.S → poly_reduce_aarch64_asm.S} +10 -10
  155. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/{poly_tobytes_asm.S → poly_tobytes_aarch64_asm.S} +10 -10
  156. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/{poly_tomont_asm.S → poly_tomont_aarch64_asm.S} +10 -12
  157. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/{polyvec_basemul_acc_montgomery_cached_asm_k2.S → polyvec_basemul_acc_montgomery_cached_k2_aarch64_asm.S} +10 -10
  158. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/{polyvec_basemul_acc_montgomery_cached_asm_k3.S → polyvec_basemul_acc_montgomery_cached_k3_aarch64_asm.S} +10 -10
  159. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/{polyvec_basemul_acc_montgomery_cached_asm_k4.S → polyvec_basemul_acc_montgomery_cached_k4_aarch64_asm.S} +10 -10
  160. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/{rej_uniform_asm.S → rej_uniform_aarch64_asm.S} +12 -12
  161. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/rej_uniform_table.c +514 -513
  162. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/api.h +254 -253
  163. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/meta.h +6 -1
  164. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/ppc64le/README.md +6 -0
  165. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/ppc64le/meta.h +77 -0
  166. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/ppc64le/src/arith_native_ppc64le.h +24 -0
  167. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/ppc64le/src/consts.c +299 -0
  168. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/ppc64le/src/consts.h +34 -0
  169. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/ppc64le/src/intt_ppc_asm.S +3222 -0
  170. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/ppc64le/src/ntt_ppc_asm.S +1651 -0
  171. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/ppc64le/src/poly_tomont_ppc_asm.S +294 -0
  172. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/ppc64le/src/reduce_ppc_asm.S +710 -0
  173. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/riscv64/meta.h +5 -0
  174. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/riscv64/src/rv64v_debug.c +18 -16
  175. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/riscv64/src/rv64v_debug.h +19 -24
  176. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/riscv64/src/rv64v_poly.c +53 -65
  177. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/meta.h +20 -20
  178. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/arith_native_x86_64.h +106 -88
  179. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/compress_consts.c +45 -35
  180. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/compress_consts.h +8 -8
  181. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/consts.c +1 -1
  182. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/consts.h +1 -1
  183. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/{intt.S → intt_avx2_asm.S} +8 -8
  184. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/{ntt.S → ntt_avx2_asm.S} +8 -8
  185. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/{nttfrombytes.S → nttfrombytes_avx2_asm.S} +8 -8
  186. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/{ntttobytes.S → ntttobytes_avx2_asm.S} +8 -8
  187. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/{nttunpack.S → nttunpack_avx2_asm.S} +8 -8
  188. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/{poly_compress_d10.S → poly_compress_d10_avx2_asm.S} +9 -9
  189. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/{poly_compress_d11.S → poly_compress_d11_avx2_asm.S} +9 -9
  190. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/{poly_compress_d4.S → poly_compress_d4_avx2_asm.S} +9 -9
  191. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/{poly_compress_d5.S → poly_compress_d5_avx2_asm.S} +9 -9
  192. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/{poly_decompress_d10.S → poly_decompress_d10_avx2_asm.S} +9 -9
  193. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/{poly_decompress_d11.S → poly_decompress_d11_avx2_asm.S} +9 -9
  194. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/{poly_decompress_d4.S → poly_decompress_d4_avx2_asm.S} +9 -9
  195. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/{poly_decompress_d5.S → poly_decompress_d5_avx2_asm.S} +9 -9
  196. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/{mulcache_compute.S → poly_mulcache_compute_avx2_asm.S} +8 -8
  197. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/{polyvec_basemul_acc_montgomery_cached_asm_k2.S → polyvec_basemul_acc_montgomery_cached_k2_avx2_asm.S} +8 -8
  198. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/{polyvec_basemul_acc_montgomery_cached_asm_k3.S → polyvec_basemul_acc_montgomery_cached_k3_avx2_asm.S} +8 -8
  199. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/{polyvec_basemul_acc_montgomery_cached_asm_k4.S → polyvec_basemul_acc_montgomery_cached_k4_avx2_asm.S} +8 -8
  200. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/{reduce.S → reduce_avx2_asm.S} +8 -8
  201. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/{rej_uniform_asm.S → rej_uniform_avx2_asm.S} +9 -9
  202. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/rej_uniform_table.c +514 -513
  203. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/{tomont.S → tomont_avx2_asm.S} +8 -8
  204. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/poly.c +61 -57
  205. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/poly.h +89 -116
  206. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/poly_k.c +31 -32
  207. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/poly_k.h +226 -301
  208. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/randombytes.h +21 -29
  209. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/sampling.c +68 -63
  210. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/sampling.h +37 -48
  211. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/sys.h +44 -2
  212. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/verify.h +141 -159
  213. data/lib/pq_crypto/version.rb +1 -1
  214. data/script/vendor_libs.rb +6 -6
  215. metadata +86 -71
  216. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/aarch64/src/keccak_f1600_x1_scalar_asm.S +0 -376
  217. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/aarch64/src/keccak_f1600_x1_v84a_asm.S +0 -204
  218. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/aarch64/src/keccak_f1600_x2_v84a_asm.S +0 -259
  219. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/aarch64/src/keccak_f1600_x4_v8a_scalar_hybrid_asm.S +0 -1077
  220. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/aarch64/src/keccak_f1600_x4_v8a_v84a_scalar_hybrid_asm.S +0 -987
  221. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/x86_64/src/KeccakP_1600_times4_SIMD256.c +0 -488
  222. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/x86_64/src/KeccakP_1600_times4_SIMD256.h +0 -16
  223. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/intt.S +0 -753
  224. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/mld_polyvecl_pointwise_acc_montgomery_l4.S +0 -129
  225. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/mld_polyvecl_pointwise_acc_montgomery_l5.S +0 -145
  226. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/mld_polyvecl_pointwise_acc_montgomery_l7.S +0 -177
  227. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/ntt.S +0 -653
  228. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/pointwise_montgomery.S +0 -79
  229. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/poly_caddq_asm.S +0 -53
  230. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/poly_chknorm_asm.S +0 -55
  231. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/poly_decompose_32_asm.S +0 -85
  232. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/poly_decompose_88_asm.S +0 -85
  233. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/poly_use_hint_32_asm.S +0 -102
  234. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/poly_use_hint_88_asm.S +0 -110
  235. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/polyz_unpack_17_asm.S +0 -72
  236. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/polyz_unpack_19_asm.S +0 -69
  237. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/rej_uniform_asm.S +0 -189
  238. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/rej_uniform_eta2_asm.S +0 -135
  239. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/rej_uniform_eta4_asm.S +0 -128
  240. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/intt.S +0 -2311
  241. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/ntt.S +0 -2383
  242. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/nttunpack.S +0 -239
  243. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/pointwise.S +0 -131
  244. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/pointwise_acc_l4.S +0 -139
  245. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/pointwise_acc_l5.S +0 -155
  246. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/pointwise_acc_l7.S +0 -187
  247. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/poly_caddq_avx2.c +0 -61
@@ -20,7 +20,7 @@ All C code in [mlkem/src/*](mlkem) and [mlkem/src/fips202/*](mlkem/src/fips202)
20
20
  using CBMC[^CBMC]. All AArch64 and x86_64 assembly is proved to be functionally correct,
21
21
  memory-safe, and of secret-independent timing (constant-time), using HOL-Light[^HOL-Light].
22
22
 
23
- mlkem-native includes native backends for Arm (64-bit, Neon), Intel/AMD (64-bit, AVX2), and RISC-V (64-bit, RVV). See [benchmarks](https://pq-code-package.github.io/mlkem-native/dev/bench/) for performance data.
23
+ mlkem-native includes native backends for Arm (64-bit, Neon), Intel/AMD (64-bit, AVX2), RISC-V (64-bit, RVV), and POWER (ppc64le, VSX). See [benchmarks](https://pq-code-package.github.io/mlkem-native/dev/bench/) for performance data.
24
24
 
25
25
  mlkem-native is supported by the [Post-Quantum Cryptography Alliance](https://pqca.org/) as part of the [Linux Foundation](https://linuxfoundation.org/).
26
26
 
@@ -53,7 +53,7 @@ mlkem-native is used in
53
53
  - [libOQS](https://github.com/open-quantum-safe/liboqs/) of the Open Quantum Safe project since [0.13.0](https://github.com/open-quantum-safe/liboqs/releases/tag/0.13.0) (as the default ML-KEM implementation)
54
54
  - AWS' Cryptography library [AWS-LC](https://github.com/aws/aws-lc/) since [v1.50.0](https://github.com/aws/aws-lc/releases/tag/v1.50.0)
55
55
  - The [rustls](https://github.com/rustls/rustls) TLS library written in Rust since [0.23.28](https://github.com/rustls/rustls/releases/tag/v%2F0.23.28) (through AWS-LC as the default cryptography provider)
56
- - The [zeroRISC's fork of OpenTitan](https://github.com/zerorisc/expo) - an open source silicon Root of Trust (RoT)
56
+ - [Pavona](https://github.com/pavona/pavona) - a library of modular, tapeout-proven, and secure-by-default open silicon blocks
57
57
 
58
58
  ## Formal Verification
59
59
 
@@ -80,6 +80,8 @@ through suitable barriers and constant-time patterns.
80
80
  Absence of secret-dependent branches, memory-access patterns and variable-latency instructions is also tested using `valgrind`
81
81
  with various combinations of compilers and compilation options.
82
82
 
83
+ **Other attacks.** mlkem-native targets resistance against timing side-channels only. Other attack classes, such as power and electromagnetic side-channels, microarchitectural side-channels (e.g. speculative execution), or fault-injection attacks, are currently out of scope.
84
+
83
85
  ## Design
84
86
 
85
87
  mlkem-native is split into a _frontend_ and two _backends_ for arithmetic and FIPS202 / SHA3. The frontend is
@@ -94,12 +96,13 @@ mlkem-native currently offers the following backends:
94
96
  * 64-bit Arm backend (using Neon)
95
97
  * 64-bit Intel/AMD backend (using AVX2)
96
98
  * 64-bit RISC-V backend (using RVV)
99
+ * 64-bit POWER backend (ppc64le, using VSX; supports POWER8 and above)
97
100
  * 32-bit Armv8.1-M backend (using Helium/MVE) -- see [#1501](https://github.com/pq-code-package/mlkem-native/issues/1501). This is still experimental and disabled by default.
98
101
 
99
102
  If you'd like contribute new backends, please reach out or just open a PR.
100
103
 
101
104
  Our AArch64 assembly is developed using the [SLOTHY](https://github.com/slothy-optimizer/slothy) superoptimizer, following the approach described in the SLOTHY paper[^SLOTHY_Paper]:
102
- We write 'clean' assembly by hand and automate micro-optimizations (e.g. see the [clean](dev/aarch64_clean/src/ntt.S) vs [optimized](dev/aarch64_opt/src/ntt.S) AArch64 NTT).
105
+ We write 'clean' assembly by hand and automate micro-optimizations (e.g. see the [clean](dev/aarch64_clean/src/ntt_aarch64_asm.S) vs [optimized](dev/aarch64_opt/src/ntt_aarch64_asm.S) AArch64 NTT).
103
106
  See [dev/README.md](dev/README.md) for more details.
104
107
 
105
108
  ## Test Vectors
@@ -1,4 +1,26 @@
1
1
  [//]: # (SPDX-License-Identifier: CC-BY-4.0)
2
+
3
+ mlkem-native v1.2.0
4
+ ===================
5
+
6
+ Release notes
7
+ -------------
8
+
9
+ mlkem-native v1.2.0 adds a new **PowerPC (ppc64le)** assembly backend and broadens portability of the existing
10
+ backends: the x86_64 backend can now be used on Windows, the RISC-V backend compiles under C90, and a new
11
+ Cortex-M33 baremetal target is tested. It also fixes a signed-shift undefined behavior on 16-bit-`int` targets
12
+ and hardens the RISC-V backend against secret-dependent timing. Finally, the CBMC proofs are extended to
13
+ establish loop termination for all functions except rejection sampling.
14
+
15
+ What's New
16
+ ----------
17
+
18
+ - **PowerPC (ppc64le) backend**: New VSX arithmetic backend (NTT, inverse NTT, `poly_reduce`, `poly_tomont`) for POWER8 and above, with automatic fallback to C on older targets. Thanks to IBM, and in particular Danny Tsen (@dannytsen) and Basil Hess (@bhess), for this contribution! ([#1677](https://github.com/pq-code-package/mlkem-native/pull/1677))
19
+ - **Assurance**: CBMC now proves loop termination for all functions except rejection sampling. Thanks to Nicky Mouha (@nmouha) for making us aware of the absence of termination proofs. ([#1625](https://github.com/pq-code-package/mlkem-native/pull/1625))
20
+ - **Verification tooling**: Bump CBMC to a development build that works around a Z3 soundness issue ([Z3#9550](https://github.com/Z3Prover/z3/issues/9550)) affecting the SMT solver used by the CBMC proofs. ([#1745](https://github.com/pq-code-package/mlkem-native/pull/1745))
21
+ - **Portability**: the x86_64 assembly backend can now be used on Windows with compilers that support the SysV calling convention per function (GCC and Clang, via `__attribute__((sysv_abi))`) ([#1730](https://github.com/pq-code-package/mlkem-native/pull/1730)), the RISC-V backend compiles under C90 ([#1732](https://github.com/pq-code-package/mlkem-native/pull/1732)), and a new Cortex-M33 baremetal target is tested ([#1579](https://github.com/pq-code-package/mlkem-native/pull/1579)).
22
+ - **Correctness / CT**: Fix signed-shift undefined behavior on 16-bit-`int` targets ([#1727](https://github.com/pq-code-package/mlkem-native/pull/1727)) and harden the RISC-V backend against secret-dependent timing ([#1732](https://github.com/pq-code-package/mlkem-native/pull/1732)).
23
+
2
24
  mlkem-native v1.1.0
3
25
  ====================
4
26
 
@@ -88,6 +88,9 @@
88
88
  #include "src/native/riscv64/src/rv64v_debug.c"
89
89
  #include "src/native/riscv64/src/rv64v_poly.c"
90
90
  #endif
91
+ #if defined(MLK_SYS_PPC64LE)
92
+ #include "src/native/ppc64le/src/consts.c"
93
+ #endif
91
94
  #endif /* MLK_CONFIG_USE_NATIVE_BACKEND_ARITH */
92
95
 
93
96
  #if defined(MLK_CONFIG_USE_NATIVE_BACKEND_FIPS202)
@@ -213,6 +216,8 @@
213
216
  #undef MLK_FIPS202_HEADER_FILE
214
217
  #undef MLK_FREE
215
218
  #undef MLK_INTERNAL_API
219
+ #undef MLK_INTERNAL_DATA_DECLARATION
220
+ #undef MLK_INTERNAL_DATA_DEFINITION
216
221
  #undef MLK_NAMESPACE
217
222
  #undef MLK_NAMESPACE_K
218
223
  #undef MLK_NAMESPACE_PREFIX
@@ -365,8 +370,11 @@
365
370
  #undef MLK_HAVE_INLINE_ASM
366
371
  #undef MLK_INLINE
367
372
  #undef MLK_MUST_CHECK_RETURN_VALUE
373
+ #undef MLK_NOINLINE
368
374
  #undef MLK_RESTRICT
369
375
  #undef MLK_STATIC_TESTABLE
376
+ #undef MLK_SYSV_ABI
377
+ #undef MLK_SYSV_ABI_SUPPORTED
370
378
  #undef MLK_SYS_AARCH64
371
379
  #undef MLK_SYS_AARCH64_EB
372
380
  #undef MLK_SYS_APPLE
@@ -446,11 +454,11 @@
446
454
  #undef MLK_FIPS202_NATIVE_AARCH64_AUTO_H
447
455
  /* mlkem/src/fips202/native/aarch64/src/fips202_native_aarch64.h */
448
456
  #undef MLK_FIPS202_NATIVE_AARCH64_SRC_FIPS202_NATIVE_AARCH64_H
449
- #undef mlk_keccak_f1600_x1_scalar_asm
450
- #undef mlk_keccak_f1600_x1_v84a_asm
451
- #undef mlk_keccak_f1600_x2_v84a_asm
452
- #undef mlk_keccak_f1600_x4_v8a_scalar_hybrid_asm
453
- #undef mlk_keccak_f1600_x4_v8a_v84a_scalar_hybrid_asm
457
+ #undef mlk_keccak_f1600_x1_scalar_aarch64_asm
458
+ #undef mlk_keccak_f1600_x1_v84a_aarch64_asm
459
+ #undef mlk_keccak_f1600_x2_v84a_aarch64_asm
460
+ #undef mlk_keccak_f1600_x4_v8a_scalar_hybrid_aarch64_asm
461
+ #undef mlk_keccak_f1600_x4_v8a_v84a_scalar_hybrid_aarch64_asm
454
462
  #undef mlk_keccakf1600_round_constants
455
463
  /* mlkem/src/fips202/native/aarch64/x1_scalar.h */
456
464
  #undef MLK_FIPS202_AARCH64_NEED_X1_SCALAR
@@ -483,7 +491,7 @@
483
491
  #undef MLK_USE_FIPS202_X4_NATIVE
484
492
  /* mlkem/src/fips202/native/x86_64/src/fips202_native_x86_64.h */
485
493
  #undef MLK_FIPS202_NATIVE_X86_64_SRC_FIPS202_NATIVE_X86_64_H
486
- #undef mlk_keccak_f1600_x4_avx2
494
+ #undef mlk_keccak_f1600_x4_avx2_asm
487
495
  #undef mlk_keccak_rho56
488
496
  #undef mlk_keccak_rho8
489
497
  #undef mlk_keccakf1600_round_constants
@@ -542,16 +550,16 @@
542
550
  #undef mlk_aarch64_ntt_zetas_layer67
543
551
  #undef mlk_aarch64_zetas_mulcache_native
544
552
  #undef mlk_aarch64_zetas_mulcache_twisted_native
545
- #undef mlk_intt_asm
546
- #undef mlk_ntt_asm
547
- #undef mlk_poly_mulcache_compute_asm
548
- #undef mlk_poly_reduce_asm
549
- #undef mlk_poly_tobytes_asm
550
- #undef mlk_poly_tomont_asm
551
- #undef mlk_polyvec_basemul_acc_montgomery_cached_asm_k2
552
- #undef mlk_polyvec_basemul_acc_montgomery_cached_asm_k3
553
- #undef mlk_polyvec_basemul_acc_montgomery_cached_asm_k4
554
- #undef mlk_rej_uniform_asm
553
+ #undef mlk_intt_aarch64_asm
554
+ #undef mlk_ntt_aarch64_asm
555
+ #undef mlk_poly_mulcache_compute_aarch64_asm
556
+ #undef mlk_poly_reduce_aarch64_asm
557
+ #undef mlk_poly_tobytes_aarch64_asm
558
+ #undef mlk_poly_tomont_aarch64_asm
559
+ #undef mlk_polyvec_basemul_acc_montgomery_cached_k2_aarch64_asm
560
+ #undef mlk_polyvec_basemul_acc_montgomery_cached_k3_aarch64_asm
561
+ #undef mlk_polyvec_basemul_acc_montgomery_cached_k4_aarch64_asm
562
+ #undef mlk_rej_uniform_aarch64_asm
555
563
  #undef mlk_rej_uniform_table
556
564
  #endif /* MLK_SYS_AARCH64 */
557
565
  #if defined(MLK_SYS_X86_64)
@@ -582,27 +590,27 @@
582
590
  /* mlkem/src/native/x86_64/src/arith_native_x86_64.h */
583
591
  #undef MLK_AVX2_REJ_UNIFORM_BUFLEN
584
592
  #undef MLK_NATIVE_X86_64_SRC_ARITH_NATIVE_X86_64_H
585
- #undef mlk_invntt_avx2
586
- #undef mlk_ntt_avx2
587
- #undef mlk_nttfrombytes_avx2
588
- #undef mlk_ntttobytes_avx2
589
- #undef mlk_nttunpack_avx2
590
- #undef mlk_poly_compress_d10_avx2
591
- #undef mlk_poly_compress_d11_avx2
592
- #undef mlk_poly_compress_d4_avx2
593
- #undef mlk_poly_compress_d5_avx2
594
- #undef mlk_poly_decompress_d10_avx2
595
- #undef mlk_poly_decompress_d11_avx2
596
- #undef mlk_poly_decompress_d4_avx2
597
- #undef mlk_poly_decompress_d5_avx2
598
- #undef mlk_poly_mulcache_compute_avx2
599
- #undef mlk_polyvec_basemul_acc_montgomery_cached_asm_k2
600
- #undef mlk_polyvec_basemul_acc_montgomery_cached_asm_k3
601
- #undef mlk_polyvec_basemul_acc_montgomery_cached_asm_k4
602
- #undef mlk_reduce_avx2
603
- #undef mlk_rej_uniform_asm
593
+ #undef mlk_invntt_avx2_asm
594
+ #undef mlk_ntt_avx2_asm
595
+ #undef mlk_nttfrombytes_avx2_asm
596
+ #undef mlk_ntttobytes_avx2_asm
597
+ #undef mlk_nttunpack_avx2_asm
598
+ #undef mlk_poly_compress_d10_avx2_asm
599
+ #undef mlk_poly_compress_d11_avx2_asm
600
+ #undef mlk_poly_compress_d4_avx2_asm
601
+ #undef mlk_poly_compress_d5_avx2_asm
602
+ #undef mlk_poly_decompress_d10_avx2_asm
603
+ #undef mlk_poly_decompress_d11_avx2_asm
604
+ #undef mlk_poly_decompress_d4_avx2_asm
605
+ #undef mlk_poly_decompress_d5_avx2_asm
606
+ #undef mlk_poly_mulcache_compute_avx2_asm
607
+ #undef mlk_polyvec_basemul_acc_montgomery_cached_k2_avx2_asm
608
+ #undef mlk_polyvec_basemul_acc_montgomery_cached_k3_avx2_asm
609
+ #undef mlk_polyvec_basemul_acc_montgomery_cached_k4_avx2_asm
610
+ #undef mlk_reduce_avx2_asm
611
+ #undef mlk_rej_uniform_avx2_asm
604
612
  #undef mlk_rej_uniform_table
605
- #undef mlk_tomont_avx2
613
+ #undef mlk_tomont_avx2_asm
606
614
  /* mlkem/src/native/x86_64/src/compress_consts.h */
607
615
  #undef MLK_NATIVE_X86_64_SRC_COMPRESS_CONSTS_H
608
616
  #undef mlk_compress_d10_data
@@ -656,5 +664,38 @@
656
664
  #undef mlk_debug_check_bounds_int16m1
657
665
  #undef mlk_debug_check_bounds_int16m2
658
666
  #endif /* MLK_SYS_RISCV64 */
667
+ #if defined(MLK_SYS_PPC64LE)
668
+ /*
669
+ * Undefine macros from native code (Arith, PPC64LE)
670
+ */
671
+ /* mlkem/src/native/ppc64le/meta.h */
672
+ #undef MLK_ARITH_BACKEND_NAME
673
+ #undef MLK_ARITH_BACKEND_PPC64LE_DEFAULT
674
+ #undef MLK_NATIVE_PPC64LE_META_H
675
+ #undef MLK_USE_NATIVE_INTT
676
+ #undef MLK_USE_NATIVE_NTT
677
+ #undef MLK_USE_NATIVE_POLY_REDUCE
678
+ #undef MLK_USE_NATIVE_POLY_TOMONT
679
+ /* mlkem/src/native/ppc64le/src/arith_native_ppc64le.h */
680
+ #undef MLK_NATIVE_PPC64LE_SRC_ARITH_NATIVE_PPC64LE_H
681
+ #undef mlk_intt_ppc_asm
682
+ #undef mlk_ntt_ppc_asm
683
+ #undef mlk_poly_tomont_ppc_asm
684
+ #undef mlk_reduce_ppc_asm
685
+ /* mlkem/src/native/ppc64le/src/consts.h */
686
+ #undef MLK_NATIVE_PPC64LE_SRC_CONSTS_H
687
+ #undef MLK_PPC_C20159_OFFSET
688
+ #undef MLK_PPC_NQ_OFFSET
689
+ #undef MLK_PPC_N_INV_OFFSET
690
+ #undef MLK_PPC_N_INV_TW_OFFSET
691
+ #undef MLK_PPC_Q_OFFSET
692
+ #undef MLK_PPC_TOMONT_OFFSET
693
+ #undef MLK_PPC_TOMONT_TW_OFFSET
694
+ #undef MLK_PPC_ZETA_INTT_OFFSET
695
+ #undef MLK_PPC_ZETA_INTT_TW_OFFSET
696
+ #undef MLK_PPC_ZETA_NTT_OFFSET
697
+ #undef MLK_PPC_ZETA_NTT_TW_OFFSET
698
+ #undef mlk_ppc_qdata
699
+ #endif /* MLK_SYS_PPC64LE */
659
700
  #endif /* MLK_CONFIG_USE_NATIVE_BACKEND_ARITH */
660
701
  #endif /* !MLK_CONFIG_MONOBUILD_KEEP_SHARED_HEADERS */
@@ -112,13 +112,13 @@
112
112
  /****************************** Error codes ***********************************/
113
113
 
114
114
  /* Generic failure condition */
115
- #define MLK_ERR_FAIL -1
115
+ #define MLK_ERR_FAIL (-1)
116
116
  /* An allocation failed. This can only happen if MLK_CONFIG_CUSTOM_ALLOC_FREE
117
117
  * is defined and the provided MLK_CUSTOM_ALLOC can fail. */
118
- #define MLK_ERR_OUT_OF_MEMORY -2
118
+ #define MLK_ERR_OUT_OF_MEMORY (-2)
119
119
  /* An rng failure occured. Might be due to insufficient entropy or
120
120
  * system misconfiguration. */
121
- #define MLK_ERR_RNG_FAIL -3
121
+ #define MLK_ERR_RNG_FAIL (-3)
122
122
 
123
123
  /****************************** Function API **********************************/
124
124
 
@@ -170,7 +170,7 @@
170
170
  #define MLK_API_NAMESPACE(sym) \
171
171
  MLK_API_CONCAT_UNDERSCORE(MLK_CONFIG_API_NAMESPACE_PREFIX, sym)
172
172
 
173
- #if defined(__GNUC__) || defined(clang)
173
+ #if defined(__GNUC__) || defined(__clang__)
174
174
  #define MLK_API_MUST_CHECK_RETURN_VALUE __attribute__((warn_unused_result))
175
175
  #else
176
176
  #define MLK_API_MUST_CHECK_RETURN_VALUE
@@ -191,28 +191,26 @@ extern "C"
191
191
  {
192
192
  #endif
193
193
 
194
- /*************************************************
195
- * Name: crypto_kem_keypair_derand
196
- *
197
- * Description: Generates public and private key
198
- * for CCA-secure ML-KEM key encapsulation mechanism
199
- *
200
- * Arguments: - uint8_t pk[]: pointer to output public key, an array of
201
- * length MLKEM{512,768,1024}_PUBLICKEYBYTES bytes.
202
- * - uint8_t sk[]: pointer to output private key, an array of
203
- * of MLKEM{512,768,1024}_SECRETKEYBYTES bytes.
204
- * - uint8_t *coins: pointer to input randomness, an array of
205
- * 2*MLKEM_SYMBYTES uniformly random bytes.
206
- *
207
- * Returns: - 0: On success
208
- * - MLK_ERR_FAIL: If MLK_CONFIG_KEYGEN_PCT is enabled and the
209
- * PCT failed.
210
- * - MLK_ERR_OUT_OF_MEMORY: If MLK_CONFIG_CUSTOM_ALLOC_FREE is
211
- * used and an allocation via MLK_CUSTOM_ALLOC returned NULL.
212
- *
213
- * Specification: Implements @[FIPS203, Algorithm 16, ML-KEM.KeyGen_Internal]
214
- *
215
- **************************************************/
194
+ /**
195
+ * Generate a public/private keypair for the ML-KEM key encapsulation mechanism.
196
+ *
197
+ * @spec{Implements @[FIPS203, Algorithm 16, ML-KEM.KeyGen_Internal].}
198
+ *
199
+ * @param[out] pk Output public key, an array of
200
+ * MLKEM{512,768,1024}_PUBLICKEYBYTES bytes.
201
+ * @param[out] sk Output private key, an array of
202
+ * MLKEM{512,768,1024}_SECRETKEYBYTES bytes.
203
+ * @param[in] coins Input randomness, an array of 2*MLKEM_SYMBYTES uniformly
204
+ * random bytes.
205
+ * @param context Application context. Only present when
206
+ * MLK_CONFIG_CONTEXT_PARAMETER is defined; type set by
207
+ * MLK_CONFIG_CONTEXT_PARAMETER_TYPE.
208
+ *
209
+ * @retval 0 Success.
210
+ * @retval MLK_ERR_FAIL MLK_CONFIG_KEYGEN_PCT enabled and PCT failed.
211
+ * @retval MLK_ERR_OUT_OF_MEMORY MLK_CONFIG_CUSTOM_ALLOC_FREE was used and
212
+ * MLK_CUSTOM_ALLOC returned NULL.
213
+ */
216
214
  MLK_API_QUALIFIER
217
215
  MLK_API_MUST_CHECK_RETURN_VALUE
218
216
  int MLK_API_NAMESPACE(keypair_derand)(
@@ -227,27 +225,25 @@ int MLK_API_NAMESPACE(keypair_derand)(
227
225
 
228
226
 
229
227
  #if !defined(MLK_CONFIG_NO_RANDOMIZED_API)
230
- /*************************************************
231
- * Name: crypto_kem_keypair
232
- *
233
- * Description: Generates public and private key
234
- * for CCA-secure ML-KEM key encapsulation mechanism
235
- *
236
- * Arguments: - uint8_t *pk: pointer to output public key, an array of
237
- * MLKEM{512,768,1024}_PUBLICKEYBYTES bytes.
238
- * - uint8_t *sk: pointer to output private key, an array of
239
- * MLKEM{512,768,1024}_SECRETKEYBYTES bytes.
240
- *
241
- * Returns: - 0: On success
242
- * - MLK_ERR_FAIL: If MLK_CONFIG_KEYGEN_PCT is enabled and the
243
- * PCT failed.
244
- * - MLK_ERR_OUT_OF_MEMORY: If MLK_CONFIG_CUSTOM_ALLOC_FREE is
245
- * used and an allocation via MLK_CUSTOM_ALLOC returned NULL.
246
- * - MLK_ERR_RNG_FAIL: Random number generation failed.
247
- *
248
- * Specification: Implements @[FIPS203, Algorithm 19, ML-KEM.KeyGen]
249
- *
250
- **************************************************/
228
+ /**
229
+ * Generate a public/private keypair for the ML-KEM key encapsulation mechanism.
230
+ *
231
+ * @spec{Implements @[FIPS203, Algorithm 19, ML-KEM.KeyGen].}
232
+ *
233
+ * @param[out] pk Output public key, an array of
234
+ * MLKEM{512,768,1024}_PUBLICKEYBYTES bytes.
235
+ * @param[out] sk Output private key, an array of
236
+ * MLKEM{512,768,1024}_SECRETKEYBYTES bytes.
237
+ * @param context Application context. Only present when
238
+ * MLK_CONFIG_CONTEXT_PARAMETER is defined; type set by
239
+ * MLK_CONFIG_CONTEXT_PARAMETER_TYPE.
240
+ *
241
+ * @retval 0 Success.
242
+ * @retval MLK_ERR_FAIL MLK_CONFIG_KEYGEN_PCT enabled and PCT failed.
243
+ * @retval MLK_ERR_OUT_OF_MEMORY MLK_CONFIG_CUSTOM_ALLOC_FREE was used and
244
+ * MLK_CUSTOM_ALLOC returned NULL.
245
+ * @retval MLK_ERR_RNG_FAIL Random number generation failed.
246
+ */
251
247
  MLK_API_QUALIFIER
252
248
  MLK_API_MUST_CHECK_RETURN_VALUE
253
249
  int MLK_API_NAMESPACE(keypair)(
@@ -260,30 +256,27 @@ int MLK_API_NAMESPACE(keypair)(
260
256
  );
261
257
  #endif /* !MLK_CONFIG_NO_RANDOMIZED_API */
262
258
 
263
- /*************************************************
264
- * Name: crypto_kem_enc_derand
265
- *
266
- * Description: Generates cipher text and shared
267
- * secret for given public key
268
- *
269
- * Arguments: - uint8_t *ct: pointer to output cipher text, an array of
270
- * MLKEM{512,768,1024}_CIPHERTEXTBYTES bytes.
271
- * - uint8_t *ss: pointer to output shared secret, an array of
272
- * MLKEM_BYTES bytes.
273
- * - const uint8_t *pk: pointer to input public key, an array of
274
- * MLKEM{512,768,1024}_PUBLICKEYBYTES bytes.
275
- * - const uint8_t *coins: pointer to input randomness, an array of
276
- * MLKEM_SYMBYTES bytes.
277
- *
278
- * Returns: - 0 on success
279
- * - MLK_ERR_FAIL: If the 'modulus check' @[FIPS203, Section 7.2]
280
- * for the public key fails.
281
- * - MLK_ERR_OUT_OF_MEMORY: If MLK_CONFIG_CUSTOM_ALLOC_FREE is
282
- * used and an allocation via MLK_CUSTOM_ALLOC returned NULL.
283
- *
284
- * Specification: Implements @[FIPS203, Algorithm 17, ML-KEM.Encaps_Internal]
285
- *
286
- **************************************************/
259
+ /**
260
+ * Generate ciphertext and shared secret for a given public key.
261
+ *
262
+ * @spec{Implements @[FIPS203, Algorithm 17, ML-KEM.Encaps_Internal].}
263
+ *
264
+ * @param[out] ct Output ciphertext, an array of
265
+ * MLKEM{512,768,1024}_CIPHERTEXTBYTES bytes.
266
+ * @param[out] ss Output shared secret, an array of MLKEM_BYTES bytes.
267
+ * @param[in] pk Input public key, an array of
268
+ * MLKEM{512,768,1024}_PUBLICKEYBYTES bytes.
269
+ * @param[in] coins Input randomness, an array of MLKEM_SYMBYTES bytes.
270
+ * @param context Application context. Only present when
271
+ * MLK_CONFIG_CONTEXT_PARAMETER is defined; type set by
272
+ * MLK_CONFIG_CONTEXT_PARAMETER_TYPE.
273
+ *
274
+ * @retval 0 Success.
275
+ * @retval MLK_ERR_FAIL The 'modulus check' @[FIPS203, Section 7.2]
276
+ * for the public key failed.
277
+ * @retval MLK_ERR_OUT_OF_MEMORY MLK_CONFIG_CUSTOM_ALLOC_FREE was used and
278
+ * MLK_CUSTOM_ALLOC returned NULL.
279
+ */
287
280
  MLK_API_QUALIFIER
288
281
  MLK_API_MUST_CHECK_RETURN_VALUE
289
282
  int MLK_API_NAMESPACE(enc_derand)(
@@ -298,29 +291,27 @@ int MLK_API_NAMESPACE(enc_derand)(
298
291
  );
299
292
 
300
293
  #if !defined(MLK_CONFIG_NO_RANDOMIZED_API)
301
- /*************************************************
302
- * Name: crypto_kem_enc
303
- *
304
- * Description: Generates cipher text and shared
305
- * secret for given public key
306
- *
307
- * Arguments: - uint8_t *ct: pointer to output cipher text, an array of
308
- * MLKEM{512,768,1024}_CIPHERTEXTBYTES bytes.
309
- * - uint8_t *ss: pointer to output shared secret, an array of
310
- * MLKEM_BYTES bytes.
311
- * - const uint8_t *pk: pointer to input public key, an array of
312
- * MLKEM{512,768,1024}_PUBLICKEYBYTES bytes.
313
- *
314
- * Returns: - 0 on success
315
- * - MLK_ERR_FAIL: If the 'modulus check' @[FIPS203, Section 7.2]
316
- * for the public key fails.
317
- * - MLK_ERR_OUT_OF_MEMORY: If MLK_CONFIG_CUSTOM_ALLOC_FREE is
318
- * used and an allocation via MLK_CUSTOM_ALLOC returned NULL.
319
- * - MLK_ERR_RNG_FAIL: Random number generation failed.
320
- *
321
- * Specification: Implements @[FIPS203, Algorithm 20, ML-KEM.Encaps]
322
- *
323
- **************************************************/
294
+ /**
295
+ * Generate ciphertext and shared secret for a given public key.
296
+ *
297
+ * @spec{Implements @[FIPS203, Algorithm 20, ML-KEM.Encaps].}
298
+ *
299
+ * @param[out] ct Output ciphertext, an array of
300
+ * MLKEM{512,768,1024}_CIPHERTEXTBYTES bytes.
301
+ * @param[out] ss Output shared secret, an array of MLKEM_BYTES bytes.
302
+ * @param[in] pk Input public key, an array of
303
+ * MLKEM{512,768,1024}_PUBLICKEYBYTES bytes.
304
+ * @param context Application context. Only present when
305
+ * MLK_CONFIG_CONTEXT_PARAMETER is defined; type set by
306
+ * MLK_CONFIG_CONTEXT_PARAMETER_TYPE.
307
+ *
308
+ * @retval 0 Success.
309
+ * @retval MLK_ERR_FAIL The 'modulus check' @[FIPS203, Section 7.2]
310
+ * for the public key failed.
311
+ * @retval MLK_ERR_OUT_OF_MEMORY MLK_CONFIG_CUSTOM_ALLOC_FREE was used and
312
+ * MLK_CUSTOM_ALLOC returned NULL.
313
+ * @retval MLK_ERR_RNG_FAIL Random number generation failed.
314
+ */
324
315
  MLK_API_QUALIFIER
325
316
  MLK_API_MUST_CHECK_RETURN_VALUE
326
317
  int MLK_API_NAMESPACE(enc)(
@@ -334,28 +325,26 @@ int MLK_API_NAMESPACE(enc)(
334
325
  );
335
326
  #endif /* !MLK_CONFIG_NO_RANDOMIZED_API */
336
327
 
337
- /*************************************************
338
- * Name: crypto_kem_dec
339
- *
340
- * Description: Generates shared secret for given
341
- * cipher text and private key
342
- *
343
- * Arguments: - uint8_t *ss: pointer to output shared secret, an array of
344
- * MLKEM_BYTES bytes.
345
- * - const uint8_t *ct: pointer to input cipher text, an array of
346
- * MLKEM{512,768,1024}_CIPHERTEXTBYTES bytes.
347
- * - const uint8_t *sk: pointer to input private key, an array of
348
- * MLKEM{512,768,1024}_SECRETKEYBYTES bytes.
349
- *
350
- * Returns: - 0 on success
351
- * - MLK_ERR_FAIL: If the 'hash check' @[FIPS203, Section 7.3]
352
- * for the secret key fails.
353
- * - MLK_ERR_OUT_OF_MEMORY: If MLK_CONFIG_CUSTOM_ALLOC_FREE is
354
- * used and an allocation via MLK_CUSTOM_ALLOC returned NULL.
355
- *
356
- * Specification: Implements @[FIPS203, Algorithm 21, ML-KEM.Decaps]
357
- *
358
- **************************************************/
328
+ /**
329
+ * Generate shared secret for a given ciphertext and private key.
330
+ *
331
+ * @spec{Implements @[FIPS203, Algorithm 21, ML-KEM.Decaps].}
332
+ *
333
+ * @param[out] ss Output shared secret, an array of MLKEM_BYTES bytes.
334
+ * @param[in] ct Input ciphertext, an array of
335
+ * MLKEM{512,768,1024}_CIPHERTEXTBYTES bytes.
336
+ * @param[in] sk Input private key, an array of
337
+ * MLKEM{512,768,1024}_SECRETKEYBYTES bytes.
338
+ * @param context Application context. Only present when
339
+ * MLK_CONFIG_CONTEXT_PARAMETER is defined; type set by
340
+ * MLK_CONFIG_CONTEXT_PARAMETER_TYPE.
341
+ *
342
+ * @retval 0 Success.
343
+ * @retval MLK_ERR_FAIL The 'hash check' @[FIPS203, Section 7.3]
344
+ * for the secret key failed.
345
+ * @retval MLK_ERR_OUT_OF_MEMORY MLK_CONFIG_CUSTOM_ALLOC_FREE was used and
346
+ * MLK_CUSTOM_ALLOC returned NULL.
347
+ */
359
348
  MLK_API_QUALIFIER
360
349
  MLK_API_MUST_CHECK_RETURN_VALUE
361
350
  int MLK_API_NAMESPACE(dec)(
@@ -369,23 +358,23 @@ int MLK_API_NAMESPACE(dec)(
369
358
  );
370
359
 
371
360
 
372
- /*************************************************
373
- * Name: crypto_kem_check_pk
361
+ /**
362
+ * Implements modulus check mandated by FIPS 203, i.e., ensures that
363
+ * coefficients are in [0,q-1].
374
364
  *
375
- * Description: Implements modulus check mandated by FIPS 203,
376
- * i.e., ensures that coefficients are in [0,q-1].
365
+ * @spec{Implements @[FIPS203, Section 7.2, 'modulus check'].}
377
366
  *
378
- * Arguments: - const uint8_t *pk: pointer to input public key, an array of
379
- * MLKEM{512,768,1024}_PUBLICKEYBYTES bytes.
367
+ * @param[in] pk Input public key, an array of
368
+ * MLKEM{512,768,1024}_PUBLICKEYBYTES bytes.
369
+ * @param context Application context. Only present when
370
+ * MLK_CONFIG_CONTEXT_PARAMETER is defined; type set by
371
+ * MLK_CONFIG_CONTEXT_PARAMETER_TYPE.
380
372
  *
381
- * Returns: - 0 on success
382
- * - MLK_ERR_FAIL: If the modulus check failed.
383
- * - MLK_ERR_OUT_OF_MEMORY: If MLK_CONFIG_CUSTOM_ALLOC_FREE is
384
- * used and an allocation via MLK_CUSTOM_ALLOC returned NULL.
385
- *
386
- * Specification: Implements @[FIPS203, Section 7.2, 'modulus check']
387
- *
388
- **************************************************/
373
+ * @retval 0 Success.
374
+ * @retval MLK_ERR_FAIL Modulus check failed.
375
+ * @retval MLK_ERR_OUT_OF_MEMORY MLK_CONFIG_CUSTOM_ALLOC_FREE was used and
376
+ * MLK_CUSTOM_ALLOC returned NULL.
377
+ */
389
378
  MLK_API_QUALIFIER
390
379
  MLK_API_MUST_CHECK_RETURN_VALUE
391
380
  int MLK_API_NAMESPACE(check_pk)(
@@ -396,24 +385,23 @@ int MLK_API_NAMESPACE(check_pk)(
396
385
  #endif
397
386
  );
398
387
 
399
- /*************************************************
400
- * Name: crypto_kem_check_sk
401
- *
402
- * Description: Implements public key hash check mandated by FIPS 203,
403
- * i.e., ensures that
404
- * sk[768𝑘+32 ∶ 768𝑘+64] = H(pk)= H(sk[384𝑘 : 768𝑘+32])
405
- *
406
- * Arguments: - const uint8_t *sk: pointer to input private key, an array of
407
- * MLKEM{512,768,1024}_SECRETKEYBYTES bytes.
388
+ /**
389
+ * Implements public key hash check mandated by FIPS 203, i.e., ensures that
390
+ * sk[768𝑘+32 ∶ 768𝑘+64] = H(pk) = H(sk[384𝑘 : 768𝑘+32]).
408
391
  *
409
- * Returns: - 0 on success
410
- * - MLK_ERR_FAIL: If the public key hash check failed.
411
- * - MLK_ERR_OUT_OF_MEMORY: If MLK_CONFIG_CUSTOM_ALLOC_FREE is
412
- * used and an allocation via MLK_CUSTOM_ALLOC returned NULL.
392
+ * @spec{Implements @[FIPS203, Section 7.3, 'hash check'].}
413
393
  *
414
- * Specification: Implements @[FIPS203, Section 7.3, 'hash check']
394
+ * @param[in] sk Input private key, an array of
395
+ * MLKEM{512,768,1024}_SECRETKEYBYTES bytes.
396
+ * @param context Application context. Only present when
397
+ * MLK_CONFIG_CONTEXT_PARAMETER is defined; type set by
398
+ * MLK_CONFIG_CONTEXT_PARAMETER_TYPE.
415
399
  *
416
- **************************************************/
400
+ * @retval 0 Success.
401
+ * @retval MLK_ERR_FAIL Public key hash check failed.
402
+ * @retval MLK_ERR_OUT_OF_MEMORY MLK_CONFIG_CUSTOM_ALLOC_FREE was used and
403
+ * MLK_CUSTOM_ALLOC returned NULL.
404
+ */
417
405
  MLK_API_QUALIFIER
418
406
  MLK_API_MUST_CHECK_RETURN_VALUE
419
407
  int MLK_API_NAMESPACE(check_sk)(
@@ -465,7 +453,6 @@ int MLK_API_NAMESPACE(check_sk)(
465
453
  #undef MLK_API_NAMESPACE
466
454
  #undef MLK_API_MUST_CHECK_RETURN_VALUE
467
455
  #undef MLK_API_QUALIFIER
468
- #undef MLK_API_LEGACY_CONFIG
469
456
 
470
457
  #endif /* MLK_CONFIG_API_NO_SUPERCOP */
471
458
  #endif /* !MLK_CONFIG_API_CONSTANTS_ONLY */
@@ -535,4 +522,6 @@ int MLK_API_NAMESPACE(check_sk)(
535
522
  MLK_MAX3_(MLK_TOTAL_ALLOC_1024_KEYPAIR, MLK_TOTAL_ALLOC_1024_ENCAPS, \
536
523
  MLK_TOTAL_ALLOC_1024_DECAPS)
537
524
 
525
+ #undef MLK_API_LEGACY_CONFIG
526
+
538
527
  #endif /* !MLK_H */