diff --git a/libs/aarch64-apple-darwin/librln.a b/libs/aarch64-apple-darwin/librln.a index 6ef1bed..e7b0e94 100644 Binary files a/libs/aarch64-apple-darwin/librln.a and b/libs/aarch64-apple-darwin/librln.a differ diff --git a/libs/x86_64-apple-darwin/librln.a b/libs/x86_64-apple-darwin/librln.a index bb13f75..aa76dd3 100644 Binary files a/libs/x86_64-apple-darwin/librln.a and b/libs/x86_64-apple-darwin/librln.a differ diff --git a/rln/librln.h b/rln/librln.h index b7c6a71..60e4545 100644 --- a/rln/librln.h +++ b/rln/librln.h @@ -45,6 +45,11 @@ bool set_leaves_from(struct RLN *ctx, uintptr_t index, const struct Buffer *inpu bool init_tree_with_leaves(struct RLN *ctx, const struct Buffer *input_buffer); +bool atomic_operation(struct RLN *ctx, + uintptr_t index, + const struct Buffer *leaves_buffer, + const struct Buffer *indices_buffer); + bool get_root(const struct RLN *ctx, struct Buffer *output_buffer); bool get_proof(const struct RLN *ctx, uintptr_t index, struct Buffer *output_buffer); diff --git a/rln/wrapper.go b/rln/wrapper.go index 1a5e336..0d6c153 100644 --- a/rln/wrapper.go +++ b/rln/wrapper.go @@ -132,6 +132,12 @@ func (r *RLN) SetLeavesFrom(index uint, idcommitments []byte) bool { return bool(C.set_leaves_from(r.ptr, C.uintptr_t(index), idCommBuffer)) } +func (r *RLN) AtomicOperation(index uint, leaves []byte, indices []byte) bool { + leavesBuffer := toCBufferPtr(leaves) + indicesBuffer := toCBufferPtr(indices) + return bool(C.atomic_operation(r.ptr, C.uintptr_t(index), leavesBuffer, indicesBuffer)) +} + func (r *RLN) DeleteLeaf(index uint) bool { return bool(C.delete_leaf(r.ptr, C.uintptr_t(index))) } diff --git a/scripts/build.sh b/scripts/build.sh index 03e7e43..8699062 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -4,8 +4,6 @@ export RUSTFLAGS="-Ccodegen-units=1" rustup default stable -cargo install cross --git https://github.com/cross-rs/cross --branch main - pushd zerokit/rln cargo clean diff --git a/zerokit b/zerokit index 2e868d6..c2d386c 160000 --- a/zerokit +++ b/zerokit @@ -1 +1 @@ -Subproject commit 2e868d6cbf68ee0f87975a89a25aa0333971d398 +Subproject commit c2d386cb749f551541bb34c4386a3849485356f9