Skip to content

Conversation

@jschneider-bensch
Copy link
Collaborator

This PR updates the Readme for ML-KEM to include more information on crate features and different APIs available.
It's essentially an updated version of the PQCP Readme.

The crate-level documentation is also updated accordingly, and codec is added to the features included in the docs.rs build.

Fixes #1172

[skip changelog]

Copy link
Member

@franziskuskiefer franziskuskiefer left a comment

Choose a reason for hiding this comment

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

lgtm
If you can de-duplicate by including the readme, even better.

//! - `mlkem768::portable::generate_key_pair`,
//!
//! analogously for encapsulation and decapsulation."
//! This crate implements all three ML-KEM ([FIPS 203](https://csrc.nist.gov/pubs/fips/203/final)) variants 512, 768, and 1024.
Copy link
Member

Choose a reason for hiding this comment

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

Looks like you duplicate the readme here? Why not include the readme instead?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Right, I forgot you could do #![doc = include_str!("../README.md")]! That would be much nicer.

One issue there is that we have the doc test here that is feature-guarded for mlkem768, which we couldn't do with the include. So e.g. cargo test --no-default-features -F mlkem512 will fail on that then.

Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure if/how you can run the tests from the readme. That never worked for me. But if it does, you could add the feature guards in there. Or keep the test in here.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I've pushed a version that works. Unfortunately, just putting a #![cfg(feature = "mlkem768")] does not work, so I had to put a guarded code block in there. But it's not so bad, I think.

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.

[ML-KEM] Enable feature documentation for docs.rs

2 participants