Skip to content

Update mlkem-native to v1.1.0#2376

Merged
dstebila merged 5 commits intoopen-quantum-safe:mainfrom
mkannwischer:mlkem-native-v1.1.0
Apr 7, 2026
Merged

Update mlkem-native to v1.1.0#2376
dstebila merged 5 commits intoopen-quantum-safe:mainfrom
mkannwischer:mlkem-native-v1.1.0

Conversation

@mkannwischer
Copy link
Copy Markdown
Contributor

@mkannwischer mkannwischer commented Mar 11, 2026

mlkem-native v1.1.0 just landed: https://github.com/pq-code-package/mlkem-native/releases/tag/v1.1.0.

This PR updates to the tagged upstream version. In addition, I also removed the constant-time passes: mlkem-native is using explicit declassifications using VALGRIND_MAKE_MEM_DEFINED instead.

Below are some highlights of this release (not all of which are relevant to the liboqs integration):

mlkem-native v1.1.0 marks the completion of the verification of all x86_64 and AArch64 assembly and the introduction of
SOUNDNESS.md documenting the scope, assumptions and risks of the verification work. It also introduces
various configuration options enabling the customization of mlkem-native for different application contexts. Finally,
new backends for RISC-V RVV and Armv8.1-M MVE have been added.

See the full change log here: pq-code-package/mlkem-native@v1.0.0...v1.1.0

What's New

