Skip to content

Commit

Permalink
Update comments
Browse files Browse the repository at this point in the history
  • Loading branch information
ConstanceBeguier committed Oct 17, 2023
1 parent e6b13bd commit f628ec3
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/circuit/note_commit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1868,6 +1868,16 @@ pub(in crate::circuit) mod gadgets {
let message_suffix_zsa =
Message::from_pieces(chip.clone(), vec![h_zsa.clone(), i.clone(), j.clone()]);

// We will evaluate
// - `hash_point_zec = hash(Q_ZEC, message_common_prefix || message_suffix_zec)`, and
// - `hash_point_zsa = hash(Q_ZSA, message_common_prefix || message_suffix_zsa)`.
// by sharing a portion of the hash evaluation process between `hash_point_zec` and
// `hash_point_zsa`:
// 1. Q = if (is_native_asset == 0) {Q_ZSA} else {Q_ZEC}
// 2. common_hash = hash(Q, message_common_prefix) // this part is shared
// 3. hash_point_zec = hash(common_hash, message_suffix_zec)
// 4. hash_point_zsa = hash(common_hash, message_suffix_zsa)
// 5. hash_point = if (is_native_asset == 0) {hash_point_zsa} else {hash_point_zec}
let zec_domain = CommitDomain::new(
chip.clone(),
ecc_chip.clone(),
Expand Down

0 comments on commit f628ec3

Please sign in to comment.