22source : tests / snapshots .rs
33expression : stdout
44-- -
5+
56use aztec ::macros ::aztec ;
67use aztec ::macros ::aztec ;
78
@@ -12,10 +13,6 @@ contract AvmGadgetsTest {
1213 #[contract_library_method ]
1314 fn keccak_hash (data : [u8 ; 10 ]) - > [u8 ; 32 ];
1415
15- #[deprecated (deny , " Direct invocation of public functions is not supported. You attempted to call keccak_hash_300. See https://docs.aztec.network/errors/6" )]
16- #[contract_library_method ]
17- fn keccak_hash_300 (data : [u8 ; 300 ]) - > [u8 ; 32 ];
18-
1916 #[deprecated (deny , " Direct invocation of public functions is not supported. You attempted to call keccak_hash_1400. See https://docs.aztec.network/errors/6" )]
2017 #[contract_library_method ]
2118 fn keccak_hash_1400 (data : [u8 ; 1400 ]) - > [u8 ; 32 ];
@@ -159,12 +156,6 @@ contract AvmGadgetsTest {
159156 Self { target_contract: aztec ::protocol ::address ::AztecAddress ::zero ()}
160157 }
161158
162- pub fn sha256_hash_1536(self, data: [u8; 1536]) -> aztec::context::calls::PublicCall<16, 1536, [u8; 32]> {
163- let serialized_params : [Field ; 1536 ] = < [u8 ; 1536 ] as aztec ::protocol ::traits ::Serialize > ::serialize (data );
164- let selector : aztec ::protocol ::abis ::function_selector ::FunctionSelector = < aztec ::protocol ::abis ::function_selector ::FunctionSelector as aztec ::protocol ::traits ::FromField > ::from_field (373006257_Field );
165- aztec ::context ::calls ::PublicCall ::< 16 , 1536 , [u8 ; 32 ]> ::new (self .target_contract , selector , " sha256_hash_1536" , serialized_params )
166- }
167-
168159 pub fn pedersen_hash_with_index(self, data: [Field; 10]) -> aztec::context::calls::PublicCall<24, 10, Field> {
169160 let serialized_params : [Field ; 10 ] = < [Field ; 10 ] as aztec ::protocol ::traits ::Serialize > ::serialize (data );
170161 let selector : aztec ::protocol ::abis ::function_selector ::FunctionSelector = < aztec ::protocol ::abis ::function_selector ::FunctionSelector as aztec ::protocol ::traits ::FromField > ::from_field (3265405934_Field );
@@ -297,10 +288,10 @@ contract AvmGadgetsTest {
297288 aztec ::context ::calls ::PublicCall ::< 16 , 1400 , [u8 ; 32 ]> ::new (self .target_contract , selector , " keccak_hash_1400" , serialized_params )
298289 }
299290
300- pub fn keccak_hash_300 (self, data: [u8; 300 ]) -> aztec::context::calls::PublicCall<15, 300 , [u8; 32]> {
301- let serialized_params : [Field ; 300 ] = < [u8 ; 300 ] as aztec ::protocol ::traits ::Serialize > ::serialize (data );
302- let selector : aztec ::protocol ::abis ::function_selector ::FunctionSelector = < aztec ::protocol ::abis ::function_selector ::FunctionSelector as aztec ::protocol ::traits ::FromField > ::from_field (3065624740 _Field );
303- aztec ::context ::calls ::PublicCall ::< 15 , 300 , [u8 ; 32 ]> ::new (self .target_contract , selector , " keccak_hash_300 " , serialized_params )
291+ pub fn sha256_hash_1536 (self, data: [u8; 1536 ]) -> aztec::context::calls::PublicCall<16, 1536 , [u8; 32]> {
292+ let serialized_params : [Field ; 1536 ] = < [u8 ; 1536 ] as aztec ::protocol ::traits ::Serialize > ::serialize (data );
293+ let selector : aztec ::protocol ::abis ::function_selector ::FunctionSelector = < aztec ::protocol ::abis ::function_selector ::FunctionSelector as aztec ::protocol ::traits ::FromField > ::from_field (373006257 _Field );
294+ aztec ::context ::calls ::PublicCall ::< 16 , 1536 , [u8 ; 32 ]> ::new (self .target_contract , selector , " sha256_hash_1536 " , serialized_params )
304295 }
305296
306297 pub fn offchain_receive(self, messages: BoundedVec<aztec::messages::processing::offchain::OffchainMessage, 16>) -> aztec::context::calls::UtilityCall<16, 321, ()> {
@@ -349,15 +340,6 @@ contract AvmGadgetsTest {
349340 }
350341
351342 impl CallSelf<aztec::context::PublicContext> {
352- pub fn sha256_hash_1536 (self , data : [u8 ; 1536 ]) - > [u8 ; 32 ] {
353- let serialized_params: [Field ; 1536 * 1 ] = < [u8 ; 1536 ] as aztec ::protocol ::traits ::Serialize < N = 1536 * 1 >> ::serialize (data );
354- let selector : aztec ::protocol ::abis ::function_selector ::FunctionSelector = < aztec ::protocol ::abis ::function_selector ::FunctionSelector as aztec ::protocol ::traits ::FromField > ::from_field (373006257_Field );
355- // Safety: comment added by `nargo expand`
356- unsafe {
357- aztec::context ::calls ::PublicCall ::< 16 , 1536 * 1, [u8; 32]>::new(self .address , selector , "sha256_hash_1536 ", serialized_params ).call(self .context )
358- }
359- }
360-
361343 pub fn pedersen_hash_with_index (self , data : [Field ; 10 ]) - > Field {
362344 let serialized_params: [Field ; 10 * 1 ] = < [Field ; 10 ] as aztec ::protocol ::traits ::Serialize < N = 10 * 1 >> ::serialize (data );
363345 let selector : aztec ::protocol ::abis ::function_selector ::FunctionSelector = < aztec ::protocol ::abis ::function_selector ::FunctionSelector as aztec ::protocol ::traits ::FromField > ::from_field (3265405934_Field );
@@ -556,12 +538,12 @@ contract AvmGadgetsTest {
556538 }
557539 }
558540
559- pub fn keccak_hash_300 (self , data : [u8 ; 300 ]) - > [u8 ; 32 ] {
560- let serialized_params: [Field ; 300 * 1 ] = < [u8 ; 300 ] as aztec ::protocol ::traits ::Serialize < N = 300 * 1 >> ::serialize (data );
561- let selector : aztec ::protocol ::abis ::function_selector ::FunctionSelector = < aztec ::protocol ::abis ::function_selector ::FunctionSelector as aztec ::protocol ::traits ::FromField > ::from_field (3065624740 _Field );
541+ pub fn sha256_hash_1536 (self , data : [u8 ; 1536 ]) - > [u8 ; 32 ] {
542+ let serialized_params: [Field ; 1536 * 1 ] = < [u8 ; 1536 ] as aztec ::protocol ::traits ::Serialize < N = 1536 * 1 >> ::serialize (data );
543+ let selector : aztec ::protocol ::abis ::function_selector ::FunctionSelector = < aztec ::protocol ::abis ::function_selector ::FunctionSelector as aztec ::protocol ::traits ::FromField > ::from_field (373006257 _Field );
562544 // Safety: comment added by `nargo expand`
563545 unsafe {
564- aztec::context ::calls ::PublicCall ::< 15 , 300 * 1, [u8; 32]>::new(self .address , selector , "keccak_hash_300 ", serialized_params ).call(self .context )
546+ aztec::context ::calls ::PublicCall ::< 16 , 1536 * 1, [u8; 32]>::new(self .address , selector , "sha256_hash_1536 ", serialized_params ).call(self .context )
565547 }
566548 }
567549 }
@@ -577,15 +559,6 @@ contract AvmGadgetsTest {
577559 }
578560
579561 impl EnqueueSelf<&mut aztec::context::PrivateContext> {
580- pub fn sha256_hash_1536 (self , data : [u8 ; 1536 ]) {
581- let serialized_params: [Field ; 1536 * 1 ] = < [u8 ; 1536 ] as aztec ::protocol ::traits ::Serialize < N = 1536 * 1 >> ::serialize (data );
582- let selector : aztec ::protocol ::abis ::function_selector ::FunctionSelector = < aztec ::protocol ::abis ::function_selector ::FunctionSelector as aztec ::protocol ::traits ::FromField > ::from_field (373006257_Field );
583- let calldata : [Field ; 1 + (1536 * 1 )] = [< aztec ::protocol ::abis ::function_selector ::FunctionSelector as aztec ::protocol ::traits ::ToField > ::to_field (selector )].concat (serialized_params );
584- let calldata_hash : Field = aztec ::hash ::hash_calldata_array (calldata );
585- aztec ::oracle ::execution_cache ::store (calldata , calldata_hash );
586- self .context .call_public_function_with_calldata_hash (self .address , calldata_hash , false , false );
587- }
588-
589562 pub fn pedersen_hash_with_index (self , data : [Field ; 10 ]) {
590563 let serialized_params: [Field ; 10 * 1 ] = < [Field ; 10 ] as aztec ::protocol ::traits ::Serialize < N = 10 * 1 >> ::serialize (data );
591564 let selector : aztec ::protocol ::abis ::function_selector ::FunctionSelector = < aztec ::protocol ::abis ::function_selector ::FunctionSelector as aztec ::protocol ::traits ::FromField > ::from_field (3265405934_Field );
@@ -784,10 +757,10 @@ contract AvmGadgetsTest {
784757 self .context .call_public_function_with_calldata_hash (self .address , calldata_hash , false , false );
785758 }
786759
787- pub fn keccak_hash_300 (self , data : [u8 ; 300 ]) {
788- let serialized_params: [Field ; 300 * 1 ] = < [u8 ; 300 ] as aztec ::protocol ::traits ::Serialize < N = 300 * 1 >> ::serialize (data );
789- let selector : aztec ::protocol ::abis ::function_selector ::FunctionSelector = < aztec ::protocol ::abis ::function_selector ::FunctionSelector as aztec ::protocol ::traits ::FromField > ::from_field (3065624740 _Field );
790- let calldata : [Field ; 1 + (300 * 1 )] = [< aztec ::protocol ::abis ::function_selector ::FunctionSelector as aztec ::protocol ::traits ::ToField > ::to_field (selector )].concat (serialized_params );
760+ pub fn sha256_hash_1536 (self , data : [u8 ; 1536 ]) {
761+ let serialized_params: [Field ; 1536 * 1 ] = < [u8 ; 1536 ] as aztec ::protocol ::traits ::Serialize < N = 1536 * 1 >> ::serialize (data );
762+ let selector : aztec ::protocol ::abis ::function_selector ::FunctionSelector = < aztec ::protocol ::abis ::function_selector ::FunctionSelector as aztec ::protocol ::traits ::FromField > ::from_field (373006257 _Field );
763+ let calldata : [Field ; 1 + (1536 * 1 )] = [< aztec ::protocol ::abis ::function_selector ::FunctionSelector as aztec ::protocol ::traits ::ToField > ::to_field (selector )].concat (serialized_params );
791764 let calldata_hash : Field = aztec ::hash ::hash_calldata_array (calldata );
792765 aztec ::oracle ::execution_cache ::store (calldata , calldata_hash );
793766 self .context .call_public_function_with_calldata_hash (self .address , calldata_hash , false , false );
@@ -815,13 +788,6 @@ contract AvmGadgetsTest {
815788 let return_value : [Field ; 32 * 1 ] = < [u8 ; 32 ] as aztec ::protocol ::traits ::Serialize < N = 32 * 1 >> ::serialize (__aztec_nr_internals__keccak_hash (arg0 ));
816789 aztec ::oracle ::avm ::avm_return (return_value .as_vector ());
817790 };
818- if selector == 3065624740_Field {
819- let input_calldata: [Field ; 300 * 1 ] = aztec ::oracle ::avm ::calldata_copy (1_u32 , < [u8 ; 300 ] as aztec ::protocol ::traits ::Serialize < N = 300 * 1 >> ::N );
820- let mut reader : aztec ::protocol ::utils ::reader ::Reader < 300 * 1 > = aztec ::protocol ::utils ::reader ::Reader ::< 300 * 1 > ::new (input_calldata );
821- let arg0 : [u8 ; 300 ] = < [u8 ; 300 ] as aztec ::protocol ::traits ::Deserialize < N = 300 * 1 >> ::stream_deserialize (& mut reader );
822- let return_value : [Field ; 32 * 1 ] = < [u8 ; 32 ] as aztec ::protocol ::traits ::Serialize < N = 32 * 1 >> ::serialize (__aztec_nr_internals__keccak_hash_300 (arg0 ));
823- aztec ::oracle ::avm ::avm_return (return_value .as_vector ());
824- };
825791 if selector == 372001522_Field {
826792 let input_calldata: [Field ; 1400 * 1 ] = aztec ::oracle ::avm ::calldata_copy (1_u32 , < [u8 ; 1400 ] as aztec ::protocol ::traits ::Serialize < N = 1400 * 1 >> ::N );
827793 let mut reader : aztec ::protocol ::utils ::reader ::Reader < 1400 * 1 > = aztec ::protocol ::utils ::reader ::Reader ::< 1400 * 1 > ::new (input_calldata );
@@ -987,10 +953,6 @@ contract AvmGadgetsTest {
987953 pub data: [u8; 1400],
988954 }
989955
990- pub struct keccak_hash_300_parameters {
991- pub data: [u8; 300],
992- }
993-
994956 pub struct keccak_hash_parameters {
995957 pub data: [u8; 10],
996958 }
@@ -1087,12 +1049,6 @@ contract AvmGadgetsTest {
10871049 return_type: [u8; 32],
10881050 }
10891051
1090- #[abi(functions)]
1091- pub struct keccak_hash_300_abi {
1092- parameters: keccak_hash_300_parameters,
1093- return_type: [u8; 32],
1094- }
1095-
10961052 #[abi(functions)]
10971053 pub struct keccak_hash_abi {
10981054 parameters: keccak_hash_parameters,
@@ -1273,24 +1229,6 @@ contract AvmGadgetsTest {
12731229 }
12741230 }
12751231
1276- unconstrained fn __aztec_nr_internals__keccak_hash_300(data: [u8; 300]) -> pub [u8; 32] {
1277- let mut self: aztec::contract_self::contract_self_public::ContractSelfPublic<(), CallSelf<aztec::context::PublicContext>, CallSelfStatic<aztec::context::PublicContext>, CallInternal<aztec::context::PublicContext>> = {
1278- let context: aztec::context::PublicContext = aztec::context::PublicContext::new(|| -> Field {
1279- let serialized_args: [Field; 300 * 1] = aztec::oracle::avm::calldata_copy(1_u32, <[u8; 300] as aztec::protocol::traits::Serialize<N = 300 * 1>>::N);
1280- aztec::hash::hash_args(serialized_args)
1281- });
1282- let storage: () = ();
1283- let self_address: aztec::protocol::address::AztecAddress = context.this_address();
1284- let call_self: CallSelf<aztec::context::PublicContext> = CallSelf::<aztec::context::PublicContext> { address: self_address, context: context};
1285- let call_self_static: CallSelfStatic<aztec::context::PublicContext> = CallSelfStatic::<aztec::context::PublicContext> { address: self_address, context: context};
1286- let internal: CallInternal<aztec::context::PublicContext> = CallInternal::<aztec::context::PublicContext> { context: context};
1287- aztec::contract_self::contract_self_public::ContractSelfPublic::<(), CallSelf<aztec::context::PublicContext>, CallSelfStatic<aztec::context::PublicContext>, CallInternal<aztec::context::PublicContext>>::new(context, storage, call_self, call_self_static, internal)
1288- };
1289- {
1290- keccak256::keccak256(data, data.len())
1291- }
1292- }
1293-
12941232 unconstrained fn __aztec_nr_internals__pedersen_hash(data: [Field; 10]) -> pub Field {
12951233 let mut self: aztec::contract_self::contract_self_public::ContractSelfPublic<(), CallSelf<aztec::context::PublicContext>, CallSelfStatic<aztec::context::PublicContext>, CallInternal<aztec::context::PublicContext>> = {
12961234 let context: aztec::context::PublicContext = aztec::context::PublicContext::new(|| -> Field {
0 commit comments