Security

  • Fix missing zeroization of intermediate polynomial vector pkpv in mlk_indcpa_keypair_derand() and mlk_indcpa_enc(). (#1328)
  • Fix missing zeroization of pk and sk buffers on keypair generation failure (e.g. OOM during the pairwise consistency test). (#1559)
  • Fix a 4-byte buffer overread in x86_64 rejection sampling assembly. The overread was within the stack frame and the excess bytes were not acted on, but the read itself exceeded the nominal buffer bounds. Found while working on the corresponding memory-safety proof. (#1615)
  • Make the value barrier volatile to prevent compilers from optimizing it away, strengthening the constant-time countermeasure. This is a purely preventative measure; no insecure compilations of the previous value barrier have been noted. (#1342)
  • Mark the stack as non-executable in all assembly files via .note.GNU-stack section markers. (#1340)

Assurance

  • Assembly verification: All x86_64 and AArch64 assembly is verified to be functionally correct, memory-safe and
    free of secret-dependent timing, in HOL Light.
  • SOUNDNESS.md: New document mapping out what is proved, what is assumed, and where the gaps and risks
    lie. (#1582)

Performance

  • AArch64: Re-optimized arithmetic backend for Neoverse-N1 using SLOTHY. (#1088)
  • x86_64: AVX2 assembly for polyvec_basemul (#1097), SSE4.1 rejection sampling (#1136), conversion of compression/decompression from intrinsics to assembly (#1543, #1545), and replacement of the Keccak-f1600 x4 C intrinsics with formally verified AVX2 assembly from s2n-bignum (#1576).
  • RISC-V RVV: Native backend for rv64gcv targets using the RISC-V Vector Extension 1.0, providing vectorized NTT,
    inverse NTT, polynomial arithmetic, and rejection sampling. NTT and invNTT are for VLEN >= 256, with automatic
    fallback to C for VLEN=128. Other functions are VLEN agnostic. (#1037)
  • Armv8.1-M MVE: Experimental native backend for Cortex-M55 and similar targets, including MVE Keccak-f1600 x4 and baremetal build support for the MPS3 AN547 platform. (#1220, #1518, #1524)

Configuration / API

  • MLK_CONFIG_CUSTOM_ALLOC_FREE: Custom allocation/deallocation for large internal structures, for systems with limited stack space. (#1389)
  • MLK_CONFIG_CONTEXT_PARAMETER: Add opaque context parameter to top-level API, passed through to custom alloc/free
    routines enabled via MLK_CONFIG_CUSTOM_ALLOC_FREE. Useful for applications without global allocator context. (#1467)
  • MLK_CONFIG_NO_RANDOMIZED_API: Build only the deterministic (_derand) API. (#1185)
  • MLK_CONFIG_SERIAL_FIPS202_ONLY: Disable 4x-batched FIPS-202, allowing use of a simpler serial-only FIPS-202 backend. (#1231)
  • Runtime backend dispatch based on a custom CPU capabilities function. (#1152)
  • randombytes() may now return an error code, which is propagated through the KEM API. (#1331)
  • mlk_kem_check_pk() / mlk_kem_check_sk() added to the public API for FIPS 203 modulus and hash checks. (#1216)
  • C++ compatibility for mlkem_native.h. (#1465)
  • MLK_CONFIG_CUSTOM_MEMCPY / MLK_CONFIG_CUSTOM_MEMSET: Custom replacements for memcpy and memset. (#1105)

Testing

  • Wycheproof test suite for ML-KEM test vector validation. (#1588)
  • Unit test framework for internal functions with native backend consistency checks. (#1188)
  • Allocation failure testing, RNG failure testing, stack usage measurement, and unaligned buffer testing.
  • Baremetal testing on AVR (16-bit) and AArch64-virt (no MMU).

Signed-off-by: Matthias J. Kannwischer <matthias@kannwischer.eu>
…tests]

This commit removes the constant time passes which for ML-KEM that is used
to suppress the false positives of the constant-time tests.
This is no longer needed with mlkem-native as mlkem-native does explicit
declassifications for public data that is being branched on.

Signed-off-by: Matthias J. Kannwischer <matthias@kannwischer.eu>
@mkannwischer mkannwischer marked this pull request as ready for review March 14, 2026 08:16
@dstebila dstebila moved this from Backlog to In review in 0.16.0 prioritization Mar 16, 2026
@dstebila
Copy link
Copy Markdown
Member

@bhess Should this have any changes to the CBOM since there's an update in the upstream implementation?

Copy link
Copy Markdown
Member

@bhess bhess left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for the update @mkannwischer.

@bhess Should this require any CBOM changes due to the upstream update?

The current CBOM does not track the upstream dependency (to be handled in #2048), so since there are no new optimizations or algorithm changes, no CBOM update is needed.

@abhi-dev-engg
Copy link
Copy Markdown
Contributor

Hello,

I wanted to ask if there is a specific reason why MLK_CONFIG_EXTERNAL_API_QUALIFIER is not defined.
I encountered an issue while trying to use the check_pk and check_sk APIs in test code (for ACVP) since they are marked as external. However, the symbols do not appear to be resolvable during linking. Inspecting liboqs.dylib shows the following:

00000000000f7354 t _PQCP_MLKEM_NATIVE_MLKEM512_C_check_pk
00000000000f7538 t _PQCP_MLKEM_NATIVE_MLKEM512_C_check_sk

As these are marked with lowercase t, they appear to have local (non-exported) visibility.

I also noticed that MLD_CONFIG_EXTERNAL_API_QUALIFIER seems to be defined, which made me wonder if a similar qualifier was intentionally omitted for ML-KEM ?

mkannwischer added a commit to pq-code-package/mlkem-native that referenced this pull request Mar 21, 2026
…onfigs

The liboqs integration configs were missing
MLK_CONFIG_EXTERNAL_API_QUALIFIER which should be set to OQS_API.
This is causing some issues as reported in
open-quantum-safe/liboqs#2376.

This commit adds them to align with mldsa-native.

Signed-off-by: Matthias J. Kannwischer <matthias@kannwischer.eu>
mkannwischer added a commit to pq-code-package/mlkem-native that referenced this pull request Mar 21, 2026
…onfigs

The liboqs integration configs were missing
MLK_CONFIG_EXTERNAL_API_QUALIFIER which should be set to OQS_API.
This is causing some issues as reported in
open-quantum-safe/liboqs#2376.

This commit adds them to align with mldsa-native.

Signed-off-by: Matthias J. Kannwischer <matthias@zerorisc.com>
@mkannwischer
Copy link
Copy Markdown
Contributor Author

Hello,

I wanted to ask if there is a specific reason why MLK_CONFIG_EXTERNAL_API_QUALIFIER is not defined. I encountered an issue while trying to use the check_pk and check_sk APIs in test code (for ACVP) since they are marked as external. However, the symbols do not appear to be resolvable during linking. Inspecting liboqs.dylib shows the following:

00000000000f7354 t _PQCP_MLKEM_NATIVE_MLKEM512_C_check_pk 00000000000f7538 t _PQCP_MLKEM_NATIVE_MLKEM512_C_check_sk

As these are marked with lowercase t, they appear to have local (non-exported) visibility.

I also noticed that MLD_CONFIG_EXTERNAL_API_QUALIFIER seems to be defined, which made me wonder if a similar qualifier was intentionally omitted for ML-KEM ?

This is more of an oversight - it seems it wasn't strictly needed before.
I have opened a PR to fix it: pq-code-package/mlkem-native#1635

Can you add a patch to the config in your ACVP PR, so we can get this merged first?

mkannwischer added a commit to pq-code-package/mlkem-native that referenced this pull request Mar 21, 2026
…onfigs

The liboqs integration configs were missing
MLK_CONFIG_EXTERNAL_API_QUALIFIER which should be set to OQS_API.
This is causing some issues as reported in
open-quantum-safe/liboqs#2376.

This commit adds them to align with mldsa-native.

Signed-off-by: Matthias J. Kannwischer <matthias@zerorisc.com>
@abhi-dev-engg
Copy link
Copy Markdown
Contributor

abhi-dev-engg commented Mar 21, 2026

Can you add a patch to the config in your ACVP PR, so we can get this merged first?

Sure, I can add the changes as patch in my PR, post this PR merge.

@dstebila dstebila added ready for merge This is ready for review and merging focus Reserved for a small number of topics that have been identified as focus issues for the current week labels Apr 7, 2026
@dstebila dstebila merged commit 4369178 into open-quantum-safe:main Apr 7, 2026
93 checks passed
@github-project-automation github-project-automation Bot moved this from In review to Done in 0.16.0 prioritization Apr 7, 2026
Nelonn pushed a commit to Nelonn/liboqs that referenced this pull request Apr 8, 2026
* Update mlkem-native to v1.1.0 [full tests] [extended tests]

Signed-off-by: Matthias J. Kannwischer <matthias@kannwischer.eu>

* ML-KEM: Remove constant-time passes whitelist [full tests] [extended tests]

This commit removes the constant time passes which for ML-KEM that is used
to suppress the false positives of the constant-time tests.
This is no longer needed with mlkem-native as mlkem-native does explicit
declassifications for public data that is being branched on.

Signed-off-by: Matthias J. Kannwischer <matthias@kannwischer.eu>

---------

Signed-off-by: Matthias J. Kannwischer <matthias@kannwischer.eu>
Co-authored-by: Douglas Stebila <dstebila@users.noreply.github.com>
Signed-off-by: Nelonn <42481486+Nelonn@users.noreply.github.com>
dstebila added a commit that referenced this pull request Apr 14, 2026
* fix: build on windows clang

Signed-off-by: Nelonn <42481486+Nelonn@users.noreply.github.com>

* Update CMakeLists.txt

Signed-off-by: Nelonn <42481486+Nelonn@users.noreply.github.com>

* Update CMakeLists.txt

Signed-off-by: Nelonn <42481486+Nelonn@users.noreply.github.com>

* Pin Wycheproof test vectors to last good commit (#2393)

This is a temporary solution for unblocking CI pipeline; a more
permanent fix is needed to incorporate new test cases

Signed-off-by: Ganyu (Bruce) Xu <g66xu@uwaterloo.ca>
Signed-off-by: Nelonn <42481486+Nelonn@users.noreply.github.com>

* sntrup761: replace PQClean code with public domain OpenSSH code (#2356)

* sntrup761: replace PQClean code with public domain OpenSSH code

Signed-off-by: Billy Brumley <bbb@iki.fi>

* Update top-level LICENSE file

Signed-off-by: Douglas Stebila <dstebila@uwaterloo.ca>

* [src/kem/ntruprime/sntrup761_openssh] use macro for explicit_bzero

Signed-off-by: Billy Brumley <bbb@iki.fi>

* [src/kem/ntruprime/sntrup761_openssh] assign values to volatiles to make stricter android ld.lld happy

Signed-off-by: Billy Brumley <bbb@iki.fi>

* [src/kem/ntruprime/sntrup761_openssh] drop attributes for MSVC

Signed-off-by: Billy Brumley <bbb@iki.fi>

* [src/kem/ntruprime/sntrup761_openssh] alloca for stack allocated variable length arrays

Signed-off-by: Billy Brumley <bbb@iki.fi>

* [src/kem/ntruprime/sntrup761_openssh] MSVC doesn't like variable length arrays on the stack; script to modify upstream source

Signed-off-by: Billy Brumley <bbb@iki.fi>

* [src/kem/ntruprime/sntrup761_openssh] sntrup761.sh: resulting changes

Signed-off-by: Billy Brumley <bbb@iki.fi>

* [docs/algorithms/kem] YAML doc update for sntrup761

Signed-off-by: Billy Brumley <bbb@iki.fi>

* doc: copy_from_upstream.py changes for sntrup761 from OpenSSH

Signed-off-by: Billy Brumley <bbb@iki.fi>

* [.github] CODEOWNERS: sntrup761, sign up for /src/kem/ntruprime

Signed-off-by: Billy Brumley <bbb@iki.fi>

* [docs/algorithms/kem] sntrup761 from upstream OpenSSH has no runtime featurization

Signed-off-by: Billy Brumley <bbb@iki.fi>

* [src/kem/ntruprime] add OPENSSH prefix and use it

Signed-off-by: Billy Brumley <bbb@iki.fi>

* [docs/algorithms/kem] sntrup761: markdown fix, are implementations chosen based on runtime CPU feature detection

Signed-off-by: Billy Brumley <bbb@iki.fi>

* [src/kem/ntruprime/sntrup761_openssh] sntrup761: use __builtin_alloca intrinsic as a fallback for alloca in non-MSVC cases

Signed-off-by: Billy Brumley <bbb@iki.fi>

* [extended tests] sntrup761: add CT exception for rejection sampling

Signed-off-by: Billy Brumley <bbb@iki.fi>

---------

Signed-off-by: Billy Brumley <bbb@iki.fi>
Signed-off-by: Douglas Stebila <dstebila@uwaterloo.ca>
Signed-off-by: Basil Hess <bhe@zurich.ibm.com>
Co-authored-by: Douglas Stebila <dstebila@uwaterloo.ca>
Co-authored-by: Basil Hess <bhe@zurich.ibm.com>
Co-authored-by: Douglas Stebila <dstebila@users.noreply.github.com>
Signed-off-by: Nelonn <42481486+Nelonn@users.noreply.github.com>

* Add MQOM to liboqs (#2385)

* Add common dependencies with include_only

Signed-off-by: Basil Hess <bhe@zurich.ibm.com>

* Remove incorrect debug print in copy_from_upstream

Signed-off-by: Basil Hess <bhe@zurich.ibm.com>

* Add readme for copy_from_upstream

Signed-off-by: Basil Hess <bhe@zurich.ibm.com>

* Import MQOM:
- memopt variant of the algorithm allowed using PR #2367
- common files for all variants are factorized using PR #2382

[extended tests]

Signed-off-by: Ryad Benadjila <ryadbenadjila@gmail.com>

---------

Signed-off-by: Basil Hess <bhe@zurich.ibm.com>
Signed-off-by: Ryad Benadjila <ryadbenadjila@gmail.com>
Co-authored-by: Basil Hess <bhe@zurich.ibm.com>
Signed-off-by: Nelonn <42481486+Nelonn@users.noreply.github.com>

* Update mlkem-native to v1.1.0 (#2376)

* Update mlkem-native to v1.1.0 [full tests] [extended tests]

Signed-off-by: Matthias J. Kannwischer <matthias@kannwischer.eu>

* ML-KEM: Remove constant-time passes whitelist [full tests] [extended tests]

This commit removes the constant time passes which for ML-KEM that is used
to suppress the false positives of the constant-time tests.
This is no longer needed with mlkem-native as mlkem-native does explicit
declassifications for public data that is being branched on.

Signed-off-by: Matthias J. Kannwischer <matthias@kannwischer.eu>

---------

Signed-off-by: Matthias J. Kannwischer <matthias@kannwischer.eu>
Co-authored-by: Douglas Stebila <dstebila@users.noreply.github.com>
Signed-off-by: Nelonn <42481486+Nelonn@users.noreply.github.com>

* Fix mismatched macros in LMS variants (#2379)

Signed-off-by: Abhi S <saxena_abhinav@icloud.com>
Co-authored-by: Douglas Stebila <dstebila@users.noreply.github.com>
Signed-off-by: Nelonn <42481486+Nelonn@users.noreply.github.com>

* Bump the pip group across 2 directories with 1 update (#2389)

Bumps the pip group with 1 update in the /.github/workflows directory: [requests](https://github.com/psf/requests).
Bumps the pip group with 1 update in the /scripts/copy_from_upstream directory: [requests](https://github.com/psf/requests).

Updates `requests` from 2.32.4 to 2.33.0
- [Release notes](https://github.com/psf/requests/releases)
- [Changelog](https://github.com/psf/requests/blob/main/HISTORY.md)
- [Commits](psf/requests@v2.32.4...v2.33.0)

Updates `requests` from 2.32.4 to 2.33.0
- [Release notes](https://github.com/psf/requests/releases)
- [Changelog](https://github.com/psf/requests/blob/main/HISTORY.md)
- [Commits](psf/requests@v2.32.4...v2.33.0)

---
updated-dependencies:
- dependency-name: requests
  dependency-version: 2.33.0
  dependency-type: direct:production
  dependency-group: pip
- dependency-name: requests
  dependency-version: 2.33.0
  dependency-type: direct:production
  dependency-group: pip
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Signed-off-by: Nelonn <42481486+Nelonn@users.noreply.github.com>

---------

Signed-off-by: Nelonn <42481486+Nelonn@users.noreply.github.com>
Signed-off-by: Ganyu (Bruce) Xu <g66xu@uwaterloo.ca>
Signed-off-by: Billy Brumley <bbb@iki.fi>
Signed-off-by: Douglas Stebila <dstebila@uwaterloo.ca>
Signed-off-by: Basil Hess <bhe@zurich.ibm.com>
Signed-off-by: Ryad Benadjila <ryadbenadjila@gmail.com>
Signed-off-by: Matthias J. Kannwischer <matthias@kannwischer.eu>
Signed-off-by: Abhi S <saxena_abhinav@icloud.com>
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Bruce <g66xu@uwaterloo.ca>
Co-authored-by: Billy Brumley <bbb@iki.fi>
Co-authored-by: Douglas Stebila <dstebila@uwaterloo.ca>
Co-authored-by: Basil Hess <bhe@zurich.ibm.com>
Co-authored-by: Douglas Stebila <dstebila@users.noreply.github.com>
Co-authored-by: Ryad Benadjila <ryadbenadjila@gmail.com>
Co-authored-by: Matthias J. Kannwischer <matthias@kannwischer.eu>
Co-authored-by: Abhi S <150999537+abhi-dev-engg@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
will-bates11 pushed a commit to will-bates11/liboqs that referenced this pull request Apr 14, 2026
* Update mlkem-native to v1.1.0 [full tests] [extended tests]

Signed-off-by: Matthias J. Kannwischer <matthias@kannwischer.eu>

* ML-KEM: Remove constant-time passes whitelist [full tests] [extended tests]

This commit removes the constant time passes which for ML-KEM that is used
to suppress the false positives of the constant-time tests.
This is no longer needed with mlkem-native as mlkem-native does explicit
declassifications for public data that is being branched on.

Signed-off-by: Matthias J. Kannwischer <matthias@kannwischer.eu>

---------

Signed-off-by: Matthias J. Kannwischer <matthias@kannwischer.eu>
Co-authored-by: Douglas Stebila <dstebila@users.noreply.github.com>
Signed-off-by: Will Bates <william.bates11@outlook.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

focus Reserved for a small number of topics that have been identified as focus issues for the current week ready for merge This is ready for review and merging

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Update mlkem-native when next release comes

4 participants