Skip to content

Commit

Permalink
refactor code comments to align with spec better
Browse files Browse the repository at this point in the history
  • Loading branch information
eschorn1 committed Oct 28, 2024
1 parent e9553c2 commit 346b6f8
Show file tree
Hide file tree
Showing 9 changed files with 434 additions and 310 deletions.
2 changes: 1 addition & 1 deletion ct_cm4/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "fips204-ct_cm4"
version = "0.4.3"
version = "0.4.4"
authors = ["Eric Schorn <[email protected]>"]
description = "Cortex-M4 testbench for FIPS 204 (draft) ML-DSA"
edition = "2021"
Expand Down
2 changes: 1 addition & 1 deletion dudect/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "fips204-dudect"
version = "0.4.3"
version = "0.4.4"
authors = ["Eric Schorn <[email protected]>"]
description = "Dudect testbench for FIPS 204 (draft) ML-DSA"
edition = "2021"
Expand Down
2 changes: 1 addition & 1 deletion fuzz/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "fips204-fuzz"
version = "0.4.3"
version = "0.4.4"
authors = ["Eric Schorn <[email protected]>"]
description = "Fuzz harness for FIPS 204 (draft) ML-DSA"
edition = "2021"
Expand Down
307 changes: 188 additions & 119 deletions src/lib.rs

Large diffs are not rendered by default.

413 changes: 235 additions & 178 deletions src/ml_dsa.rs

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ pub struct PrivateKey<const K: usize, const L: usize> {
pub(crate) s_hat_1_mont: [T; L],
pub(crate) s_hat_2_mont: [T; K],
pub(crate) t_hat_0_mont: [T; K],
// pub(crate) cap_a_hat: [[T; L]; K],
}


Expand All @@ -37,7 +36,6 @@ pub struct PrivateKey<const K: usize, const L: usize> {
#[repr(align(8))]
pub struct PublicKey<const K: usize, const L: usize> {
pub(crate) rho: [u8; 32],
// pub(crate) cap_a_hat: [[T; L]; K],
pub(crate) tr: [u8; 64],
pub(crate) t1_d2_hat_mont: [T; K],
}
Expand Down
6 changes: 3 additions & 3 deletions tests/nist_vectors/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ fn test_siggen() {
ml_dsa_44::PrivateKey::try_from_bytes(sk_bytes.clone().try_into().unwrap())
.unwrap();
//let sig_act = sk.try_sign_with_rng(&mut rnd, &message, &[]).unwrap();
let sig_act = ml_dsa_44::_internal_sign(&sk, &mut rnd, &message, &[]).unwrap();
let sig_act = ml_dsa_44::_internal_sign(&sk, &message, &[], seed).unwrap();
assert_eq!(sig_exp, sig_act);
}

Expand All @@ -129,7 +129,7 @@ fn test_siggen() {
ml_dsa_65::PrivateKey::try_from_bytes(sk_bytes.clone().try_into().unwrap())
.unwrap();
//let sig_act = sk.try_sign_with_rng(&mut rnd, &message, &[]).unwrap();
let sig_act = ml_dsa_65::_internal_sign(&sk, &mut rnd, &message, &[]).unwrap();
let sig_act = ml_dsa_65::_internal_sign(&sk, &message, &[], seed).unwrap();
assert_eq!(sig_exp, sig_act);
}

Expand All @@ -138,7 +138,7 @@ fn test_siggen() {
let sk =
ml_dsa_87::PrivateKey::try_from_bytes(sk_bytes.try_into().unwrap()).unwrap();
//let sig_act = sk.try_sign_with_rng(&mut rnd, &message, &[]).unwrap();
let sig_act = ml_dsa_87::_internal_sign(&sk, &mut rnd, &message, &[]).unwrap();
let sig_act = ml_dsa_87::_internal_sign(&sk, &message, &[], seed).unwrap();
assert_eq!(sig_exp, sig_act);
}
}
Expand Down
2 changes: 1 addition & 1 deletion wasm/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "fips204-wasm"
version = "0.4.3"
version = "0.4.4"
authors = ["Eric Schorn <[email protected]>"]
description = "Sample web page utilizing FIPS 204 code"
repository = ""
Expand Down
8 changes: 4 additions & 4 deletions wasm/www/package-lock.json

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

0 comments on commit 346b6f8

Please sign in to comment.