pq_crypto 0.6.8 → 0.6.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (206) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +11 -0
  3. data/README.md +1 -3
  4. data/ext/pqcrypto/pqcrypto_version.h +1 -1
  5. data/ext/pqcrypto/vendor/.vendored +7 -7
  6. data/ext/pqcrypto/vendor/mldsa-native/BUILDING.md +71 -0
  7. data/ext/pqcrypto/vendor/mldsa-native/README.md +26 -11
  8. data/ext/pqcrypto/vendor/mldsa-native/RELEASE.md +77 -150
  9. data/ext/pqcrypto/vendor/mldsa-native/mldsa/mldsa_native.c +93 -40
  10. data/ext/pqcrypto/vendor/mldsa-native/mldsa/mldsa_native.h +74 -59
  11. data/ext/pqcrypto/vendor/mldsa-native/mldsa/mldsa_native_asm.S +106 -40
  12. data/ext/pqcrypto/vendor/mldsa-native/mldsa/mldsa_native_config.h +94 -92
  13. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/capability.h +31 -0
  14. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/cbmc.h +55 -4
  15. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/common.h +30 -0
  16. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/context.h +1 -0
  17. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/debug.c +1 -0
  18. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/fips202.h +1 -0
  19. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/aarch64/src/keccak_f1600_x1_scalar_aarch64_asm.S +5 -2
  20. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/aarch64/src/keccak_f1600_x1_v84a_aarch64_asm.S +4 -4
  21. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/aarch64/src/keccak_f1600_x2_v84a_aarch64_asm.S +4 -4
  22. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/aarch64/src/keccak_f1600_x4_v8a_scalar_hybrid_aarch64_asm.S +8 -3
  23. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/aarch64/src/keccak_f1600_x4_v8a_v84a_scalar_hybrid_aarch64_asm.S +8 -4
  24. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/armv81m/mve.h +12 -0
  25. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/armv81m/src/keccak_f1600_x4_mve.S +4 -2
  26. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/armv81m/src/keccak_f1600_x4_state_extract_bytes_mve.S +37 -19
  27. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/armv81m/src/keccak_f1600_x4_state_xor_bytes_mve.S +37 -19
  28. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/auto.h +3 -8
  29. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/x86_64/auto.h +53 -0
  30. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/x86_64/keccak_f1600_x1_avx512.h +38 -0
  31. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/x86_64/keccak_f1600_x4_avx512.h +38 -0
  32. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/x86_64/src/fips202_native_x86_64.h +24 -0
  33. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/x86_64/src/keccak_f1600_x1_avx512_asm.S +574 -0
  34. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/x86_64/src/keccak_f1600_x4_avx2_asm.S +46 -18
  35. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/x86_64/src/keccak_f1600_x4_avx512_asm.S +679 -0
  36. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/fips202/native/x86_64/src/keccakf1600_constants.c +13 -4
  37. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/meta.h +6 -4
  38. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/arith_native_aarch64.h +5 -6
  39. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/mldsa_intt_aarch64_asm.S +4 -2
  40. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/mldsa_ntt_aarch64_asm.S +4 -2
  41. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/mldsa_pointwise_montgomery_aarch64_asm.S +6 -4
  42. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/mldsa_poly_caddq_aarch64_asm.S +4 -2
  43. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/mldsa_poly_chknorm_aarch64_asm.S +6 -4
  44. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/mldsa_poly_decompose_32_aarch64_asm.S +4 -3
  45. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/mldsa_poly_decompose_88_aarch64_asm.S +4 -3
  46. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/mldsa_poly_use_hint_32_aarch64_asm.S +4 -3
  47. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/mldsa_poly_use_hint_88_aarch64_asm.S +4 -3
  48. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/mldsa_polyvecl_pointwise_acc_montgomery_l4_aarch64_asm.S +4 -2
  49. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/mldsa_polyvecl_pointwise_acc_montgomery_l5_aarch64_asm.S +4 -2
  50. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/mldsa_polyvecl_pointwise_acc_montgomery_l7_aarch64_asm.S +4 -2
  51. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/mldsa_polyz_unpack_17_aarch64_asm.S +5 -3
  52. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/mldsa_polyz_unpack_19_aarch64_asm.S +5 -3
  53. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/mldsa_rej_uniform_aarch64_asm.S +110 -120
  54. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/mldsa_rej_uniform_eta2_aarch64_asm.S +109 -101
  55. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/aarch64/src/mldsa_rej_uniform_eta4_aarch64_asm.S +97 -93
  56. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/api.h +1 -9
  57. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/meta.h +4 -0
  58. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/rv32im/fastmul.h +74 -0
  59. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/rv32im/slowmul.h +77 -0
  60. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/rv32im/src/arith_native_rv32im.h +124 -0
  61. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/rv32im/src/mldsa_intt_rv32im_asm.S +331 -0
  62. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/rv32im/src/mldsa_intt_rv32im_slowmul_asm.S +381 -0
  63. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/rv32im/src/mldsa_ntt_rv32im_asm.S +304 -0
  64. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/rv32im/src/mldsa_ntt_rv32im_slowmul_asm.S +351 -0
  65. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/rv32im/src/mldsa_poly_pointwise_montgomery_rv32im_asm.S +139 -0
  66. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/rv32im/src/rv32im_zetas.c +118 -0
  67. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/meta.h +6 -5
  68. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/arith_native_x86_64.h +2 -3
  69. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/mldsa_intt_avx2_asm.S +5 -3
  70. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/mldsa_ntt_avx2_asm.S +5 -3
  71. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/mldsa_nttunpack_avx2_asm.S +5 -3
  72. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/mldsa_pointwise_acc_l4_avx2_asm.S +6 -3
  73. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/mldsa_pointwise_acc_l5_avx2_asm.S +6 -3
  74. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/mldsa_pointwise_acc_l7_avx2_asm.S +6 -3
  75. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/mldsa_pointwise_avx2_asm.S +5 -3
  76. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/mldsa_poly_caddq_avx2_asm.S +5 -3
  77. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/mldsa_poly_chknorm_avx2_asm.S +7 -5
  78. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/mldsa_poly_decompose_32_avx2_asm.S +69 -67
  79. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/mldsa_poly_decompose_88_avx2_asm.S +69 -67
  80. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/mldsa_poly_use_hint_32_avx2_asm.S +12 -16
  81. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/mldsa_poly_use_hint_88_avx2_asm.S +14 -18
  82. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/mldsa_polyz_unpack_17_avx2_asm.S +6 -3
  83. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/mldsa_polyz_unpack_19_avx2_asm.S +6 -3
  84. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/mldsa_rej_uniform_avx2_asm.S +5 -3
  85. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/mldsa_rej_uniform_eta2_avx2_asm.S +5 -3
  86. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/native/x86_64/src/mldsa_rej_uniform_eta4_avx2_asm.S +5 -3
  87. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/packing.c +23 -27
  88. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/packing.h +21 -42
  89. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/params.h +28 -1
  90. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/poly.c +87 -28
  91. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/poly.h +61 -3
  92. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/poly_kl.c +23 -19
  93. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/poly_kl.h +30 -0
  94. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/polyvec.c +55 -107
  95. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/polyvec.h +67 -107
  96. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/polyvec_lazy.c +16 -24
  97. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/polyvec_lazy.h +27 -21
  98. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/reduce.h +8 -8
  99. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/sign.c +191 -119
  100. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/sign.h +6 -3
  101. data/ext/pqcrypto/vendor/mldsa-native/mldsa/src/sys.h +16 -42
  102. data/ext/pqcrypto/vendor/mlkem-native/BUILDING.md +72 -0
  103. data/ext/pqcrypto/vendor/mlkem-native/README.md +9 -5
  104. data/ext/pqcrypto/vendor/mlkem-native/RELEASE.md +64 -312
  105. data/ext/pqcrypto/vendor/mlkem-native/mlkem/mlkem_native.c +77 -34
  106. data/ext/pqcrypto/vendor/mlkem-native/mlkem/mlkem_native.h +41 -13
  107. data/ext/pqcrypto/vendor/mlkem-native/mlkem/mlkem_native_asm.S +89 -33
  108. data/ext/pqcrypto/vendor/mlkem-native/mlkem/mlkem_native_config.h +50 -46
  109. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/capability.h +30 -0
  110. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/common.h +30 -0
  111. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/compress.c +1 -0
  112. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/compress.h +4 -5
  113. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/debug.c +1 -0
  114. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/fips202.c +15 -0
  115. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/fips202.h +23 -8
  116. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/fips202x4.c +11 -3
  117. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/fips202x4.h +7 -1
  118. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/keccakf1600.c +8 -0
  119. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/keccakf1600.h +8 -0
  120. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/aarch64/src/keccak_f1600_x1_scalar_aarch64_asm.S +5 -2
  121. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/aarch64/src/keccak_f1600_x1_v84a_aarch64_asm.S +4 -4
  122. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/aarch64/src/keccak_f1600_x2_v84a_aarch64_asm.S +4 -4
  123. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/aarch64/src/keccak_f1600_x4_v8a_scalar_hybrid_aarch64_asm.S +8 -3
  124. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/aarch64/src/keccak_f1600_x4_v8a_v84a_scalar_hybrid_aarch64_asm.S +8 -4
  125. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/armv81m/src/keccak_f1600_x4_mve.S +4 -2
  126. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/armv81m/src/keccak_f1600_x4_state_extract_bytes_mve.S +37 -19
  127. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/armv81m/src/keccak_f1600_x4_state_xor_bytes_mve.S +37 -19
  128. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/auto.h +2 -2
  129. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/x86_64/auto.h +47 -0
  130. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/x86_64/keccak_f1600_x1_avx512.h +37 -0
  131. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/x86_64/keccak_f1600_x4_avx512.h +37 -0
  132. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/x86_64/src/fips202_native_x86_64.h +24 -0
  133. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/x86_64/src/keccak_f1600_x1_avx512_asm.S +573 -0
  134. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/x86_64/src/keccak_f1600_x4_avx2_asm.S +46 -18
  135. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/x86_64/src/keccak_f1600_x4_avx512_asm.S +678 -0
  136. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/fips202/native/x86_64/src/keccakf1600_constants.c +13 -4
  137. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/indcpa.c +1 -2
  138. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/kem.c +7 -5
  139. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/kem.h +29 -5
  140. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/meta.h +156 -0
  141. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/arith_native_aarch64.h +137 -3
  142. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/compress_d5_table.c +43 -0
  143. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/decompress_d10_table.c +50 -0
  144. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/decompress_d11_table.c +53 -0
  145. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/decompress_d4_table.c +44 -0
  146. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/decompress_d5_table.c +53 -0
  147. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/mlkem_intt_aarch64_asm.S +5 -3
  148. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/mlkem_ntt_aarch64_asm.S +4 -2
  149. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/mlkem_poly_compress_d10_aarch64_asm.S +439 -0
  150. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/mlkem_poly_compress_d11_aarch64_asm.S +452 -0
  151. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/mlkem_poly_compress_d4_aarch64_asm.S +106 -0
  152. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/mlkem_poly_compress_d5_aarch64_asm.S +124 -0
  153. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/mlkem_poly_decompress_d10_aarch64_asm.S +108 -0
  154. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/mlkem_poly_decompress_d11_aarch64_asm.S +116 -0
  155. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/mlkem_poly_decompress_d4_aarch64_asm.S +93 -0
  156. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/mlkem_poly_decompress_d5_aarch64_asm.S +104 -0
  157. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/mlkem_poly_frombytes_aarch64_asm.S +84 -0
  158. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/mlkem_poly_mulcache_compute_aarch64_asm.S +4 -2
  159. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/mlkem_poly_reduce_aarch64_asm.S +4 -2
  160. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/mlkem_poly_tobytes_aarch64_asm.S +5 -3
  161. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/mlkem_poly_tomont_aarch64_asm.S +4 -3
  162. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/mlkem_polyvec_basemul_acc_montgomery_cached_k2_aarch64_asm.S +4 -2
  163. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/mlkem_polyvec_basemul_acc_montgomery_cached_k3_aarch64_asm.S +4 -2
  164. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/mlkem_polyvec_basemul_acc_montgomery_cached_k4_aarch64_asm.S +4 -2
  165. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/aarch64/src/mlkem_rej_uniform_aarch64_asm.S +112 -104
  166. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/api.h +0 -1
  167. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/meta.h +2 -2
  168. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/ppc64le/README.md +2 -2
  169. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/ppc64le/meta.h +16 -21
  170. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/ppc64le/src/arith_native_ppc64le.h +1 -0
  171. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/ppc64le/src/consts.c +2 -2
  172. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/ppc64le/src/mlkem_intt_ppc_asm.S +6 -5
  173. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/ppc64le/src/mlkem_ntt_ppc_asm.S +6 -5
  174. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/ppc64le/src/mlkem_poly_tomont_ppc_asm.S +6 -5
  175. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/ppc64le/src/mlkem_reduce_ppc_asm.S +6 -5
  176. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/riscv64/src/rv64v_debug.c +5 -4
  177. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/riscv64/src/rv64v_debug.h +2 -2
  178. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/riscv64/src/rv64v_poly.c +1 -1
  179. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/arith_native_x86_64.h +5 -5
  180. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/mlkem_intt_avx2_asm.S +36 -33
  181. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/mlkem_ntt_avx2_asm.S +67 -65
  182. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/mlkem_nttfrombytes_avx2_asm.S +8 -5
  183. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/mlkem_ntttobytes_avx2_asm.S +6 -3
  184. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/mlkem_nttunpack_avx2_asm.S +5 -3
  185. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/mlkem_poly_compress_d10_avx2_asm.S +7 -5
  186. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/mlkem_poly_compress_d11_avx2_asm.S +7 -4
  187. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/mlkem_poly_compress_d4_avx2_asm.S +7 -5
  188. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/mlkem_poly_compress_d5_avx2_asm.S +7 -4
  189. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/mlkem_poly_decompress_d10_avx2_asm.S +7 -4
  190. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/mlkem_poly_decompress_d11_avx2_asm.S +6 -4
  191. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/mlkem_poly_decompress_d4_avx2_asm.S +7 -4
  192. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/mlkem_poly_decompress_d5_avx2_asm.S +6 -4
  193. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/mlkem_poly_mulcache_compute_avx2_asm.S +5 -3
  194. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/mlkem_polyvec_basemul_acc_montgomery_cached_k2_avx2_asm.S +118 -115
  195. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/mlkem_polyvec_basemul_acc_montgomery_cached_k3_avx2_asm.S +174 -171
  196. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/mlkem_polyvec_basemul_acc_montgomery_cached_k4_avx2_asm.S +230 -227
  197. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/mlkem_reduce_avx2_asm.S +17 -15
  198. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/mlkem_rej_uniform_avx2_asm.S +7 -6
  199. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/native/x86_64/src/mlkem_tomont_avx2_asm.S +5 -3
  200. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/poly_k.c +4 -9
  201. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/poly_k.h +1 -1
  202. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/sys.h +31 -44
  203. data/ext/pqcrypto/vendor/mlkem-native/mlkem/src/verify.h +1 -1
  204. data/lib/pq_crypto/version.rb +1 -1
  205. data/script/vendor_libs.rb +6 -6
  206. metadata +36 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: db8e5b65d14cc5dcc4950a2da14b781efcf4c8dd17774cffc076e9d5591509ca
