Skip to content

Commit

Permalink
circuits: remove pointer from payload hash
Browse files Browse the repository at this point in the history
Co-authored-by: Eduardo Leegwater Simões <[email protected]>
  • Loading branch information
xevisalle and Eduardo Leegwater Simões committed Jun 6, 2024
1 parent d0ac3ab commit 7f3a0e1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions circuits/src/recipient.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ pub(crate) fn gadget(
let sig_B_u = composer.append_witness(*rp.sig_vec[1].u());
let sig_B_R = composer.append_point(rp.sig_vec[1].R());

gadgets::verify_signature(composer, sig_A_u, sig_A_R, pk_A, *payload_hash)?;
gadgets::verify_signature(composer, sig_B_u, sig_B_R, pk_B, *payload_hash)?;
gadgets::verify_signature(composer, sig_A_u, sig_A_R, pk_A, payload_hash)?;
gadgets::verify_signature(composer, sig_B_u, sig_B_R, pk_B, payload_hash)?;

// ENCRYPT EACH KEY 'A' and 'B' USING EACH OUTPUT 'NPK'
let note_pk_1 = composer.append_public_point(rp.recipient_npk_vec[0]);
Expand Down
8 changes: 4 additions & 4 deletions circuits/src/transaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ impl<const H: usize> TxInputNote<H> {
note: &Note,
merkle_opening: poseidon_merkle::Opening<(), H>,
sk: &SecretKey,
payload_hash: &BlsScalar,
payload_hash: BlsScalar,
) -> Result<crate::transaction::TxInputNote<H>, PhoenixError> {
let note_sk = sk.gen_note_sk(note);
let note_pk_p =
Expand All @@ -74,7 +74,7 @@ impl<const H: usize> TxInputNote<H> {
&[note_pk_p.get_u(), note_pk_p.get_v(), (*note.pos()).into()],
)[0];

let signature = note_sk.sign_double(rng, *payload_hash);
let signature = note_sk.sign_double(rng, payload_hash);

Ok(crate::transaction::TxInputNote {
merkle_opening,
Expand Down Expand Up @@ -359,7 +359,7 @@ impl<const H: usize, const I: usize> Default for TxCircuit<H, I> {
&note,
merkle_opening,
&sk,
&payload_hash,
payload_hash,
)
.expect("Note created properly.");

Expand Down Expand Up @@ -443,7 +443,7 @@ impl<const H: usize, const I: usize> Circuit for TxCircuit<H, I> {
)?;

// Prove correctness of the sender keys encryption
recipient::gadget(composer, &self.rp, &payload_hash)?;
recipient::gadget(composer, &self.rp, payload_hash)?;

Ok(())
}
Expand Down

0 comments on commit 7f3a0e1

Please sign in to comment.