mirror of
https://github.com/logos-storage/logos-storage-proofs.git
synced 2026-01-02 13:33:10 +00:00
refactor
This commit is contained in:
parent
3126210952
commit
3e8bf7d68e
25
src/ffi.rs
25
src/ffi.rs
@ -144,6 +144,31 @@ pub unsafe extern "C" fn prove(
|
||||
Box::into_raw(Box::new(ProofCtx::new(proof_bytes, public_inputs_bytes)))
|
||||
}
|
||||
|
||||
/// # Safety
|
||||
///
|
||||
/// Use after constructing a StorageProofs object with init
|
||||
#[no_mangle]
|
||||
pub unsafe extern "C" fn prove_mpack(
|
||||
prover_ptr: *mut StorageProofs,
|
||||
args: *const Buffer,
|
||||
) -> *mut ProofCtx {
|
||||
let inputs = std::slice::from_raw_parts((*args).data, (*args).len);
|
||||
|
||||
let proof_bytes = &mut Vec::new();
|
||||
let public_inputs_bytes = &mut Vec::new();
|
||||
|
||||
let mut _prover = &mut *prover_ptr;
|
||||
_prover
|
||||
.prove(
|
||||
inputs,
|
||||
proof_bytes,
|
||||
public_inputs_bytes,
|
||||
)
|
||||
.unwrap();
|
||||
|
||||
Box::into_raw(Box::new(ProofCtx::new(proof_bytes, public_inputs_bytes)))
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
/// # Safety
|
||||
///
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user