This commit is contained in:
Dmitriy Ryajov 2023-04-10 12:16:29 -06:00
parent 3057cb201b
commit 1f9cb9175a
No known key found for this signature in database
GPG Key ID: DA8C680CE7C657A4
2 changed files with 5 additions and 7 deletions

View File

@ -6,15 +6,15 @@ use std::str;
#[derive(Debug, Clone)] #[derive(Debug, Clone)]
#[repr(C)] #[repr(C)]
pub struct Buffer { pub struct Buffer {
data: *const u8, pub data: *const u8,
len: usize, pub len: usize,
} }
#[derive(Debug, Clone)] #[derive(Debug, Clone)]
#[repr(C)] #[repr(C)]
pub struct ProofCtx { pub struct ProofCtx {
proof: Buffer, pub proof: Buffer,
public_inputs: Buffer, pub public_inputs: Buffer,
} }
impl ProofCtx { impl ProofCtx {
@ -71,10 +71,9 @@ pub unsafe extern "C" fn init(
Box::into_raw(Box::new(StorageProofs::new(wasm, r1cs, zkey))) Box::into_raw(Box::new(StorageProofs::new(wasm, r1cs, zkey)))
} }
/// # Safety /// # Safety
/// ///
/// Use after constructing a StorageProofs object /// Use after constructing a StorageProofs object with init
#[no_mangle] #[no_mangle]
pub unsafe extern "C" fn prove( pub unsafe extern "C" fn prove(
prover_ptr: *mut StorageProofs, prover_ptr: *mut StorageProofs,

View File

@ -11,7 +11,6 @@ use ark_std::rand::rngs::ThreadRng;
use ruint::aliases::U256; use ruint::aliases::U256;
#[derive(Debug, Clone)] #[derive(Debug, Clone)]
#[repr(C)]
pub struct StorageProofs { pub struct StorageProofs {
builder: CircomBuilder<Bn254>, builder: CircomBuilder<Bn254>,
params: ProvingKey<Bn254>, params: ProvingKey<Bn254>,