Skip to content

Commit

Permalink
Address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
jschneider-bensch committed Oct 8, 2024
1 parent 5d81c3e commit 208f9f6
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 18 deletions.
13 changes: 4 additions & 9 deletions libcrux-ml-dsa/src/ml_dsa_44.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ macro_rules! instantiate {
>(&signing_key.0, message, context, randomness)
}

/// Generate an ML-DSA-44 Signature (internal API)
/// Generate an ML-DSA-44 Signature (Algorithm 7 in FIPS204)
///
/// The message is assumed to be domain-separated.
#[cfg(feature = "acvp")]
Expand All @@ -148,7 +148,7 @@ macro_rules! instantiate {
>(&signing_key.0, message, randomness)
}

/// Verify an ML-DSA-44 Signature (internal API)
/// Verify an ML-DSA-44 Signature (Algorithm 8 in FIPS204)
///
/// The message is assumed to be domain-separated.
#[cfg(feature = "acvp")]
Expand Down Expand Up @@ -327,7 +327,7 @@ pub fn sign(
>(&signing_key.0, message, context, randomness)
}

/// Sign with ML-DSA 44 (internal API)
/// Sign with ML-DSA 44 (Algorithm 7 in FIPS204)
///
/// Sign a `message` (assumed to be domain-separated) with the ML-DSA `signing_key`.
///
Expand Down Expand Up @@ -356,7 +356,7 @@ pub fn sign_internal(
>(&signing_key.0, message, randomness)
}

/// Verify an ML-DSA-44 Signature (internal API)
/// Verify an ML-DSA-44 Signature (Algorithm 8 in FIPS204)
///
/// Returns `Ok` when the `signature` is valid for the `message` (assumed to be domain-separated) and
/// `verification_key`, and a [`VerificationError`] otherwise.
Expand Down Expand Up @@ -481,8 +481,3 @@ pub fn verify_pre_hashed_shake128(
MAX_ONES_IN_HINT,
>(&verification_key.0, message, context, &signature.0)
}

// mod acvp {
// pub use multiplexing::sign_internal;
// pub use multiplexing::verify_internal;
// }
8 changes: 4 additions & 4 deletions libcrux-ml-dsa/src/ml_dsa_65.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ macro_rules! instantiate {
verification_key: MLDSAVerificationKey(verification_key),
}
}
/// Generate an ML-DSA-65 Signature (internal API)
/// Generate an ML-DSA-65 Signature (Algorithm 7 in FIPS 204)
///
/// The message is assumed to be domain-separated.
#[cfg(feature = "acvp")]
Expand All @@ -120,7 +120,7 @@ macro_rules! instantiate {
>(&signing_key.0, message, randomness)
}

/// Verify an ML-DSA-65 Signature (internal API)
/// Verify an ML-DSA-65 Signature (Algorithm 8 in FIPS 204)
///
/// The message is assumed to be domain-separated.
#[cfg(feature = "acvp")]
Expand Down Expand Up @@ -426,7 +426,7 @@ pub fn verify_pre_hashed_shake128(
MAX_ONES_IN_HINT,
>(&verification_key.0, message, context, &signature.0)
}
/// Sign with ML-DSA 65 (internal API)
/// Sign with ML-DSA 65 (Algorithm 7 in FIPS 204)
///
/// Sign a `message` (assumed to be domain-separated) with the ML-DSA `signing_key`.
///
Expand Down Expand Up @@ -455,7 +455,7 @@ pub fn sign_internal(
>(&signing_key.0, message, randomness)
}

/// Verify an ML-DSA-65 Signature (internal API)
/// Verify an ML-DSA-65 Signature (Algorithm 8 in FIPS204)
///
/// Returns `Ok` when the `signature` is valid for the `message` (assumed to be domain-separated) and
/// `verification_key`, and a [`VerificationError`] otherwise.
Expand Down
8 changes: 4 additions & 4 deletions libcrux-ml-dsa/src/ml_dsa_87.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ macro_rules! instantiate {
}
}

/// Generate an ML-DSA-87 Signature (internal API)
/// Generate an ML-DSA-87 Signature (Algorithm 7 in FIPS204)
///
/// The message is assumed to be domain-separated.
#[cfg(feature = "acvp")]
Expand All @@ -124,7 +124,7 @@ macro_rules! instantiate {
>(&signing_key.0, message, randomness)
}

/// Verify an ML-DSA-87 Signature (internal API)
/// Verify an ML-DSA-87 Signature (Algorithm 8 in FIPS204)
///
/// The message is assumed to be domain-separated.
#[cfg(feature = "acvp")]
Expand Down Expand Up @@ -431,7 +431,7 @@ pub fn verify_pre_hashed_shake128(
>(&verification_key.0, message, context, &signature.0)
}

/// Sign with ML-DSA 87 (internal API)
/// Sign with ML-DSA 87 (Algorithm 7 in FIPS204)
///
/// Sign a `message` (assumed to be domain-separated) with the ML-DSA `signing_key`.
///
Expand Down Expand Up @@ -460,7 +460,7 @@ pub fn sign_internal(
>(&signing_key.0, message, randomness)
}

/// Verify an ML-DSA-87 Signature (internal API)
/// Verify an ML-DSA-87 Signature (Algorithm 8 in FIPS204)
///
/// Returns `Ok` when the `signature` is valid for the `message` (assumed to be domain-separated) and
/// `verification_key`, and a [`VerificationError`] otherwise.
Expand Down
2 changes: 1 addition & 1 deletion libcrux-ml-dsa/src/ml_dsa_generic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ pub(crate) fn sign_internal<
/// This corresponds to line 6 in algorithm 7 in FIPS 204 (line 7 in algorithm
/// 8, resp.).
///
/// If `domain_separatino_context` is supplied, applies domain
/// If `domain_separation_context` is supplied, applies domain
/// separation and length encoding to the context string,
/// before appending the message (in the regular variant) or the
/// pre-hash OID as well as the pre-hashed message digest. Otherwise,
Expand Down

0 comments on commit 208f9f6

Please sign in to comment.