@@ -14,6 +14,21 @@ use zk_ee::reference_implementations::DecreasingNative;
1414use zk_ee:: system:: errors:: subsystem:: SubsystemError ;
1515use zk_ee:: system:: base_system_functions:: { Bn254AddErrors , Sha256Errors , RipeMd160Errors , Keccak256Errors ,
1616Bn254MulErrors , P256VerifyErrors , Secp256k1ECRecoverErrors , Bn254PairingCheckErrors , PointEvaluationErrors } ;
17+ use zk_ee:: system:: logger:: NullLogger ;
18+
19+ struct DummyOracle ;
20+
21+ impl zk_ee:: oracle:: IOOracle for DummyOracle {
22+ type RawIterator < ' a > = Box < dyn ExactSizeIterator < Item = usize > + ' static > ;
23+
24+ fn raw_query < ' a , I : zk_ee:: oracle:: usize_serialization:: UsizeSerializable + zk_ee:: oracle:: usize_serialization:: UsizeDeserializable > (
25+ & ' a mut self ,
26+ _query_type : u32 ,
27+ _input : & I ,
28+ ) -> Result < Self :: RawIterator < ' a > , zk_ee:: system:: errors:: internal:: InternalError > {
29+ unreachable ! ( "oracle should not be consulted on native targets" ) ;
30+ }
31+ }
1732
1833pub fn ecadd ( src : & [ u8 ] , dst : & mut Vec < u8 > ) -> Result < ( ) , SubsystemError < Bn254AddErrors > > {
1934 let allocator = std:: alloc:: Global ;
@@ -54,7 +69,7 @@ pub fn p256_verify(src: &[u8], dst: &mut Vec<u8>) -> Result<(), SubsystemError<P
5469pub fn ecrecover ( src : & [ u8 ] , dst : & mut Vec < u8 > ) -> Result < ( ) , SubsystemError < Secp256k1ECRecoverErrors > > {
5570 let allocator = std:: alloc:: Global ;
5671 let mut resource = <BaseResources < DecreasingNative > as Resource >:: FORMAL_INFINITE ;
57- EcRecoverImpl :: execute ( & src, dst, & mut resource, allocator)
72+ EcRecoverImpl :: execute ( & src, dst, & mut resource, & mut DummyOracle , & mut NullLogger , allocator)
5873}
5974
6075pub fn pairing ( src : & [ u8 ] , dst : & mut Vec < u8 > ) -> Result < ( ) , SubsystemError < Bn254PairingCheckErrors > > {
0 commit comments