mirror of
https://github.com/logos-messaging/go-zerokit-rln-arm.git
synced 2026-01-02 13:33:12 +00:00
chore: update zerokit to include atomic_operation
This commit is contained in:
parent
f90e66aebb
commit
89b514ad76
BIN
libs/aarch64-linux-android/librln.a
Normal file
BIN
libs/aarch64-linux-android/librln.a
Normal file
Binary file not shown.
Binary file not shown.
BIN
libs/arm-unknown-linux-gnueabi/librln.a
Normal file
BIN
libs/arm-unknown-linux-gnueabi/librln.a
Normal file
Binary file not shown.
BIN
libs/arm-unknown-linux-gnueabihf/librln.a
Normal file
BIN
libs/arm-unknown-linux-gnueabihf/librln.a
Normal file
Binary file not shown.
Binary file not shown.
@ -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 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_root(const struct RLN *ctx, struct Buffer *output_buffer);
|
||||||
|
|
||||||
bool get_proof(const struct RLN *ctx, uintptr_t index, struct Buffer *output_buffer);
|
bool get_proof(const struct RLN *ctx, uintptr_t index, struct Buffer *output_buffer);
|
||||||
|
|||||||
@ -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))
|
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 {
|
func (r *RLN) DeleteLeaf(index uint) bool {
|
||||||
return bool(C.delete_leaf(r.ptr, C.uintptr_t(index)))
|
return bool(C.delete_leaf(r.ptr, C.uintptr_t(index)))
|
||||||
}
|
}
|
||||||
|
|||||||
@ -4,26 +4,26 @@ export RUSTFLAGS="-Ccodegen-units=1"
|
|||||||
|
|
||||||
rustup default stable
|
rustup default stable
|
||||||
|
|
||||||
cargo install cross --git https://github.com/cross-rs/cross --branch main
|
cargo install cross
|
||||||
|
|
||||||
pushd zerokit/rln
|
platforms=(
|
||||||
|
'aarch64-unknown-linux-gnu'
|
||||||
|
'armv7-linux-androideabi'
|
||||||
|
'arm-unknown-linux-gnueabi'
|
||||||
|
'arm-unknown-linux-gnueabihf'
|
||||||
|
'aarch64-linux-android'
|
||||||
|
)
|
||||||
|
|
||||||
cargo clean
|
for platform in ${platforms[*]}
|
||||||
|
|
||||||
cross build --release --lib --target=aarch64-unknown-linux-gnu
|
|
||||||
cross build --release --lib --target=armv7-linux-androideabi
|
|
||||||
#cross build --release --lib --target=arm-unknown-linux-gnueabi
|
|
||||||
#cross build --release --lib --target=arm-unknown-linux-gnueabihf
|
|
||||||
#cross build --release --lib --target=aarch64-linux-android
|
|
||||||
|
|
||||||
popd
|
|
||||||
|
|
||||||
DIRECTORY=./libs
|
|
||||||
TOOLS_DIR=`dirname $0`
|
|
||||||
COMPILE_DIR=${TOOLS_DIR}/../zerokit/target
|
|
||||||
for platform in `ls ${COMPILE_DIR} | grep -v release | grep -v debug | grep -v CACHEDIR.TAG`
|
|
||||||
do
|
do
|
||||||
PLATFORM_DIR=${DIRECTORY}/$platform
|
mkdir -p ./libs/${platform}
|
||||||
mkdir -p ${PLATFORM_DIR}
|
pushd zerokit/rln
|
||||||
cp ${COMPILE_DIR}/$platform/release/librln.a ${PLATFORM_DIR}
|
cargo clean
|
||||||
|
cross build --release --lib --target=${platform}
|
||||||
|
cp ../target/${platform}/release/librln.a ../../libs/${platform}/.
|
||||||
|
popd
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
2
zerokit
2
zerokit
@ -1 +1 @@
|
|||||||
Subproject commit 2e868d6cbf68ee0f87975a89a25aa0333971d398
|
Subproject commit c2d386cb749f551541bb34c4386a3849485356f9
|
||||||
Loading…
x
Reference in New Issue
Block a user