@@ -24,7 +24,6 @@ pub struct Note<T> {
2424 pub version : NoteVersion ,
2525 pub id : T ,
2626 pub nullifier : T ,
27- pub trapdoor : T ,
2827 pub account_balance : T ,
2928 pub token_address : T ,
3029}
@@ -43,7 +42,6 @@ impl Embed for Note<Value> {
4342 version : self . version ,
4443 id : self . id . embed ( synthesizer, annotation. clone ( ) ) ?,
4544 nullifier : self . nullifier . embed ( synthesizer, annotation. clone ( ) ) ?,
46- trapdoor : self . trapdoor . embed ( synthesizer, annotation. clone ( ) ) ?,
4745 account_balance : self
4846 . account_balance
4947 . embed ( synthesizer, annotation. clone ( ) ) ?,
@@ -72,7 +70,6 @@ pub mod off_circuit {
7270 note. version . as_field ( ) ,
7371 note. id ,
7472 note. nullifier ,
75- note. trapdoor ,
7673 balance_hash,
7774 ] ;
7875
@@ -101,7 +98,7 @@ impl NoteChip {
10198
10299 /// Calculates the note_hash as follows:
103100 ///
104- /// `note_hash = poseidon2(NOTE_VERSION, note.id, note.nullifier, note.trapdoor,
101+ /// `note_hash = poseidon2(NOTE_VERSION, note.id, note.nullifier,
105102 /// poseidon2(note.balance, note.token_address, 0, 0, 0, 0, 0))`
106103 ///
107104 /// The reason for the double nesting and for the padding is historical: we keep this hash shape
@@ -126,7 +123,6 @@ impl NoteChip {
126123 note_version,
127124 note. id . clone ( ) ,
128125 note. nullifier . clone ( ) ,
129- note. trapdoor . clone ( ) ,
130126 h_balance,
131127 ] ;
132128
@@ -223,7 +219,6 @@ mod tests {
223219 version : note. version ,
224220 id : Value :: known ( note. id . into ( ) ) ,
225221 nullifier : Value :: known ( note. nullifier . into ( ) ) ,
226- trapdoor : Value :: known ( note. trapdoor . into ( ) ) ,
227222 account_balance : Value :: known ( note. account_balance . into ( ) ) ,
228223 token_address : Value :: known ( note. token_address . into ( ) ) ,
229224 } )
@@ -281,7 +276,6 @@ mod tests {
281276 version : NoteVersion :: new ( 0 ) ,
282277 id : Value :: unknown ( ) ,
283278 nullifier : Value :: unknown ( ) ,
284- trapdoor : Value :: unknown ( ) ,
285279 account_balance : Value :: unknown ( ) ,
286280 token_address : Value :: unknown ( ) ,
287281 } ) ,
@@ -350,17 +344,15 @@ mod tests {
350344 version : NoteVersion :: new ( 0 ) ,
351345 id : Fr :: from ( 1 ) ,
352346 nullifier : Fr :: from ( 2 ) ,
353- trapdoor : Fr :: from ( 3 ) ,
354- account_balance : Fr :: from ( 4 ) ,
347+ account_balance : Fr :: from ( 3 ) ,
355348 token_address,
356349 } ) ;
357350 let expected_output = hash ( & [
358351 Fr :: from ( 0 ) ,
359352 Fr :: from ( 1 ) ,
360353 Fr :: from ( 2 ) ,
361- Fr :: from ( 3 ) ,
362354 hash ( & [
363- Fr :: from ( 4 ) ,
355+ Fr :: from ( 3 ) ,
364356 token_address,
365357 Fr :: ZERO ,
366358 Fr :: ZERO ,
@@ -380,11 +372,10 @@ mod tests {
380372 version : NoteVersion :: new ( 0 ) ,
381373 id : Fr :: from ( 1 ) ,
382374 nullifier : Fr :: from ( 2 ) ,
383- trapdoor : Fr :: from ( 3 ) ,
384- account_balance : Fr :: from ( 4 ) ,
385- token_address : Fr :: from ( 5 ) ,
375+ account_balance : Fr :: from ( 3 ) ,
376+ token_address : Fr :: from ( 4 ) ,
386377 } ) ;
387- let pub_input = [ Fr :: from ( 5 ) , Fr :: from ( 999999 ) ] ;
378+ let pub_input = [ Fr :: from ( 4 ) , Fr :: from ( 999999 ) ] ;
388379
389380 let failures = expect_prover_success_and_run_verification ( circuit, & pub_input)
390381 . expect_err ( "Verification must fail" ) ;
@@ -402,9 +393,8 @@ mod tests {
402393 version : NoteVersion :: new ( 0 ) ,
403394 id : Fr :: from ( 1 ) ,
404395 nullifier : Fr :: from ( 2 ) ,
405- trapdoor : Fr :: from ( 3 ) ,
406- account_balance : Fr :: from ( 4 ) ,
407- token_address : Fr :: from ( 5 ) ,
396+ account_balance : Fr :: from ( 3 ) ,
397+ token_address : Fr :: from ( 4 ) ,
408398 } ;
409399 let circuit = TestCircuit :: note_hash_test ( note) ;
410400 let pub_input = [ Fr :: from ( 999999 ) , super :: off_circuit:: note_hash ( & note) ] ;
0 commit comments