11mod consensus_state;
22
3- use core :: proof:: state_proof:: { MinaStateProof , MinaStatePubInputs } ;
3+ use mina_bridge_core :: proof:: state_proof:: { MinaStateProof , MinaStatePubInputs } ;
44
55use ark_ec:: short_weierstrass_jacobian:: GroupAffine ;
66use consensus_state:: { select_longer_chain, LongerChainResult } ;
@@ -25,21 +25,21 @@ const MAX_PROOF_SIZE: usize = 48 * 1024;
2525const MAX_PUB_INPUT_SIZE : usize = 6 * 1024 ;
2626
2727#[ no_mangle]
28- pub extern "C" fn verify_protocol_state_proof_ffi (
29- proof_bytes : & [ u8 ; MAX_PROOF_SIZE ] ,
28+ pub extern "C" fn verify_mina_state_ffi (
29+ proof_buffer : & [ u8 ; MAX_PROOF_SIZE ] ,
3030 proof_len : usize ,
31- pub_input_bytes : & [ u8 ; MAX_PUB_INPUT_SIZE ] ,
31+ pub_input_buffer : & [ u8 ; MAX_PUB_INPUT_SIZE ] ,
3232 pub_input_len : usize ,
3333) -> bool {
34- let proof: MinaStateProof = match bincode:: deserialize ( & proof_bytes [ ..proof_len] ) {
34+ let proof: MinaStateProof = match bincode:: deserialize ( & proof_buffer [ ..proof_len] ) {
3535 Ok ( proof) => proof,
3636 Err ( err) => {
3737 eprintln ! ( "Failed to deserialize state proof: {}" , err) ;
3838 return false ;
3939 }
4040 } ;
4141 let pub_inputs: MinaStatePubInputs =
42- match bincode:: deserialize ( & pub_input_bytes [ ..pub_input_len] ) {
42+ match bincode:: deserialize ( & pub_input_buffer [ ..pub_input_len] ) {
4343 Ok ( pub_inputs) => pub_inputs,
4444 Err ( err) => {
4545 eprintln ! ( "Failed to deserialize state pub inputs: {}" , err) ;
@@ -208,12 +208,8 @@ mod test {
208208 assert ! ( pub_input_size <= pub_input_buffer. len( ) ) ;
209209 pub_input_buffer[ ..pub_input_size] . clone_from_slice ( PUB_INPUT_BYTES ) ;
210210
211- let result = verify_protocol_state_proof_ffi (
212- & proof_buffer,
213- proof_size,
214- & pub_input_buffer,
215- pub_input_size,
216- ) ;
211+ let result =
212+ verify_mina_state_ffi ( & proof_buffer, proof_size, & pub_input_buffer, pub_input_size) ;
217213 assert ! ( result) ;
218214 }
219215
@@ -229,12 +225,8 @@ mod test {
229225 assert ! ( pub_input_size <= pub_input_buffer. len( ) ) ;
230226 pub_input_buffer[ ..pub_input_size] . clone_from_slice ( PROTOCOL_STATE_BAD_HASH_PUB_BYTES ) ;
231227
232- let result = verify_protocol_state_proof_ffi (
233- & proof_buffer,
234- proof_size,
235- & pub_input_buffer,
236- pub_input_size,
237- ) ;
228+ let result =
229+ verify_mina_state_ffi ( & proof_buffer, proof_size, & pub_input_buffer, pub_input_size) ;
238230 assert ! ( !result) ;
239231 }
240232
0 commit comments