-
Notifications
You must be signed in to change notification settings - Fork 1
New mlkem lib #56
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
New mlkem lib #56
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR migrates the cryptographic implementation from kyberlib to libcrux_ml_kem, updates the random number generation to use rand_chacha, and refactors various areas including tests, benchmarks, and documentation to reflect the new APIs.
- Migration to libcrux_ml_kem with updated keypair, encapsulation, and decapsulation functions
- Update of randomness generation using ChaCha20Rng from OS sources for reproducibility
- Refactoring of API interfaces, test vector generation, and documentation improvements
Reviewed Changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
src/tests.rs | Updated tests to use new public key getters and revised keypair construction |
src/main.rs | Added a new test vector generation script |
src/lib.rs | Refactored encryption/decryption functions to use fixed-size arrays and new ML-KEM API |
src/key_exchange.rs | Revised key exchange to adopt libcrux_ml_kem and update key derivation logic |
src/encryption.rs | Minor documentation and example adjustments in encrypt/decrypt helper functions |
benches/kyber_bench.rs | Updated benchmarking tests to reflect use of the new ML-KEM key and encapsulation APIs |
benches/chacha_bench.rs | Modified random number generation in benchmarks to use ChaChaOsRng for consistency |
Cargo.toml | Removed obsolete dependencies and added libcrux-ml-kem and updated rand_chacha versions |
Comments suppressed due to low confidence (1)
src/lib.rs:154
- The call to mlkem768::decapsulate contains an extraneous trailing comma, which could lead to a syntax error. Please remove the trailing comma.
let shared_secret = mlkem768::decapsulate(server_kp.private_key(), &kyber_ciphertext_array, );
CodSpeed Performance ReportMerging #56 will improve performances by 83.55%Comparing Summary
Benchmarks breakdown
|
This pull request introduces significant updates to the cryptographic implementation, replacing the Kyber library with
libcrux_ml_kem
and updating the random number generation approach to userand_chacha
, safer than using rand::threaded_rng. It also includes various refactors, test updates, and a new script for generating test vectors.