4
- data.tar.gz: '09cf8c3e990a416ab0f8f77fe2a2a6067fdd8a3f4d00607a4162e4259d6044bd'
3
+ metadata.gz: c37dfbf2c2a134c23ec103f7dd71d1075f568c765f9fe42ff4de6600ceaa4031
4
+ data.tar.gz: afe4eb3ff85ee6912215ea8d65c5f6a65034c7a63d510443bac2e6efeb595af9
5
5
  SHA512:
6
- metadata.gz: 81a8509efb9d280100975a8e4a9a0a6aab70061b49bbc48a396de490723c316abe63442cfb041c68dbeefd9383fba647b198318082723ffb9bace9d0ffd12c78
7
- data.tar.gz: 1055665295f23df22a53880fbf02a2e8d0c0cb33f1b65a43b1fe2f1f040da829bcaf4895440093addc432f15fb9c21792f28bf41e2949c90b9c93bc2784e5e93
6
+ metadata.gz: 36bab2b28057188894f6ec2ac2615acb855acb562599cb98ba5f6869cae95f438cf88a37569b5cc3c86128bed8527f743d9d781de11b559203b9cc2256b99c52
7
+ data.tar.gz: a855fe39d301706b99aaa42d8ce516d424845d078495f4ad9a0b58d480d0ff6d4d6a66e47001f2a3dca82e961421f43caaf52727e7a4a7a7a45037899717793e
data/CHANGELOG.md CHANGED
@@ -1,5 +1,16 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.6.9] - 2026-11-28
4
+
5
+ ### Changed
6
+
7
+ - Update native mlkem and mldsa from `v2.0.0` to `v2.1.0`.
8
+ The upstream releases add AVX-512 Keccak backends on x86_64, faster AArch64
9
+ arithmetic, and lower memory use. They also fix alignment faults in AArch64
10
+ rejection sampling. mlkem-native now keeps decapsulation intermediates out
11
+ of the caller's output buffer. The gem's public API and encoded formats are
12
+ unchanged; no wrapper changes were needed.
13
+
3
14
  ## [0.6.8] - 2026-10-28
