Minimal FFI example for C and Nim

This commit is contained in:
Oskar Thoren 2022-01-18 11:19:17 +08:00
parent fb81e32977
commit cc4cf11583
No known key found for this signature in database
GPG Key ID: B2ECCFD3BC2EF77E
3 changed files with 20 additions and 0 deletions

View File

@ -2,3 +2,12 @@
Example wrapper around a basic Circom circuit to test Circom 2 integration
through ark-circom and FFI.
# FFI
To generate C or Nim bindings from Rust FFI, use `cbindgen` or `nbindgen`:
```
cbindgen . -o target/multiplier.h
nbindgen . -o target/multiplier.nim
```

10
multiplier/src/ffi.rs Normal file
View File

@ -0,0 +1,10 @@
// Rust FFI
#[no_mangle]
pub extern "C" fn foobar() -> bool {
true
}
// prove
// verify
// params?

1
multiplier/src/lib.rs Normal file
View File

@ -0,0 +1 @@
pub mod ffi;