mirror of
https://github.com/logos-messaging/go-rln.git
synced 2026-01-02 13:03:07 +00:00
started working on things
This commit is contained in:
parent
609b91bfe3
commit
b5279edfc6
3
.gitmodules
vendored
Normal file
3
.gitmodules
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
[submodule "rln"]
|
||||
path = lib/rln
|
||||
url = https://github.com/kilic/rln
|
||||
4
Makefile
Normal file
4
Makefile
Normal file
@ -0,0 +1,4 @@
|
||||
.PHONY: rlnlib
|
||||
rlnlib:
|
||||
cd lib/rln && cargo build --release
|
||||
cp lib/rln/target/release/librln.* lib/
|
||||
37
lib/librln.h
Normal file
37
lib/librln.h
Normal file
@ -0,0 +1,37 @@
|
||||
#include <cstdarg>
|
||||
#include <cstdint>
|
||||
#include <cstdlib>
|
||||
#include <ostream>
|
||||
#include <new>
|
||||
|
||||
template<typename E = void>
|
||||
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<Bn256> **ctx);
|
||||
|
||||
bool generate_proof(const RLN<Bn256> *ctx, const Buffer *input_buffer, Buffer *output_buffer);
|
||||
|
||||
bool verify(const RLN<Bn256> *ctx,
|
||||
const Buffer *proof_buffer,
|
||||
const Buffer *public_inputs_buffer,
|
||||
uint32_t *result_ptr);
|
||||
|
||||
bool hash(const RLN<Bn256> *ctx,
|
||||
const Buffer *inputs_buffer,
|
||||
const uintptr_t *input_len,
|
||||
Buffer *output_buffer);
|
||||
|
||||
bool key_gen(const RLN<Bn256> *ctx, Buffer *keypair_buffer);
|
||||
|
||||
} // extern "C"
|
||||
0
lib/rln/cbindgen.toml
Normal file
0
lib/rln/cbindgen.toml
Normal file
Loading…
x
Reference in New Issue
Block a user