use dep::std; fn main( verification_key : [Field; 114], proof : [Field; 161], public_inputs : [Field; 68], input_aggregation_object: [Field; 16], key_hash : pub Field, tx_ids: pub [Field; 16], old_root: pub Field, new_root: pub Field, oracle: pub Field ) -> pub [Field; 16] { let tx_root_calc: Field = pedersen_tree_four(tx_ids); assert(oracle == std::hash::pedersen([0])[0]); let batch_root_calc: Field = std::hash::pedersen([tx_root_calc, oracle])[0]; let new_root_calc: Field = std::hash::pedersen([batch_root_calc, old_root])[0]; assert(new_root == new_root_calc); let vk: [Field] = verification_key; let p: [Field] = proof; let pi: [Field] = public_inputs; std::verify_proof( vk, p, pi, key_hash, input_aggregation_object ) } fn pedersen_tree_four(leaves: [Field; 16]) -> Field { let mut tx_tree: [Field; 16] = leaves; for l in 0..8 { tx_tree[l] = std::hash::pedersen([tx_tree[2*l], tx_tree[2*l + 1]])[0]; } for l in 0..4 { tx_tree[l] = std::hash::pedersen([tx_tree[2*l], tx_tree[2*l + 1]])[0]; } for l in 0..2 { tx_tree[l] = std::hash::pedersen([tx_tree[2*l], tx_tree[2*l + 1]])[0]; } std::hash::pedersen([tx_tree[0], tx_tree[1]])[0] }