Skip to content

Commit

Permalink
fix: shielded ptx out-of-circuit check (#249)
Browse files Browse the repository at this point in the history
fix shielded ptx check
  • Loading branch information
XuyangSong committed Nov 17, 2023
1 parent cba5f58 commit 7cc43d3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions taiga_halo2/src/shielded_ptx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ impl ShieldedPartialTransaction {
fn check_nullifiers(&self) -> Result<(), TransactionError> {
assert_eq!(NUM_NOTE, 2);
let action_nfs = self.get_nullifiers();
for vp_info in self.inputs.iter() {
for vp_info in self.inputs.iter().chain(self.outputs.iter()) {
for nfs in vp_info.get_nullifiers().iter() {
// Check the vp actually uses the input notes from action circuits.
if !((action_nfs[0].inner() == nfs[0] && action_nfs[1].inner() == nfs[1])
Expand Down Expand Up @@ -198,7 +198,7 @@ impl ShieldedPartialTransaction {
fn check_note_commitments(&self) -> Result<(), TransactionError> {
assert_eq!(NUM_NOTE, 2);
let action_cms = self.get_output_cms();
for vp_info in self.outputs.iter() {
for vp_info in self.inputs.iter().chain(self.outputs.iter()) {
for cms in vp_info.get_note_commitments().iter() {
// Check the vp actually uses the output notes from action circuits.
if !((action_cms[0] == cms[0] && action_cms[1] == cms[1])
Expand Down

0 comments on commit 7cc43d3

Please sign in to comment.