4
15
 
5
16
  ### Changed
data/README.md CHANGED
@@ -89,9 +89,7 @@ bundle exec rake compile
89
89
 
90
90
  Upstream pins are recorded in `ext/pqcrypto/vendor/.vendored` and enforced by
91
91
  `bundle exec rake vendor:verify`. Both `mlkem-native` and `mldsa-native` are
92
- pinned at `v2.0.0`. For `mldsa-native` this is the first stable release; it
93
- carries the major version `2` only so that its API and configuration line up
94
- with `mlkem-native` v2. Upstream guarantees that APIs and configuration options
92
+ pinned at `v2.1.0`. Upstream guarantees that APIs and configuration options
95
93
  not marked experimental stay stable until a `v3`.
96
94
 
97
95
  The default build uses the portable native source path. Upstream native assembly
@@ -2,6 +2,6 @@
2
2
  #ifndef PQCRYPTO_VERSION_H
3
3
  #define PQCRYPTO_VERSION_H
4
4
 
5
- #define PQCRYPTO_VERSION "0.6.8"
5
+ #define PQCRYPTO_VERSION "0.6.9"
6
6
 
7
7
  #endif
@@ -2,11 +2,11 @@
2
2
  backend=PQ Code Package native only
3
3
  pqclean=removed
4
4
  mlkem_native_repo=https://github.com/pq-code-package/mlkem-native.git
