#include #include #include #include #include template struct RLN; /// Buffer struct is taken from /// https://github.com/celo-org/celo-threshold-bls-rs/blob/master/crates/threshold-bls-ffi/src/ffi.rs struct Buffer { const uint8_t *ptr; uintptr_t len; }; extern "C" { bool new_circuit_from_params(uintptr_t merkle_depth, const Buffer *parameters_buffer, RLN **ctx); bool generate_proof(const RLN *ctx, const Buffer *input_buffer, Buffer *output_buffer); bool verify(const RLN *ctx, const Buffer *proof_buffer, const Buffer *public_inputs_buffer, uint32_t *result_ptr); bool hash(const RLN *ctx, const Buffer *inputs_buffer, const uintptr_t *input_len, Buffer *output_buffer); bool key_gen(const RLN *ctx, Buffer *keypair_buffer); } // extern "C"