Skip to content

Commit

Permalink
1090 - replaces a zero nullified_commitment by EMPTY placeholder
Browse files Browse the repository at this point in the history
        while pushing a new nullifier
  • Loading branch information
jeanmon committed Sep 27, 2023
1 parent 4ee0bfa commit 4693547
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion yarn-project/aztec-nr/aztec/src/context.nr
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,16 @@ impl PrivateContext {
self.new_commitments.push(note_hash);
}

// We never push a zero nullified_commitment as zero is used to indicate the end
// of a field array in private kernel. This routine transparently replaces a
// zero value into the special placeholder: EMPTY_NULLIFIED_COMMITMENT.
fn push_new_nullifier(&mut self, nullifier: Field, nullified_commitment: Field) {
self.new_nullifiers.push(nullifier);
self.nullified_commitments.push(nullified_commitment);
let mut non_zero_nullified = nullified_commitment;
if (non_zero_nullified == 0) {
non_zero_nullified = EMPTY_NULLIFIED_COMMITMENT;
}
self.nullified_commitments.push(non_zero_nullified);
}

// docs:start:context_message_portal
Expand Down

0 comments on commit 4693547

Please sign in to comment.