Skip to content

Commit

Permalink
updated naming
Browse files Browse the repository at this point in the history
  • Loading branch information
PaulLaux committed Apr 20, 2023
1 parent 25444d2 commit a68d519
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions halo2_gadgets/src/sinsemilla/primitives.rs
Original file line number Diff line number Diff line change
Expand Up @@ -201,14 +201,10 @@ impl CommitDomain {
}
}

/// Constructs a new `CommitDomain` from `hash_personalization` a personalization for hashing
/// and `blind_personalization` another personalization for blinding.
pub fn new_with_two_personalizations(
hash_personalization: &str,
blind_personalization: &str,
) -> Self {
let m_prefix = format!("{}-M", hash_personalization);
let r_prefix = format!("{}-r", blind_personalization);
/// Constructs a new `CommitDomain` from different values for `hash_domain` and `blind_domain`
pub fn new_with_personalization(hash_domain: &str, blind_domain: &str) -> Self {
let m_prefix = format!("{}-M", hash_domain);
let r_prefix = format!("{}-r", blind_domain);
let hasher_r = pallas::Point::hash_to_curve(&r_prefix);
CommitDomain {
M: HashDomain::new(&m_prefix),
Expand All @@ -230,7 +226,7 @@ impl CommitDomain {
.map(|p| p + Wnaf::new().scalar(r).base(self.R))
}

/// Returns `SinsemillaCommit_r(personalization, msg) = hash_point + \[r\]R`
/// Returns `SinsemillaCommit_r(personalization, msg) = hash_point + [r]R`
/// where `SinsemillaHash(personalization, msg) = hash_point`
/// and `R` is derived from the `personalization`.
#[allow(non_snake_case)]
Expand Down

0 comments on commit a68d519

Please sign in to comment.