diff --git a/libs/x86_64-pc-windows-gnu/librln.a b/libs/x86_64-pc-windows-gnu/librln.a index f695c19..8cd20c9 100644 Binary files a/libs/x86_64-pc-windows-gnu/librln.a and b/libs/x86_64-pc-windows-gnu/librln.a differ diff --git a/libs/x86_64-unknown-linux-gnu/librln.a b/libs/x86_64-unknown-linux-gnu/librln.a index 98984e5..86c6229 100644 Binary files a/libs/x86_64-unknown-linux-gnu/librln.a and b/libs/x86_64-unknown-linux-gnu/librln.a differ diff --git a/libs/x86_64-unknown-linux-musl/librln.a b/libs/x86_64-unknown-linux-musl/librln.a index 8c06737..7ba2093 100644 Binary files a/libs/x86_64-unknown-linux-musl/librln.a and b/libs/x86_64-unknown-linux-musl/librln.a differ diff --git a/rln/librln.h b/rln/librln.h index 2aa3fca..65432b1 100644 --- a/rln/librln.h +++ b/rln/librln.h @@ -94,6 +94,8 @@ bool set_metadata(struct RLN *ctx, const struct Buffer *input_buffer); bool get_metadata(const struct RLN *ctx, struct Buffer *output_buffer); +bool flush(struct RLN *ctx); + bool hash(const struct Buffer *input_buffer, struct Buffer *output_buffer); bool poseidon_hash(const struct Buffer *input_buffer, struct Buffer *output_buffer); diff --git a/rln/wrapper.go b/rln/wrapper.go index a23af4f..1e338cf 100644 --- a/rln/wrapper.go +++ b/rln/wrapper.go @@ -222,3 +222,14 @@ func (r *RLN) GetRoot() ([]byte, error) { return C.GoBytes(unsafe.Pointer(out.ptr), C.int(out.len)), nil } + +func (r *RLN) GetLeaf(index uint) ([]byte, error) { + var output []byte + out := toBuffer(output) + + if !bool(C.get_leaf(r.ptr, C.uintptr_t(index), &out)) { + return nil, errors.New("could not get the leaf") + } + + return C.GoBytes(unsafe.Pointer(out.ptr), C.int(out.len)), nil +} diff --git a/zerokit b/zerokit index 8a365f0..6d58320 160000 --- a/zerokit +++ b/zerokit @@ -1 +1 @@ -Subproject commit 8a365f0c9e5c4a744f70c5dd4904ce8d8f926c34 +Subproject commit 6d583200777aa94131e687e1797af0ba568a66dc