5
- mlkem_native_ref=v2.0.0
6
- mlkem_native_commit=d1b2fe782888bdb761a50336012923180be7f502
7
- mlkem_native_tree_sha256=18bfa9ea4e2232bdf56f8ec374b62d10e50b99a30cb08aafc18d0b97e00cd06f
5
+ mlkem_native_ref=v2.1.0
6
+ mlkem_native_commit=4d69d6b0358e678e3a694ea1bb8404a41770f68e
7
+ mlkem_native_tree_sha256=0fb0b44188f63d42ca0049bd66bee26187d0317fa28489eb6b6c9ce30ef97dff
8
8
  mldsa_native_repo=https://github.com/pq-code-package/mldsa-native.git
9
- mldsa_native_ref=v2.0.0
10
- mldsa_native_commit=834a90d5e846ffa1e1611bd24e160bb2e9b86d35
11
- mldsa_native_tree_sha256=25b3c3949d2ed37d1ad5d4722c8476d13deb2a0bb945f12444f463378d69375d
12
- manifest_sha256=4bcf7cc4d0ac0d0e66ebb9612042960dc1197838f26bbedb16e3b6a3978e264c
9
+ mldsa_native_ref=v2.1.0
10
+ mldsa_native_commit=c9999d77599a9f0f0281ad745ad59a83f177b22c
11
+ mldsa_native_tree_sha256=b00aa86111dc66fe8bad91ddf083817677d4d3685fcf6eac70e6572d96dc907f
12
+ manifest_sha256=0bab79fb620e4823bbdab55d01032e24eb94e30bcf13814369151915920c4951
@@ -37,6 +37,16 @@ make run_acvp
37
37
 
38
38
  The resulting binaries can be found in `test/build` (their full path is printed by `make`).
39
39
 
40
+ To check that the assembled byte code in the final libraries match the machine code that the
41
+ [HOL Light Proofs](proofs/hol_light) reason about, use
42
+
43
+ ```bash
44
+ make CHECK_BINARY=1 # with any target, e.g. `make test CHECK_BINARY=1`
45
+ ```
46
+
47
+ This checks each library and binary as `make` builds it, and fails on a mismatch. Files that
48
+ are already built are not checked again; use `scripts/check-binary FILE ...` for those.
49
+
40
50
  For benchmarking, specify the cycle counting method. Currently, **mldsa-native** is supporting NO, PERF, PMU, and MAC:
41
51
  * `NO` means that no cycle counting will be used; this can be used to confirm that benchmarks compile fine.
42
52
  * `PERF` uses the `perf` kernel module for cycle counting. Does not work on Apple platforms.
@@ -66,6 +76,67 @@ will compile and run functionality tests. Similarly,
66
76
 
67
77
  will compile and run benchmarks, using PERF for cycle counting (`-c PERF`) and running as root (`-r`).
68
78
 
79
+ On Linux, `./scripts/tests` builds with `CHECK_BINARY=1`, described above, if readelf and
80
+ `python3` with PyYAML are available; `--no-check-binary` turns this off.
81
+
82
+ #### Test platforms
83
+
84
+ The `--platform` option supplies non-empty cross-compilation and execution
85
+ settings, or selects the platform Makefile. It does not change which tests run.
86
+ Empty low-level options and profile values that are not specified preserve the
87
+ existing environment. The `native` profile adds no compile or run overrides.
88
+
89
+ ```bash
90
+ # Native host
91
+ ./scripts/tests func
92
+
93
+ # GNU/Linux AArch64 under QEMU user mode
94
+ nix develop .#cross-aarch64 --command \
95
+ ./scripts/tests func --platform linux/aarch64
96
+
97
+ # No-MMU AArch64 QEMU virt machine
98
+ nix develop .#cross-aarch64-embedded --command \
99
+ ./scripts/tests func --platform baremetal/aarch64-virt
100
+
101
+ # AVR under simavr
102
+ nix develop .#cross-avr --command \
103
+ ./scripts/tests func --platform baremetal/avr --opt=no_opt
104
+
105
+ # Zephyr on the default QEMU board
106
+ nix develop .#zephyr --command \
107
+ ./scripts/tests func --platform zephyr
108
+ ```
109
+
110
+ Available profiles:
111
+
112
+ | Platform | Nix shell | Execution environment |
113
+ | -------- | --------- | --------------------- |
114
+ | `native` | `default` | Inherited environment (normally the current host) |
115
+ | `linux/x86_64` | `cross-x86_64` or `cross` | QEMU user mode |
116
+ | `linux/x86_64-no-avx2` | `cross-x86_64` or `cross` | QEMU Snowridge, no AVX2 |
117
+ | `linux/aarch64` | `cross-aarch64` or `cross` | QEMU user mode |
118
+ | `linux/aarch64_be` | `cross-aarch64_be` or `cross` | QEMU user mode |
119
+ | `linux/ppc64le` | `cross-ppc64le` or `cross` | QEMU user mode |
120
+ | `linux/riscv64-rvv128` | `cross-riscv64` or `cross` | QEMU RVV, VLEN=128 |
121
+ | `linux/riscv64-rvv256` | `cross-riscv64` or `cross` | QEMU RVV, VLEN=256 |
122
+ | `linux/riscv64-rvv512` | `cross-riscv64` or `cross` | QEMU RVV, VLEN=512 |
123
+ | `linux/riscv64-rvv1024` | `cross-riscv64` or `cross` | QEMU RVV, VLEN=1024 |
124
+ | `linux/riscv32` | `cross-riscv32` or `cross` | QEMU user mode |
125
+ | `baremetal/aarch64-virt` | `cross-aarch64-embedded` | QEMU system emulation |
126
+ | `baremetal/avr` | `cross-avr` | simavr |
127
+ | `zephyr` | `zephyr` | Zephyr under QEMU or on supported hardware |
128
+
129
+ Explicit non-empty `--cross-prefix` and `--exec-wrapper` values override
130
+ profile values; empty values are treated like omitted options. `--cflags` and
131
+ `--ldflags` extend profile values. Bare-metal and Zephyr profiles select
132
+ their existing platform Makefile, which supplies toolchain, linker, and runtime
133
+ defaults.
134
+
135
+ The standalone example Makefiles do not consume platform Makefiles. The
136
+ `examples` command, and `all` unless passed `--no-examples`, therefore reject
137
+ bare-metal, Zephyr, and explicit `--extra-makefile` configurations. Prefix-based
138
+ Linux profiles remain supported.
139
+
69
140
  For detailed information on how to use the script, please refer to
