update ffi

This commit is contained in:
Jaremy Creechley 2023-12-22 19:30:24 -07:00
parent f850b6652c
commit aa7750bc4b
No known key found for this signature in database
GPG Key ID: 4E66FB67B21D3300
4 changed files with 6 additions and 6 deletions

View File

@ -1,4 +1,4 @@
task genffi, "update the nim ffi bindings": task genffi, "update the nim ffi bindings":
exec "cargo install --force nbindgen" exec "cargo install nbindgen"
exec "nbindgen --crate codex-storage-proofs --output codex_proofs_ffi.nim" exec "nbindgen --crate codex-storage-proofs --output codex_proofs_ffi.nim"

View File

@ -26,9 +26,9 @@ proc free_prover*(prover: ptr StorageProofs) {.importc: "free_prover".}
## # Safety ## # Safety
# #
# Construct a StorageProofs object # Construct a StorageProofs object
proc init_proof_ctx*(r1cs: Buffer, proc init_storage_proofs*(r1cs: Buffer,
wasm: Buffer, wasm: Buffer,
zkey: ptr Buffer): (ptr StorageProofs) {.importc: "init_proof_ctx".} zkey: ptr Buffer): (ptr StorageProofs) {.importc: "init_storage_proofs".}
## # Safety ## # Safety
# #

View File

@ -25,4 +25,4 @@ import codex_proofs_ffi
export codex_proofs_ffi export codex_proofs_ffi
when isMainModule: when isMainModule:
init() init_proof_ctx()

View File

@ -36,7 +36,7 @@ impl ProofCtx {
/// ///
/// Construct a StorageProofs object /// Construct a StorageProofs object
#[no_mangle] #[no_mangle]
pub unsafe extern "C" fn init_proof_ctx( pub unsafe extern "C" fn init_storage_proofs(
r1cs: Buffer, r1cs: Buffer,
wasm: Buffer, wasm: Buffer,
zkey: *const Buffer, zkey: *const Buffer,