diff --git a/mopro-core/src/middleware/circom/mod.rs b/mopro-core/src/middleware/circom/mod.rs index f97fed88..cda5ef2e 100644 --- a/mopro-core/src/middleware/circom/mod.rs +++ b/mopro-core/src/middleware/circom/mod.rs @@ -50,6 +50,16 @@ type CircuitInputs = HashMap>; // TODO: Split up this namespace a bit, right now quite a lot of things going on +pub struct CircomState2 { + zkey: Option<(ProvingKey, ConstraintMatrices)>, +} + +impl Default for CircomState2 { + fn default() -> Self { + Self::new() + } +} + pub struct CircomState { builder: Option>, circuit: Option>, @@ -245,6 +255,85 @@ pub fn verify_proof2( Ok(proof_verified) } +impl CircomState2 { + pub fn new() -> Self { + Self { zkey: None } + } + + pub fn initialize(&mut self, zkey_path: &str) -> Result<(), MoproError> { + let zkey = load_arkzkey_from_file(zkey_path)?; + self.zkey = Some(zkey); + Ok(()) + } + + pub fn generate_proof( + &self, + inputs: CircuitInputs, + ) -> Result<(SerializableProof, SerializableInputs), MoproError> { + let mut rng = thread_rng(); + let rng = &mut rng; + + let r = ark_bn254::Fr::rand(rng); + let s = ark_bn254::Fr::rand(rng); + + println!("Generating proof 2"); + + let now = std::time::Instant::now(); + let full_assignment = witness_calculator() + .lock() + .expect("Failed to lock witness calculator") + .calculate_witness_element::(inputs, false) + .map_err(|e| MoproError::CircomError(e.to_string()))?; + + println!("Witness generation took: {:.2?}", now.elapsed()); + + let now = std::time::Instant::now(); + //let zkey = zkey(); + let zkey = self.zkey.as_ref().ok_or(MoproError::CircomError( + "Zkey has not been set up".to_string(), + ))?; + println!("Loading arkzkey took: {:.2?}", now.elapsed()); + + let public_inputs = full_assignment.as_slice()[1..zkey.1.num_instance_variables].to_vec(); + + let now = std::time::Instant::now(); + let ark_proof = Groth16::<_, CircomReduction>::create_proof_with_reduction_and_matrices( + &zkey.0, + r, + s, + &zkey.1, + zkey.1.num_instance_variables, + zkey.1.num_constraints, + full_assignment.as_slice(), + ); + + let proof = ark_proof.map_err(|e| MoproError::CircomError(e.to_string()))?; + + println!("proof generation took: {:.2?}", now.elapsed()); + Ok((SerializableProof(proof), SerializableInputs(public_inputs))) + } + + pub fn verify_proof( + &self, + serialized_proof: SerializableProof, + serialized_inputs: SerializableInputs, + ) -> Result { + let start = Instant::now(); + let zkey = self.zkey.as_ref().ok_or(MoproError::CircomError( + "Zkey has not been set up".to_string(), + ))?; + let pvk = prepare_verifying_key(&zkey.0.vk); + + let proof_verified = + GrothBn::verify_with_processed_vk(&pvk, &serialized_inputs.0, &serialized_proof.0) + .map_err(|e| MoproError::CircomError(e.to_string()))?; + + let verification_duration = start.elapsed(); + println!("Verification time 2: {:?}", verification_duration); + Ok(proof_verified) + } +} + impl CircomState { pub fn new() -> Self { Self { @@ -509,6 +598,57 @@ mod tests { assert!(verify_res.unwrap()); // Verifying that the proof was indeed verified } + #[test] + fn test_setup_prove_verify_keccak_zkey() { + let zkey_path = "./examples/circom/keccak256/target/keccak256_256_test_final.arkzkey"; + // Instantiate CircomState + let mut circom_state = CircomState2::new(); + + // Setup + let setup_res = circom_state.initialize(zkey_path); + assert!(setup_res.is_ok()); + + let _serialized_pk = setup_res.unwrap(); + + // Deserialize the proving key and inputs if necessary + + // Prepare inputs + let input_vec = vec![ + 116, 101, 115, 116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + ]; + + // Expected output + let expected_output_vec = vec![ + 37, 17, 98, 135, 161, 178, 88, 97, 125, 150, 143, 65, 228, 211, 170, 133, 153, 9, 88, + 212, 4, 212, 175, 238, 249, 210, 214, 116, 170, 85, 45, 21, + ]; + + let inputs = bytes_to_circuit_inputs(&input_vec); + let serialized_outputs = bytes_to_circuit_outputs(&expected_output_vec); + + // Proof generation + let generate_proof_res = circom_state.generate_proof(inputs); + + // Check and print the error if there is one + if let Err(e) = &generate_proof_res { + println!("Error: {:?}", e); + } + + assert!(generate_proof_res.is_ok()); + + let (serialized_proof, serialized_inputs) = generate_proof_res.unwrap(); + + // Check output + assert_eq!(serialized_inputs, serialized_outputs); + + // Proof verification + let verify_res = circom_state.verify_proof(serialized_proof, serialized_inputs); + assert!(verify_res.is_ok()); + + assert!(verify_res.unwrap()); // Verifying that the proof was indeed verified + } + #[test] fn test_setup_error() { // Arrange: Create a new CircomState instance @@ -740,7 +880,6 @@ mod tests { #[ignore = "ignore for ci"] #[test] fn test_setup_prove_rsa2() { - let zkey_path = "./examples/circom/rsa/target/main_final.arkzkey"; // Prepare inputs let signature = [ diff --git a/mopro-ffi/src/lib.rs b/mopro-ffi/src/lib.rs index cec4163f..4a4c74ef 100644 --- a/mopro-ffi/src/lib.rs +++ b/mopro-ffi/src/lib.rs @@ -66,6 +66,16 @@ impl From for FFIError { } } +pub struct MoproCircom2 { + state: RwLock, +} + +impl Default for MoproCircom2 { + fn default() -> Self { + Self::new() + } +} + pub struct MoproCircom { state: RwLock, } @@ -130,10 +140,15 @@ pub fn generate_proof2( }) } -pub fn verify_proof2(zkey_path: String,proof: Vec, public_input: Vec) -> Result { +pub fn verify_proof2( + zkey_path: String, + proof: Vec, + public_input: Vec, +) -> Result { let deserialized_proof = circom::serialization::deserialize_proof(proof); let deserialized_public_input = circom::serialization::deserialize_inputs(public_input); - let is_valid = circom::verify_proof2(&zkey_path, deserialized_proof, deserialized_public_input)?; + let is_valid = + circom::verify_proof2(&zkey_path, deserialized_proof, deserialized_public_input)?; Ok(is_valid) } @@ -220,6 +235,57 @@ impl MoproCircom { } } +impl MoproCircom2 { + pub fn new() -> Self { + Self { + state: RwLock::new(circom::CircomState2::new()), + } + } + + pub fn initialize(&self, zkey_path: String) -> Result<(), MoproError> { + let mut state_guard = self.state.write().unwrap(); + state_guard.initialize(zkey_path.as_str())?; + Ok(()) + } + + // inputs: circom::serialization::serialize_inputs(&inputs), + + pub fn generate_proof( + &self, + inputs: HashMap>, + ) -> Result { + let mut state_guard = self.state.write().unwrap(); + + // Convert inputs to BigInt + let bigint_inputs = inputs + .into_iter() + .map(|(k, v)| { + ( + k, + v.into_iter() + .map(|i| BigInt::from_str(&i).unwrap()) + .collect(), + ) + }) + .collect(); + + let (proof, inputs) = state_guard.generate_proof(bigint_inputs)?; + + Ok(GenerateProofResult { + proof: circom::serialization::serialize_proof(&proof), + inputs: circom::serialization::serialize_inputs(&inputs), + }) + } + + pub fn verify_proof(&self, proof: Vec, public_input: Vec) -> Result { + let state_guard = self.state.read().unwrap(); + let deserialized_proof = circom::serialization::deserialize_proof(proof); + let deserialized_public_input = circom::serialization::deserialize_inputs(public_input); + let is_valid = state_guard.verify_proof(deserialized_proof, deserialized_public_input)?; + Ok(is_valid) + } +} + #[cfg(feature = "gpu-benchmarks")] pub fn run_msm_benchmark(num_msm: Option) -> Result { let benchmarks = gpu_explorations::run_msm_benchmark(num_msm).unwrap(); diff --git a/mopro-ffi/src/mopro.udl b/mopro-ffi/src/mopro.udl index e88d0ed8..44001ec8 100644 --- a/mopro-ffi/src/mopro.udl +++ b/mopro-ffi/src/mopro.udl @@ -72,3 +72,17 @@ interface MoproCircom { [Throws=MoproError] boolean verify_proof(bytes proof, bytes public_input); }; + +interface MoproCircom2 { + constructor(); + + [Throws=MoproError] + void initialize(string zkey_path); + + [Throws=MoproError] + GenerateProofResult generate_proof(record> circuit_inputs); + + [Throws=MoproError] + boolean verify_proof(bytes proof, bytes public_input); +}; + diff --git a/mopro-ffi/tests/bindings/test_mopro_keccak.swift b/mopro-ffi/tests/bindings/test_mopro_keccak.swift index 2ca7dc47..2c4437a2 100644 --- a/mopro-ffi/tests/bindings/test_mopro_keccak.swift +++ b/mopro-ffi/tests/bindings/test_mopro_keccak.swift @@ -1,10 +1,11 @@ import mopro import Foundation -let moproCircom = MoproCircom() +let moproCircom = MoproCircom2() let wasmPath = "./../../../../mopro-core/examples/circom/keccak256/target/keccak256_256_test_js/keccak256_256_test.wasm" let r1csPath = "./../../../../mopro-core/examples/circom/keccak256/target/keccak256_256_test.r1cs" +let zkeyPath = "./../../../../mopro-core/examples/circom/keccak256/target/keccak256_256_test_final.arkzkey" // Helper function to convert bytes to bits func bytesToBits(bytes: [UInt8]) -> [String] { @@ -45,8 +46,8 @@ func serializeOutputs(_ stringArray: [String]) -> [UInt8] { do { // Setup - let setupResult = try moproCircom.setup(wasmPath: wasmPath, r1csPath: r1csPath) - assert(!setupResult.provingKey.isEmpty, "Proving key should not be empty") + let setupResult = try moproCircom.initialize(zkeyPath: zkeyPath) + // assert(!setupResult.provingKey.isEmpty, "Proving key should not be empty") // Prepare inputs let inputVec: [UInt8] = [ diff --git a/mopro-ios/MoproKit/Bindings/mopro.swift b/mopro-ios/MoproKit/Bindings/mopro.swift index bfdb364b..f395a885 100644 --- a/mopro-ios/MoproKit/Bindings/mopro.swift +++ b/mopro-ios/MoproKit/Bindings/mopro.swift @@ -505,6 +505,110 @@ public func FfiConverterTypeMoproCircom_lower(_ value: MoproCircom) -> UnsafeMut } +public protocol MoproCircom2Protocol { + func generateProof(circuitInputs: [String: [String]]) throws -> GenerateProofResult + func initialize(zkeyPath: String) throws + func verifyProof(proof: Data, publicInput: Data) throws -> Bool + +} + +public class MoproCircom2: MoproCircom2Protocol { + fileprivate let pointer: UnsafeMutableRawPointer + + // TODO: We'd like this to be `private` but for Swifty reasons, + // we can't implement `FfiConverter` without making this `required` and we can't + // make it `required` without making it `public`. + required init(unsafeFromRawPointer pointer: UnsafeMutableRawPointer) { + self.pointer = pointer + } + public convenience init() { + self.init(unsafeFromRawPointer: try! rustCall() { + uniffi_mopro_ffi_fn_constructor_moprocircom2_new($0) +}) + } + + deinit { + try! rustCall { uniffi_mopro_ffi_fn_free_moprocircom2(pointer, $0) } + } + + + + + + + public func generateProof(circuitInputs: [String: [String]]) throws -> GenerateProofResult { + return try FfiConverterTypeGenerateProofResult.lift( + try + rustCallWithError(FfiConverterTypeMoproError.lift) { + uniffi_mopro_ffi_fn_method_moprocircom2_generate_proof(self.pointer, + FfiConverterDictionaryStringSequenceString.lower(circuitInputs),$0 + ) +} + ) + } + + public func initialize(zkeyPath: String) throws { + try + rustCallWithError(FfiConverterTypeMoproError.lift) { + uniffi_mopro_ffi_fn_method_moprocircom2_initialize(self.pointer, + FfiConverterString.lower(zkeyPath),$0 + ) +} + } + + public func verifyProof(proof: Data, publicInput: Data) throws -> Bool { + return try FfiConverterBool.lift( + try + rustCallWithError(FfiConverterTypeMoproError.lift) { + uniffi_mopro_ffi_fn_method_moprocircom2_verify_proof(self.pointer, + FfiConverterData.lower(proof), + FfiConverterData.lower(publicInput),$0 + ) +} + ) + } +} + +public struct FfiConverterTypeMoproCircom2: FfiConverter { + typealias FfiType = UnsafeMutableRawPointer + typealias SwiftType = MoproCircom2 + + public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> MoproCircom2 { + let v: UInt64 = try readInt(&buf) + // The Rust code won't compile if a pointer won't fit in a UInt64. + // We have to go via `UInt` because that's the thing that's the size of a pointer. + let ptr = UnsafeMutableRawPointer(bitPattern: UInt(truncatingIfNeeded: v)) + if (ptr == nil) { + throw UniffiInternalError.unexpectedNullPointer + } + return try lift(ptr!) + } + + public static func write(_ value: MoproCircom2, into buf: inout [UInt8]) { + // This fiddling is because `Int` is the thing that's the same size as a pointer. + // The Rust code won't compile if a pointer won't fit in a `UInt64`. + writeInt(&buf, UInt64(bitPattern: Int64(Int(bitPattern: lower(value))))) + } + + public static func lift(_ pointer: UnsafeMutableRawPointer) throws -> MoproCircom2 { + return MoproCircom2(unsafeFromRawPointer: pointer) + } + + public static func lower(_ value: MoproCircom2) -> UnsafeMutableRawPointer { + return value.pointer + } +} + + +public func FfiConverterTypeMoproCircom2_lift(_ pointer: UnsafeMutableRawPointer) throws -> MoproCircom2 { + return try FfiConverterTypeMoproCircom2.lift(pointer) +} + +public func FfiConverterTypeMoproCircom2_lower(_ value: MoproCircom2) -> UnsafeMutableRawPointer { + return FfiConverterTypeMoproCircom2.lower(value) +} + + public struct BenchmarkResult { public var numMsm: UInt32 public var avgProcessingTime: Double @@ -1111,9 +1215,21 @@ private var initializationResult: InitializationResult { if (uniffi_mopro_ffi_checksum_method_moprocircom_verify_proof() != 61522) { return InitializationResult.apiChecksumMismatch } + if (uniffi_mopro_ffi_checksum_method_moprocircom2_generate_proof() != 28879) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_mopro_ffi_checksum_method_moprocircom2_initialize() != 11891) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_mopro_ffi_checksum_method_moprocircom2_verify_proof() != 626) { + return InitializationResult.apiChecksumMismatch + } if (uniffi_mopro_ffi_checksum_constructor_moprocircom_new() != 42205) { return InitializationResult.apiChecksumMismatch } + if (uniffi_mopro_ffi_checksum_constructor_moprocircom2_new() != 20845) { + return InitializationResult.apiChecksumMismatch + } return InitializationResult.ok } diff --git a/mopro-ios/MoproKit/Example/MoproKit.xcodeproj/project.pbxproj b/mopro-ios/MoproKit/Example/MoproKit.xcodeproj/project.pbxproj index 429d47dd..52952c66 100644 --- a/mopro-ios/MoproKit/Example/MoproKit.xcodeproj/project.pbxproj +++ b/mopro-ios/MoproKit/Example/MoproKit.xcodeproj/project.pbxproj @@ -10,6 +10,8 @@ 2A418AB02AF4B1200004B747 /* CircomUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2A418AAF2AF4B1200004B747 /* CircomUITests.swift */; }; 2A6E5BAF2AF499460052A601 /* CircomTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2A6E5BAE2AF499460052A601 /* CircomTests.swift */; }; 2AAD38B22B6CC318004F37BB /* FileDownloader.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2AAD38B12B6CC318004F37BB /* FileDownloader.swift */; }; + 2ABABA752B709BD3009EBC9E /* keccak256_256_test_final.arkzkey in Resources */ = {isa = PBXBuildFile; fileRef = 2ABABA742B709BD3009EBC9E /* keccak256_256_test_final.arkzkey */; }; + 2ABABA762B709BD3009EBC9E /* keccak256_256_test_final.arkzkey in Resources */ = {isa = PBXBuildFile; fileRef = 2ABABA742B709BD3009EBC9E /* keccak256_256_test_final.arkzkey */; }; 4384FD09A96F702A375841EE /* Pods_MoproKit_Tests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 78B0F9CBE5DD22576996A993 /* Pods_MoproKit_Tests.framework */; }; 607FACD61AFB9204008FA782 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 607FACD51AFB9204008FA782 /* AppDelegate.swift */; }; 607FACD81AFB9204008FA782 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 607FACD71AFB9204008FA782 /* ViewController.swift */; }; @@ -48,6 +50,7 @@ 2A418AAF2AF4B1200004B747 /* CircomUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CircomUITests.swift; sourceTree = ""; }; 2A6E5BAE2AF499460052A601 /* CircomTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CircomTests.swift; sourceTree = ""; }; 2AAD38B12B6CC318004F37BB /* FileDownloader.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FileDownloader.swift; sourceTree = ""; }; + 2ABABA742B709BD3009EBC9E /* keccak256_256_test_final.arkzkey */ = {isa = PBXFileReference; lastKnownFileType = file; name = keccak256_256_test_final.arkzkey; path = "../../../../../mopro-core/examples/circom/keccak256/target/keccak256_256_test_final.arkzkey"; sourceTree = ""; }; 47F8ADB0AC4168C6E874818D /* MoproKit.podspec */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = MoproKit.podspec; path = ../MoproKit.podspec; sourceTree = ""; }; 5DAF212A114DFA0C9F4282B2 /* Pods-MoproKit_Tests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-MoproKit_Tests.debug.xcconfig"; path = "Target Support Files/Pods-MoproKit_Tests/Pods-MoproKit_Tests.debug.xcconfig"; sourceTree = ""; }; 607FACD01AFB9204008FA782 /* MoproKit_Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = MoproKit_Example.app; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -185,6 +188,7 @@ CEA2D1282AB9681E00F292D2 /* Resources */ = { isa = PBXGroup; children = ( + 2ABABA742B709BD3009EBC9E /* keccak256_256_test_final.arkzkey */, CE2C1B8B2AFFCC5E002AF8BC /* main.wasm */, CE5A5C082AD43A860074539D /* keccak256_256_test.r1cs */, CE5A5C052AD43A790074539D /* keccak256_256_test.wasm */, @@ -296,6 +300,7 @@ files = ( CEA2D1322AB96AB500F292D2 /* multiplier2.r1cs in Resources */, 607FACDB1AFB9204008FA782 /* Main.storyboard in Resources */, + 2ABABA752B709BD3009EBC9E /* keccak256_256_test_final.arkzkey in Resources */, 607FACE01AFB9204008FA782 /* LaunchScreen.xib in Resources */, CE5A5C062AD43A790074539D /* keccak256_256_test.wasm in Resources */, CE2C1B8C2AFFCC5E002AF8BC /* main.wasm in Resources */, @@ -311,6 +316,7 @@ files = ( CE5A5C0A2AD43A860074539D /* keccak256_256_test.r1cs in Resources */, CE5A5C072AD43A790074539D /* keccak256_256_test.wasm in Resources */, + 2ABABA762B709BD3009EBC9E /* keccak256_256_test_final.arkzkey in Resources */, CE2C1B8D2AFFCC5E002AF8BC /* main.wasm in Resources */, CEA2D1332AB96AB500F292D2 /* multiplier2.r1cs in Resources */, CEA2D1302AB96A7A00F292D2 /* multiplier2.wasm in Resources */, diff --git a/mopro-ios/MoproKit/Example/MoproKit/KeccakSetupViewController.swift b/mopro-ios/MoproKit/Example/MoproKit/KeccakSetupViewController.swift index 51936e43..7ad149da 100644 --- a/mopro-ios/MoproKit/Example/MoproKit/KeccakSetupViewController.swift +++ b/mopro-ios/MoproKit/Example/MoproKit/KeccakSetupViewController.swift @@ -10,13 +10,15 @@ import UIKit import MoproKit class KeccakSetupViewController: UIViewController { + + let url = URL(string: "https://mopro.vivianjeng.xyz/keccak256_256_test_final.arkzkey") var setupButton = UIButton(type: .system) var proveButton = UIButton(type: .system) var verifyButton = UIButton(type: .system) var textView = UITextView() - let moproCircom = MoproKit.MoproCircom() + let moproCircom = MoproKit.MoproCircom2() var setupResult: SetupResult? var generatedProof: Data? var publicInputs: Data? @@ -81,14 +83,19 @@ class KeccakSetupViewController: UIViewController { @objc func runSetupAction() { // Logic for setup if let wasmPath = Bundle.main.path(forResource: "keccak256_256_test", ofType: "wasm"), - let r1csPath = Bundle.main.path(forResource: "keccak256_256_test", ofType: "r1cs") { + let r1csPath = Bundle.main.path(forResource: "keccak256_256_test", ofType: "r1cs"), + let zkeyPath = Bundle.main.path(forResource: "keccak256_256_test_final", ofType: "arkzkey"){ // Multiplier example // if let wasmPath = Bundle.main.path(forResource: "multiplier2", ofType: "wasm"), // let r1csPath = Bundle.main.path(forResource: "multiplier2", ofType: "r1cs") { do { - setupResult = try moproCircom.setup(wasmPath: wasmPath, r1csPath: r1csPath) + // Ark zkey url + let documentsUrl = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask).first! + let destinationUrl = documentsUrl.appendingPathComponent((url!).lastPathComponent) + + try moproCircom.initialize(zkeyPath: destinationUrl.path) proveButton.isEnabled = true // Enable the Prove button upon successful setup } catch let error as MoproError { print("MoproError: \(error)") @@ -102,10 +109,10 @@ class KeccakSetupViewController: UIViewController { @objc func runProveAction() { // Logic for prove - guard let setupResult = setupResult else { - print("Setup is not completed yet.") - return - } + // guard let setupResult = setupResult else { + // print("Setup is not completed yet.") + // return + // } do { // Prepare inputs let inputVec: [UInt8] = [ @@ -149,8 +156,8 @@ class KeccakSetupViewController: UIViewController { @objc func runVerifyAction() { // Logic for verify - guard let setupResult = setupResult, - let proof = generatedProof, + //guard let setupResult = setupResult, + guard let proof = generatedProof, let publicInputs = publicInputs else { print("Setup is not completed or proof has not been generated yet.") return diff --git a/mopro-ios/MoproKit/Include/moproFFI.h b/mopro-ios/MoproKit/Include/moproFFI.h index b00c85bf..a47b430f 100644 --- a/mopro-ios/MoproKit/Include/moproFFI.h +++ b/mopro-ios/MoproKit/Include/moproFFI.h @@ -74,6 +74,17 @@ RustBuffer uniffi_mopro_ffi_fn_method_moprocircom_setup(void*_Nonnull ptr, RustB ); int8_t uniffi_mopro_ffi_fn_method_moprocircom_verify_proof(void*_Nonnull ptr, RustBuffer proof, RustBuffer public_input, RustCallStatus *_Nonnull out_status ); +void uniffi_mopro_ffi_fn_free_moprocircom2(void*_Nonnull ptr, RustCallStatus *_Nonnull out_status +); +void*_Nonnull uniffi_mopro_ffi_fn_constructor_moprocircom2_new(RustCallStatus *_Nonnull out_status + +); +RustBuffer uniffi_mopro_ffi_fn_method_moprocircom2_generate_proof(void*_Nonnull ptr, RustBuffer circuit_inputs, RustCallStatus *_Nonnull out_status +); +void uniffi_mopro_ffi_fn_method_moprocircom2_initialize(void*_Nonnull ptr, RustBuffer zkey_path, RustCallStatus *_Nonnull out_status +); +int8_t uniffi_mopro_ffi_fn_method_moprocircom2_verify_proof(void*_Nonnull ptr, RustBuffer proof, RustBuffer public_input, RustCallStatus *_Nonnull out_status +); uint32_t uniffi_mopro_ffi_fn_func_add(uint32_t a, uint32_t b, RustCallStatus *_Nonnull out_status ); RustBuffer uniffi_mopro_ffi_fn_func_generate_proof2(RustBuffer zkey_path, RustBuffer circuit_inputs, RustCallStatus *_Nonnull out_status @@ -243,9 +254,21 @@ uint16_t uniffi_mopro_ffi_checksum_method_moprocircom_setup(void ); uint16_t uniffi_mopro_ffi_checksum_method_moprocircom_verify_proof(void +); +uint16_t uniffi_mopro_ffi_checksum_method_moprocircom2_generate_proof(void + +); +uint16_t uniffi_mopro_ffi_checksum_method_moprocircom2_initialize(void + +); +uint16_t uniffi_mopro_ffi_checksum_method_moprocircom2_verify_proof(void + ); uint16_t uniffi_mopro_ffi_checksum_constructor_moprocircom_new(void +); +uint16_t uniffi_mopro_ffi_checksum_constructor_moprocircom2_new(void + ); uint32_t ffi_mopro_ffi_uniffi_contract_version(void