Skip to content

RFC: Add bindings for ML-KEM and ML-DSA. #2405

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 27 commits into
base: master
Choose a base branch
from

Conversation

teythoon
Copy link

This patch series adds support for the post-quantum ML-KEM and ML-DSA algorithms. I intend to also add support for SLH-DSA, but didn't get around to that yet, and want to get the conversation going. Once SLH-DSA is added, this will close #2393.

I only added the interfaces required to implement ML-KEM and ML-DSA in Sequoia PGP. And, I'm not too familiar with the OpenSSL API, so I'm happy to add more functions, but I need guidance there. Similarly, I'm not too familiar with how the Rust bindings abstract over the differences between OpenSSL versions and variants, so any advice in that direction is appreciated (and please be concrete ;)).

It builds upon parts of Jakub's patch series #2380 modulo the RSA and ECDSA parts.

Jakuje and others added 18 commits May 12, 2025 15:05
We discussed that this API is not well suitable for the end users
but still, it required for several operations in OpenSSL 3.* so
instead of calling to FFI for every use of this API, this
introduces simple wrappers that allow building of the params
and their usage.

Signed-off-by: Jakub Jelen <[email protected]>
The OpenSSL 3.* users now do not have a way to use non-deprecated
API by using this rust bindings, which is not sustainable in the
long term as either distributions will stop building with the
deprecated API or it will be eventually removed.

This is partially based on sfackler#2051 which was abandoned.

Signed-off-by: Jakub Jelen <[email protected]>
Some imports and private functions are currently only used on newer
OpenSSL versions.  This may change once more classical algorithms are
using the new interfaces.

For now, simply silence the warnings.  Let me know if you prefer a
different solution.
@Jakuje
Copy link
Contributor

Jakuje commented May 14, 2025

@alex any thoughts regarding to adding the new PQC algorithms?

@alex
Copy link
Collaborator

alex commented May 14, 2025

I have not had a chance to review. For similar reasons to what I noted in #2380, I have incredibly low motivation to do anything involving OpenSSL's new (bad) APIs.

@Jakuje
Copy link
Contributor

Jakuje commented May 15, 2025

In #2393 you wrote you would be happy for the PR. Does it mean if somebody else would review, this, it would be acceptable?

Comment on lines +200 to +201
#[cfg(ossl300)]
pub mod signature;
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we use #[cfg(ossl350)] here to avoid the need to add the #[allow(unused_imports)] inside? Even though the functions might be available in older versions, they are for no good use as far as I know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feature request: PQC algoritm bindings to openssl 3.5.0
4 participants