70
141
  `./scripts/tests --help`.
71
142
 
@@ -22,7 +22,7 @@ mldsa-native allows developers to support ML-DSA with minimal performance and ma
22
22
 
23
23
  **Maintainability and Safety:** Memory safety, type safety and absence of various classes of timing leakage are automatically checked on every change, using a combination of static model checking (using CBMC) and dynamic instrumentation (using valgrind). This reduces review and maintenance burden and accelerates safe code delivery. See [Formal Verification](#formal-verification) and [Security](#security).
24
24
 
25
- **Architecture Support:** Native backends are added under a unified interface, minimizing duplicated code and reasoning. mldsa-native comes with backends for AArch64 and x86-64. See [Design](#design).
25
+ **Architecture Support:** Native backends are added under a unified interface, minimizing duplicated code and reasoning. mldsa-native comes with backends for AArch64, x86-64 (AVX2 and AVX-512 for FIPS-202), and RV32-IM, and an experimental backend for Armv8.1-M. See [Design](#design).
26
26
 
27
27
  ## Quickstart for Ubuntu
28
28
 
@@ -51,19 +51,28 @@ make test
51
51
  mldsa-native is used in
52
52
  - AWS' Cryptography library [AWS-LC](https://github.com/aws/aws-lc/)
53
53
  - [libOQS](https://github.com/open-quantum-safe/liboqs/) of the Open Quantum Safe project
54
+ - [PyCryptodome](https://github.com/Legrandin/pycryptodome) - a self-contained Python package of low-level cryptographic primitives
55
+ - [TF-PSA-Crypto](https://github.com/Mbed-TLS/TF-PSA-Crypto) - the PSA Cryptography API implementation of Mbed TLS
54
56
  - [Pavona](https://github.com/pavona/pavona) - a library of modular, tapeout-proven, and secure-by-default open silicon blocks
55
57
  - [CHERIoT-PQC](https://github.com/CHERIoT-Platform/cheriot-pqc) — post-quantum cryptography support for the CHERIoT platform
56
58
 
57
59
  ## Formal Verification
58
60
 
59
- We use the [C Bounded Model Checker (CBMC)](https://github.com/diffblue/cbmc) to prove absence of various classes of undefined behaviour in C, including out of bounds memory accesses and integer overflows. The proofs cover all C code in [mldsa/src/*](mldsa) and [mldsa/src/fips202/*](mldsa/src/fips202) involved in running mldsa-native with its C backend. See [proofs/cbmc](proofs/cbmc) for details.
60
-
61
- All AArch64 and x86_64 assembly is proved functionally correct and memory-safe at the object-code level, using
62
- [HOL-Light](https://hol-light.github.io/) and the [s2n-bignum](https://github.com/awslabs/s2n-bignum) verification
63
- infrastructure. All routines are additionally proved to have secret-independent timing, with two exceptions. The
64
- matrix sampler `rej_uniform` operates on public data only, and is deliberately variable-time. The secret-vector
65
- samplers `rej_uniform_eta{2,4}` _do_ have secret-independent timing, but this property is not yet backed by proof.
66
- See [proofs/hol_light](proofs/hol_light) for details.
61
+ We use the [C Bounded Model Checker (CBMC)](https://github.com/diffblue/cbmc) to prove absence of various classes of undefined behaviour in C, including out of bounds memory accesses and integer overflows. The proofs cover all C code in [mldsa/src/*](mldsa) and [mldsa/src/fips202/*](mldsa/src/fips202), except for the Armv8.1-M backend and the debug code. See [proofs/cbmc](proofs/cbmc) for details.
62
+
63
+ All AArch64 and x86_64 assembly, and the RV32IM arithmetic backend, are
64
+ proved functionally correct and memory-safe at the object-code level using
65
+ [HOL-Light](https://hol-light.github.io/) and the
66
+ [s2n-bignum](https://github.com/awslabs/s2n-bignum) verification
67
+ infrastructure. All routines are additionally proved to have
68
+ secret-independent timing, with the rejection samplers as special cases. The
69
+ matrix sampler `rej_uniform` operates on public data only and is deliberately
70
+ variable-time. The secret-vector samplers `rej_uniform_eta{2,4}` are proved to
71
+ have secret-independent timing: their event trace depends only on the public
72
+ pointers and on which candidates are accepted or rejected, never on the
73
+ accepted coefficient values. That reject pattern is safe to leak, being
74
+ statistically independent of those values. See
75
+ [proofs/hol_light](proofs/hol_light) for details.
67
76
 
68
77
  Finally, [proofs/isabelle](proofs/isabelle/compress) contains proofs in [Isabelle/HOL](https://isabelle.in.tum.de/) of the correctness of
69
78
  different approaches for computing the scalar decomposition routines used in ML-DSA. Those are still experimental and do not yet operate
@@ -77,11 +86,14 @@ pointwise-multiplication assembly; see its [README](proofs/isabelle/neon_ntt/REA
77
86
 
78
87
  All assembly in mldsa-native is constant-time in the sense that it is free of secret-dependent control flow, memory access,
79
88
  and instructions that are commonly variable-time, thwarting most timing side channels. C code is hardened against compiler-introduced
80
- timing side channels through suitable barriers and constant-time patterns.
89
+ timing side channels through suitable barriers and constant-time patterns. The C code assumes constant-time 32x32->32 and 32x32->64 multiplication,
90
+ which some targets do not provide, e.g., cores without a hardware multiplier or with early-terminating multiply instructions.
81
91
 
82
92
  Absence of secret-dependent branches, memory-access patterns and variable-latency instructions is also tested using `valgrind`
83
93
  with various combinations of compilers and compilation options.
84
94
 
95
+ **Stack zeroization.** mldsa-native zeroizes intermediate buffers before returning, but this does not eliminate leakage of secret data on the stack. If you need bullet-proof zeroization of the stack, you need to consider additional measures; see [API conventions](API-CONVENTIONS.md#secret-data-left-on-the-stack).
96
+
85
97
  **Other attacks.** mldsa-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.
86
98
 
87
99
  ## Design
@@ -96,8 +108,11 @@ mldsa-native currently offers the following backends:
96
108
 
97
109
  * Default portable C backend
98
110
  * 64-bit Arm backend (using Neon)
99
- * 64-bit Intel/AMD backend (using AVX2)
111
+ * 64-bit Intel/AMD backend (using AVX2; AVX-512 for FIPS-202)
100
112
  * 32-bit Armv8.1-M backend (using Helium/MVE). This is still experimental and disabled by default.
113
+ * 32-bit RISC-V backend (RV32-IM, base integer + M-extension only). The
114
+ fast-multiplier profile is selected by default when native arithmetic is
115
+ enabled; a shift/add profile is also available.
101
116
 
102
117
  If you'd like contribute new backends, please reach out!
103
118
 
@@ -1,160 +1,87 @@
1
1
  [//]: # (SPDX-License-Identifier: CC-BY-4.0)
2
2
 
3
- mldsa-native v2.0.0
3
+ mldsa-native v2.1.0
4
4
  ===================
5
5
 
6
6
  Release notes
7
7
  -------------
8
8
 
9
- v2.0.0 is the first stable release of mldsa-native, a secure, fast and portable C90 implementation of
10
- [ML-DSA](https://csrc.nist.gov/pubs/fips/204/final) derived from the
11
- [ML-DSA reference implementation](https://github.com/pq-crystals/dilithium).
12
- It carries the version number v2.0.0 rather than v1.0.0 because its public API and configuration are aligned with
13
- those of the upcoming v2 release of the sister project
14
- [mlkem-native](https://github.com/pq-code-package/mlkem-native).
15
-
16
- mldsa-native v2.0.0 offers:
17
- * High maintainability and extensibility through modular frontend/backend design.
18
- * High performance through AArch64 (Neon) and x86_64 (AVX2) assembly backends and the use of the
19
- [SLOTHY super-optimizer](https://github.com/slothy-optimizer/slothy).
20
- * High assurance through memory- and type-safety proofs for the C frontend and backend (CBMC),
21
- functional-correctness and memory-safety proofs for both the AArch64 and x86_64 assembly
22
- backends (HOL Light and s2n-bignum), and extensive constant-time testing.
23
-
24
- mldsa-native v2.0.0 is uniformly licensed Apache-2.0 OR MIT OR ISC, giving consumers the choice to use any of these
25
- licenses.
26
-
27
- Assurance
9
+ mldsa-native v2.1.0 adds further backends, reduces RAM usage, and
10
+ strengthens the trust anchor for its verification artifacts.
11
+
12
+ See the [full change log](https://github.com/pq-code-package/mldsa-native/compare/v2.0.0...42e60d0f4d912306b436f5258c6cdc5aeed1b29e)
13
+ and the [v2.0.0 release notes](https://github.com/pq-code-package/mldsa-native/blob/v2.0.0/RELEASE.md).
14
+
15
+ Backends
16
+ --------
17
+
18
+ - **32-bit RISC-V.** A new ML-DSA arithmetic backend supports RV32IM.
19
+ Constant-time operation requires data-independent multiplication latency.
20
+ See the [RV32IM backend guide](dev/riscv32/README.md).
21
+ ([#1119](https://github.com/pq-code-package/mldsa-native/pull/1119),
22
+ [#1426](https://github.com/pq-code-package/mldsa-native/pull/1426))
23
+ - **x86_64.** A new FIPS 202 backend accelerates Keccak on AVX-512 targets.
24
+ If a custom runtime check rejects AVX-512, the AVX-512 routines fall back
25
+ to C. If you require a portable build applying AVX-512, AVX2 or C backend
26
+ as applicable to the host, you currently need to write custom dispatch logic.
27
+ In CI benchmarks of optimized ML-DSA-87 builds on EC2 c7a, c7i, c8a,
28
+ and c8i, AVX-512 reduced cycle counts by 22–29% for key generation,
29
+ 15–19% for signing, and 18–27% for verification. The gains vary by CPU.
30
+ ([#1584](https://github.com/pq-code-package/mldsa-native/pull/1584))
31
+ - **AArch64.** The Neon backend has faster rejection sampling. Across
32
+ optimized ML-DSA-87 benchmarks on Graviton2 through Graviton5, the sampler
33
+ update cut cycle counts by 3.0–4.5% for key generation, 1.1–1.5% for
34
+ signing, and 2.2–3.3% for verification.
35
+ ([#1582](https://github.com/pq-code-package/mldsa-native/pull/1582))
36
+
37
+ See the [CI benchmarks](https://pq-code-package.github.io/mldsa-native/dev/bench/)
38
+ for the full results.
39
+
40
+ RAM usage
28
41
  ---------
29
42
 
30
- v2.0.0 marks the completion of the two formal-verification efforts underpinning mldsa-native: the HOL Light proofs for
31
- the AArch64 (Neon) and x86_64 (AVX2) assembly backends and the CBMC proofs for the C code are now both complete.
32
-
33
- - **AArch64 and x86_64 assembly proved in HOL Light.** Every routine in both the AArch64 (Neon) and x86_64 (AVX2)
34
- backends is proved functionally correct and memory-safe at the object-code level, using
35
- [HOL Light](https://hol-light.github.io/) and the [s2n-bignum](https://github.com/awslabs/s2n-bignum) verification
36
- infrastructure. All routines except the secret-vector rejection samplers (`rej_uniform_eta{2,4}`) are additionally
37
- proved to have secret-independent timing (those samplers _do_ have secret-independent timing, but this property is
38
- not yet backed by proof).
39
- - **CBMC proofs for the C code**, establishing memory safety, type safety and absence of various classes of undefined
40
- behaviour for all C code involved in running mldsa-native with its C backend.
41
-
42
- See [SOUNDNESS.md](SOUNDNESS.md) for more detail on the scope, assumptions and residual risks of the verification
43
- work; it shares its methodology, formal models and trusted computing base with the sister project
44
- [mlkem-native](https://github.com/pq-code-package/mlkem-native).
45
-
46
- Breaking changes since v1.0.0-beta2
47
- -----------------------------------
48
-
49
- Between the last beta release
50
- ([v1.0.0-beta2](https://github.com/pq-code-package/mldsa-native/releases/tag/v1.0.0-beta2)) and this release, a number
51
- of breaking changes to the public API and configuration have been introduced. Consumers upgrading from
52
- `v1.0.0-beta2` should be aware of the following:
53
-
54
- - **`siglen` removed from the signing and verification APIs.** Signing functions no longer take a `size_t *siglen`
55
- out-parameter and verification functions no longer take a `size_t siglen` in-parameter; signatures are always
56
- `MLDSA_BYTES(MLD_CONFIG_PARAMETER_SET)` bytes and verification now takes a fixed-size signature array. Drop the
57
- `siglen` argument at every call site. ([#1240](https://github.com/pq-code-package/mldsa-native/pull/1240))
58
- - **SUPERCOP-style aliases and constants removed.** The `crypto_sign_keypair` / `crypto_sign_signature` /
59
- `crypto_sign_verify` aliases, the `CRYPTO_SECRETKEYBYTES` / `CRYPTO_PUBLICKEYBYTES` / `CRYPTO_BYTES` size macros, and
60
- the `MLD_CONFIG_NO_SUPERCOP` option were removed. Use the namespaced API directly and derive sizes from
61
- `MLDSA_SECRETKEYBYTES` / `MLDSA_PUBLICKEYBYTES` / `MLDSA_BYTES`.
62
- ([#1248](https://github.com/pq-code-package/mldsa-native/pull/1248))
63
- - **SUPERCOP signed-message API removed.** The combined signed-message functions (`crypto_sign` / `crypto_sign_open`
64
- and their namespaced equivalents, which produced/consumed signature-prepended messages) were removed. Applications
65
- needing that format should build it on top of the detached `signature` / `verify` API.
66
- ([#1236](https://github.com/pq-code-package/mldsa-native/pull/1236))
67
- - **`MLD_ERR_FAIL` split into specific error codes.** Failure conditions that previously all surfaced as
68
- `MLD_ERR_FAIL` now have dedicated codes: `MLD_ERR_INVALID_SIGNATURE` (verification rejected the signature),
69
- `MLD_ERR_INVALID_KEY` (`pk_from_sk` found the secret key malformed or internally inconsistent), `MLD_ERR_PCT_FAIL`
70
- (the key-generation pairwise consistency test failed) and `MLD_ERR_INVALID_ARG` (unsupported pre-hash algorithm or
71
- context string longer than 255 bytes). The previously existing codes keep their values, but callers matching on
72
- `MLD_ERR_FAIL` must be updated; it is no longer externally observable.
73
- ([#1309](https://github.com/pq-code-package/mldsa-native/pull/1309))
74
- - **Legacy header-time configuration removed.** The deprecated `MLD_CONFIG_API_*` macros
75
- (`MLD_CONFIG_API_PARAMETER_SET`, `MLD_CONFIG_API_NAMESPACE_PREFIX`, `MLD_CONFIG_API_NO_SUPERCOP`,
76
- `MLD_CONFIG_API_CONSTANTS_ONLY`, `MLD_CONFIG_API_QUALIFIER`) were removed in favour of configuring through the
77
- [config file](mldsa/mldsa_native_config.h) (`MLD_CONFIG_PARAMETER_SET`, `MLD_CONFIG_NAMESPACE_PREFIX`,
78
- `MLD_CONFIG_CONSTANTS_ONLY`, `MLD_CONFIG_EXTERNAL_API_QUALIFIER`). For multi-level builds, set
79
- `MLD_CONFIG_MULTILEVEL_BUILD` and do not bake the 44/65/87 suffix into the namespace prefix; the security level is
80
- now appended automatically. ([#1206](https://github.com/pq-code-package/mldsa-native/pull/1206),
81
- [#1270](https://github.com/pq-code-package/mldsa-native/pull/1270))
82
- - **FIPS-202 backend flags renamed to the `MLD_USE_NATIVE_*` convention.** Custom FIPS-202 backends must rename the
83
- flags they define: `MLD_USE_FIPS202_X1_NATIVE` -> `MLD_USE_NATIVE_FIPS202_X1`, `MLD_USE_FIPS202_X4_NATIVE` ->
84
- `MLD_USE_NATIVE_FIPS202_X4`, `MLD_USE_FIPS202_X4_XOR_BYTES_NATIVE` -> `MLD_USE_NATIVE_FIPS202_X4_XOR_BYTES`, and
85
- `MLD_USE_FIPS202_X4_EXTRACT_BYTES_NATIVE` -> `MLD_USE_NATIVE_FIPS202_X4_EXTRACT_BYTES`. Default builds are
86
- unaffected. ([#1207](https://github.com/pq-code-package/mldsa-native/pull/1207))
87
- - **Capability enum values prefixed with the architecture.** `mld_sys_cap` values were renamed
88
- (`MLD_SYS_CAP_AVX2` -> `MLD_SYS_CAP_X86_64_AVX2`, `MLD_SYS_CAP_SHA3` -> `MLD_SYS_CAP_AARCH64_SHA3`,
89
- `MLD_SYS_CAP_MVE` -> `MLD_SYS_CAP_ARMV81M_MVE`). This affects integrators with custom native backends or a custom
90
- capability-check function. ([#1208](https://github.com/pq-code-package/mldsa-native/pull/1208))
91
- - **Minimum FIPS 204 signing-attempt bound raised from 814 to 821.** Builds that set
92
- `MLD_CONFIG_MAX_SIGNING_ATTEMPTS` explicitly must now use a value of at least 821; 814 through 820 no longer compile.
93
- The [FIPS 204 errata](https://csrc.nist.gov/files/pubs/fips/204/final/docs/fips-204-potential-updates.xlsx) revises
94
- the Repetitions row of Table 1 to 4.36 / 5.14 / 3.91 and, with it, the minimum loop-iteration limit for
95
- `ML-DSA.Sign_internal` in Table 3 from 814 to 821.
96
- ([#1349](https://github.com/pq-code-package/mldsa-native/pull/1349))
97
-
98
- We hope these simplifications make integrations easier for the majority of consumers. Moving forward, APIs and
99
- configuration options not marked as experimental are guaranteed to be stable until a new major version (`v3`) is
100
- released; additional APIs and configuration options may be introduced at any time.
101
-
102
- If the breaking changes above cause any issues for your application, please
103
- [open a GitHub issue](https://github.com/pq-code-package/mldsa-native/issues). If your application could benefit from
104
- additional APIs or configuration options, please open an issue as well.
105
-
106
- What's New
107
- ----------
108
-
109
- ### Restartable and bounded signing for real-time systems
110
-
111
- ML-DSA signing is a rejection-sampling loop: it draws a candidate signature and retries until one passes the
112
- bounds checks. The number of attempts is not known in advance, so a single signing call has an *unbounded* worst-case
113
- runtime.
114
- For environments with strict timing requirements that is a problem: a signing call cannot be allowed to run for an
115
- arbitrary number of iterations before returning control to the caller.
116
-
117
- mldsa-native addresses this with three optional, independent **signing hooks** around the rejection-sampling loop,
118
- enabled with `MLD_CONFIG_SIGN_HOOK_ATTEMPT`, `MLD_CONFIG_SIGN_HOOK_RESUME` and `MLD_CONFIG_SIGN_HOOK_FINISH`. The
119
- attempt hook runs before each attempt and may **pause** the operation; signing then returns the new
120
- `MLD_ERR_SIGNING_PAUSED` code instead of iterating further. At the start of the next call the resume hook is queried
121
- for the attempt to restart from (the one the attempt hook recorded when it paused), so signing continues exactly where
122
- it left off; the finish hook fires with the succeeding attempt once a signature is found. The split, resumed run
123
- produces exactly the same signature as a single uninterrupted call.
124
-
125
- To bound per-call runtime, the attempt hook pauses once a per-call budget is spent, and the caller re-invokes signing
126
- in a loop until it completes.
127
-
128
- For concurrent or interleaved signers, hold the resume state per caller by enabling `MLD_CONFIG_CONTEXT_PARAMETER`
129
- instead of a global; each API function then forwards a context argument to the hooks. A complete example is in
130
- [examples/restartable_sign](examples/restartable_sign).
131
- ([#1237](https://github.com/pq-code-package/mldsa-native/pull/1237))
132
-
133
- This feature is experimental: its scope, configuration and hook signatures may change, including after v2.
134
- We would love to hear your feedback on this feature.
135
-
136
- ### API and configuration
137
-
138
- - **`MLD_SYS_AARCH64_FAST_SHA3`** opts non-Apple AArch64 cores with fast SHA3 instructions into the SHA3-instruction
139
- path. ([#1254](https://github.com/pq-code-package/mldsa-native/pull/1254))
140
-
141
- ### Platforms and testing
142
-
143
- - **Windows MSVC** test support (KAT, Wycheproof, allocation-failure and RNG-failure tests).
144
- ([#1247](https://github.com/pq-code-package/mldsa-native/pull/1247))
145
- - **AVR baremetal / 16-bit** platform support. ([#1158](https://github.com/pq-code-package/mldsa-native/pull/1158))
146
- - **Zephyr** hardware and QEMU test platforms, including NUCLEO-N657X0-Q.
147
- ([#1259](https://github.com/pq-code-package/mldsa-native/pull/1259),
148
- [#1269](https://github.com/pq-code-package/mldsa-native/pull/1269))
149
- - **ABI checker** for AArch64, x86_64 (SysV) and Armv8.1-M+MVE.
150
- ([#1195](https://github.com/pq-code-package/mldsa-native/pull/1195))
151
-
152
- ### Documentation
153
-
154
- - **FIPS 204 references** annotated throughout the code and expanded in the documentation, mapping the implementation
155
- to [the standard](https://csrc.nist.gov/pubs/fips/204/final).
156
- - **[API-CONVENTIONS.md](API-CONVENTIONS.md)** documents the conventions shared by all public functions: return
157
- values, pointer validity (all pointers are assumed valid and non-NULL, except a pointer paired with a length, which
158
- may be NULL when that length is `0`), and the state of output buffers on error (left either unchanged or fully
159
- zeroized, never holding partially computed data).
43
+ Key generation, public-key recovery, and signing use less RAM. The table
44
+ compares large allocations in low-memory builds (`MLD_CONFIG_REDUCE_RAM`)
45
+ between v2.0.0 and v2.1.0, in decimal kilobytes. liboqs now uses this mode
46
+ with `OQS_MEMOPT_BUILD`.
47
+ ([#1410](https://github.com/pq-code-package/mldsa-native/pull/1410),
48
+ [#1345](https://github.com/pq-code-package/mldsa-native/pull/1345),
49
+ [#1529](https://github.com/pq-code-package/mldsa-native/pull/1529))
50
+
51
+ | Parameter set | Key generation without PCT | Public-key recovery | Signing |
52
+ | --- | ---: | ---: | ---: |
53
+ | ML-DSA-44 | 11.6 → 7.5 kB | 13.2 → 10.1 kB | 13.1 → 9.8 kB |
54
+ | ML-DSA-65 | 14.7 → 8.5 kB | 17.1 → 11.9 kB | 17.2 → 11.9 kB |
55
+ | ML-DSA-87 | 18.8 → 10.6 kB | 22.0 → 14.8 kB | 21.3 → 14.2 kB |
56
+
57
+ Total stack usage also includes other local allocations. See
58
+ [mldsa_native.h](mldsa/mldsa_native.h).
59
+
60
+ Trust
61
+ -----
62
+
63
+ With new proofs being primarily written by AI, the soundness of verification
64
+ is of increasing importance.
65
+
66
+ v2.1 introduces proof capture and replay using [HOLTrace](https://holtrace.cr.yp.to/)
67
+ to remove the need to review and trust HOL Light proof scripts. In particular, this
68
+ detects proof scripts that cheat by adding new axioms, bypassing the kernel, or using
69
+ non-standard definitions.
70
+
71
+ See [hol_trace/README.md](proofs/hol_light/hol_trace/README.md)
72
+ and [SOUNDNESS.md](SOUNDNESS.md) for details.
73
+ ([#1551](https://github.com/pq-code-package/mldsa-native/pull/1551))
74
+
75
+ CBMC now checks 211 of 218 64-bit proof harnesses with at least two distinct
76
+ solvers. This reduces reliance on any single solver. See
77
+ [SOUNDNESS.md](SOUNDNESS.md#cbmc-proofs-discharged-by-a-single-solver)
78
+ for the risks of single-solver proofs.
79
+ ([#1423](https://github.com/pq-code-package/mldsa-native/pull/1423),
80
+ [issue #1527](https://github.com/pq-code-package/mldsa-native/issues/1527))
81
+
82
+ Bug fixes
83
+ ---------
160
84
 
85
+ - **AArch64 alignment.** Fixed alignment faults in the rejection samplers on
86
+ targets that require aligned accesses.
87
+ ([#1582](https://github.com/pq-code-package/mldsa-native/pull/1582))