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)]
|
#[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,
|
||||||
|
|||||||
@ -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>,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user