Skip to content
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

feat: update liboqs, add ml-kem / ml-dsa #259

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Update your `Cargo.toml` and include `oqs`:

```toml
[dependencies]
oqs = "0.9.0"
oqs = "0.10.0"
```

`oqs-sys` can be specified equivalently.
Expand Down Expand Up @@ -103,12 +103,14 @@ tests.
- `kyber`
- `ntruprime`
- `saber`
- `ml_kem`
- `sigs` (default): Compile with all signature schemes enabled
- `dilithium`
- `falcon`
- `picnic`
- `rainbow`
- `sphincs`: SPHINCS<sup>+</sup>
- `ml_dsa`

## Running

Expand Down
8 changes: 5 additions & 3 deletions oqs-sys/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "oqs-sys"
version = "0.9.1+liboqs-0.9.0"
version = "0.10.0+liboqs-0.10.0"
authors = ["Thom Wiggers <[email protected]>"]
edition = "2021"
links = "oqs"
Expand Down Expand Up @@ -30,18 +30,20 @@ docs = []
non_portable = []
vendored = []
# algorithms: KEMs
kems = ["classic_mceliece", "frodokem", "hqc", "kyber", "ntruprime"]
kems = ["classic_mceliece", "frodokem", "hqc", "kyber", "ntruprime", "ml_kem"]
bike = [] # BIKE is enabled by build.rs on non-windows targets
classic_mceliece = []
frodokem = []
hqc = []
kyber = []
ntruprime = []
ml_kem = []
# algorithms: Signature schemes
sigs = ["dilithium", "falcon", "sphincs"]
sigs = ["dilithium", "falcon", "sphincs", "ml_dsa"]
dilithium = []
falcon = []
sphincs = []
ml_dsa = []

[package.metadata.docs.rs]
features = ["docs"]
2 changes: 2 additions & 0 deletions oqs-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,13 @@ fn build_from_source() -> PathBuf {
algorithm_feature!("KEM", "hqc");
algorithm_feature!("KEM", "kyber");
algorithm_feature!("KEM", "ntruprime");
algorithm_feature!("KEM", "ml_kem");

// signature schemes
algorithm_feature!("SIG", "dilithium");
algorithm_feature!("SIG", "falcon");
algorithm_feature!("SIG", "sphincs");
algorithm_feature!("SIG", "ml_dsa");

if cfg!(windows) {
// Select the latest available Windows SDK
Expand Down
2 changes: 1 addition & 1 deletion oqs-sys/liboqs
Submodule liboqs updated 1223 files
10 changes: 6 additions & 4 deletions oqs/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "oqs"
version = "0.9.0"
version = "0.10.0"
authors = ["Thom Wiggers <[email protected]>"]
edition = "2021"
description = "A Rusty interface to Open-Quantum-Safe's liboqs"
Expand All @@ -16,7 +16,7 @@ serde = { version = "1.0", optional = true, default-features = false, features =

[dependencies.oqs-sys]
path = "../oqs-sys"
version = "0.9.0"
version = "0.10.0+liboqs-0.10.0"
default-features = false

[features]
Expand All @@ -26,15 +26,17 @@ non_portable = ["oqs-sys/non_portable"]
vendored = ["oqs-sys/vendored"]

# algorithms: KEMs
kems = ["oqs-sys/kems", "classic_mceliece", "frodokem", "hqc", "kyber", "ntruprime"]
kems = ["oqs-sys/kems", "classic_mceliece", "frodokem", "hqc", "kyber", "ntruprime", "ml_kem"]
bike = ["oqs-sys/bike"] # not supported on Windows or 32-bit ARM
classic_mceliece = ["oqs-sys/classic_mceliece"]
frodokem = ["oqs-sys/frodokem"]
hqc = ["oqs-sys/hqc"]
kyber = ["oqs-sys/kyber"]
ntruprime = ["oqs-sys/ntruprime"]
ml_kem = ["oqs-sys/ml_kem"]
# algorithms: Signature schemes
sigs = ["oqs-sys/sigs", "dilithium", "falcon", "sphincs"]
sigs = ["oqs-sys/sigs", "dilithium", "falcon", "sphincs", "ml_dsa"]
dilithium = ["oqs-sys/dilithium"]
falcon = ["oqs-sys/falcon"]
sphincs = ["oqs-sys/sphincs"]
ml_dsa = ["oqs-sys/ml_dsa"]
6 changes: 6 additions & 0 deletions oqs/src/kem.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,12 @@ implement_kems! {
("frodokem") FrodoKem976Shake: OQS_KEM_alg_frodokem_976_shake,
("frodokem") FrodoKem1344Aes: OQS_KEM_alg_frodokem_1344_aes,
("frodokem") FrodoKem1344Shake: OQS_KEM_alg_frodokem_1344_shake,
("ml_kem") MlKem512Ipd: OQS_KEM_alg_ml_kem_512_ipd,
("ml_kem") MlKem768Ipd: OQS_KEM_alg_ml_kem_768_ipd,
("ml_kem") MlKem1024Ipd: OQS_KEM_alg_ml_kem_1024_ipd,
("ml_kem") MlKem512: OQS_KEM_alg_ml_kem_512,
("ml_kem") MlKem768: OQS_KEM_alg_ml_kem_768,
("ml_kem") MlKem1024: OQS_KEM_alg_ml_kem_1024,
}

impl Algorithm {
Expand Down
6 changes: 6 additions & 0 deletions oqs/src/sig.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,12 @@ implement_sigs! {
("sphincs") SphincsShake192sSimple: OQS_SIG_alg_sphincs_shake_192s_simple,
("sphincs") SphincsShake256fSimple: OQS_SIG_alg_sphincs_shake_256f_simple,
("sphincs") SphincsShake256sSimple: OQS_SIG_alg_sphincs_shake_256s_simple,
("ml_dsa") MlDsa44Ipd: OQS_SIG_alg_ml_dsa_44_ipd,
("ml_dsa") MlDsa65Ipd: OQS_SIG_alg_ml_dsa_65_ipd,
("ml_dsa") MlDsa87Ipd: OQS_SIG_alg_ml_dsa_87_ipd,
("ml_dsa") MlDsa44: OQS_SIG_alg_ml_dsa_44,
("ml_dsa") MlDsa65: OQS_SIG_alg_ml_dsa_65,
("ml_dsa") MlDsa87: OQS_SIG_alg_ml_dsa_87,
}

impl Algorithm {
Expand Down