Skip to content

Commit

Permalink
Add feature kyber for Round 3 Kyber API (#327)
Browse files Browse the repository at this point in the history
* Revert changes to Kyber (Round 3) for ML-KEM

* Fix swapped private key decoding

* Pull out Kyber encaps

* Make Kyber API available behind `kyber` feature

* Format

* Introduce `kyber` feature in `libcrux-kem`

* Format

* fix C extraction

* Fix typo

* Give more accurate test names (`kyber...` to `mlkem...`)

* Avoid unused warning when testing

* Use `Hasher` trait to select best KDF for Kyber

* Document differences between Kyber (Round 3) and ML-KEM

* Inline ML-KEM/Kyber variant differences

* `kyber{512,768,1024}` top level modules

* Fix `kyber` feature in `libcrux-kem`

* Rename NIST KAT files for ML-KEM

* Include NIST KATs for all Kyber parameter sets

* Document single Kyber 768 KAT from boringssl

* Format

* Test Kyber on CI

* update code for C generation

Also drop unused test feature in ml-kem crate

* update generated C code

---------

Co-authored-by: Franziskus Kiefer <[email protected]>
  • Loading branch information
jschneider-bensch and franziskuskiefer authored Jun 26, 2024
1 parent 2b2031d commit 9018f21
Show file tree
Hide file tree
Showing 60 changed files with 4,402 additions and 330 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/mlkem.yml
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,12 @@ jobs:
cargo clean
LIBCRUX_DISABLE_SIMD128=1 LIBCRUX_DISABLE_SIMD256=1 cargo test --verbose --release $RUST_TARGET_FLAG
- name: 🏃🏻‍♀️ Test Kyber
run: |
cargo clean
cargo test --features kyber --verbose $RUST_TARGET_FLAG
benchmarks:
strategy:
fail-fast: true
Expand Down
88 changes: 40 additions & 48 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion benchmarks/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ publish = false
[dev-dependencies]
libcrux = { path = "../", features = ["rand", "tests"] }
libcrux-kem = { path = "../libcrux-kem", features = ["tests"] }
libcrux-ml-kem = { path = "../libcrux-ml-kem", features = ["tests"] }
libcrux-ml-kem = { path = "../libcrux-ml-kem" }
rand = { version = "0.8" }
rand_core = { version = "0.6" }
# Benchmarking "RustCrypto"
Expand Down
1 change: 1 addition & 0 deletions libcrux-kem/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ rand = { version = "0.8" }

[features]
tests = [] # Expose functions for testing.
kyber = ["libcrux-ml-kem/kyber"]

[dev-dependencies]
libcrux-kem = { version = "0.0.2-pre.2", path = "./", features = ["tests"] }
Expand Down
Loading

0 comments on commit 9018f21

Please sign in to comment.