mirror of
https://github.com/logos-storage/logos-storage-proofs.git
synced 2026-01-02 13:33:10 +00:00
fix ffi
This commit is contained in:
parent
3057cb201b
commit
1f9cb9175a
11
src/ffi.rs
11
src/ffi.rs
@ -6,15 +6,15 @@ use std::str;
|
||||
#[derive(Debug, Clone)]
|
||||
#[repr(C)]
|
||||
pub struct Buffer {
|
||||
data: *const u8,
|
||||
len: usize,
|
||||
pub data: *const u8,
|
||||
pub len: usize,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
#[repr(C)]
|
||||
pub struct ProofCtx {
|
||||
proof: Buffer,
|
||||
public_inputs: Buffer,
|
||||
pub proof: Buffer,
|
||||
pub public_inputs: Buffer,
|
||||
}
|
||||
|
||||
impl ProofCtx {
|
||||
@ -71,10 +71,9 @@ pub unsafe extern "C" fn init(
|
||||
Box::into_raw(Box::new(StorageProofs::new(wasm, r1cs, zkey)))
|
||||
}
|
||||
|
||||
|
||||
/// # Safety
|
||||
///
|
||||
/// Use after constructing a StorageProofs object
|
||||
/// Use after constructing a StorageProofs object with init
|
||||
#[no_mangle]
|
||||
pub unsafe extern "C" fn prove(
|
||||
prover_ptr: *mut StorageProofs,
|
||||
|
||||
@ -11,7 +11,6 @@ use ark_std::rand::rngs::ThreadRng;
|
||||
use ruint::aliases::U256;
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
#[repr(C)]
|
||||
pub struct StorageProofs {
|
||||
builder: CircomBuilder<Bn254>,
|
||||
params: ProvingKey<Bn254>,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user