usize::from_le_bytes will take an array of length 2, 4 or 8 bytes depending on the target pointer size. Since wasm uses 32b, there was a failure while reading serialized values due to the number of bytes read being incorrect. I also update version rln-wasm to 0.0.9 (npm package needs to be updated to include this fix)
* chore: fix Makefile pre-build
* chore: add Makefile command to install depenedncy cargo-make
* chore: update all READMEs with instructions to install dependencies, build and test
* chore: add target to fetch all submodules
* test: move tests for rln, multiplier and private-settlements to tests folder
* test: fix rln test for poseiden tree
* test: move tests for rln-wasn to standalone tests folder
* test: move tests for semaphore and utils to standalone tests folder
* chore: cargo fmt
* test: rename test files
* test: move tests out from rln/src/public to test folder
* test: fix rln tests, move tests accessign private fields back to relevant source file
* chor: run cargo fmt
* test: move all semaphore tests to tests folder
* chore: cargo fmt
Added macros to do the following:
read the input passed to the FFI API;
cast it to a byte sequence;
pass the byte sequence to the corresponding public function;
cast the output of the public function to Buffer(if any) and write it into the FFI caller ´output_buffer` variable;
erase memory from any temporarily allocated data structure;
return true if everything went fine, false otherwise.
* feat(rln): add API to recover id_secret when a user is slashed
* feat(rln): add RLN API for recovering id_secret
* feat(rln): add recover_id_secret FFI API; update public API docs
* fix(rln): address reviewers' comments
* fix(rln): removing ; for clippy
* feat(rln): expand documentation with minimal public API usage example
* refactor(rln): ease RLN interaction with new APIs
* feat(rln): expand API docs
* fix(rln): disable doctest for rln
* fix(rln): throw if attempting to insert out of bounds
* chore(rln): better error msg
* fix(merkle-tree): make it mimic OptimalMerkleTree impl
* chore(rln): return result as is
* feat(rln): ability to set leaves from a given index
* style(rln): fmt
* fix(rln): bubble the error
* revert: "fix(rln): bubble the error"
This reverts commit 40265082ba.
* fix(rln): replace ark::std::Zero with default
* fix(rln): ordering of ffi api
* fix(rln): use PoseidonHash::default_leaf
* chore(rln): add ffi test for batching
* docs(rln): add entry to changelog
* fix(rln): address reviews
* fix(changelog): fmt
* fix(rln): safe conversion
* fix(rln): reset tree with init func, add comments
* chore(rln): add comment about init_tree_with_leaves
* fix(rln): comment
* refactor(rln): removing unused crates/dependencies
* cargo fmt
* refactor(rln): removed more dependencies; curve/fields as parameters
* refactor(rln): use poseidon-rs hash instead of semaphore-rs poseidon
* chore(rln): remove deps
* refactor(rln): use exclusively arkworks Fr
* refactor(rln): integrate poseidon-rs implementation to work with arkworks arithmetic
* fix(rln): remove previous poseidon-rs wrapper
* feat(rln): add features to select MT; remove prints if not in debug mode
* fix(rln): collect test parameters in a vector
* feat(RLN): add `new_with_params` (#36)
Allows passing the wasm, zkey and verification key data as buffers, instead of using a path to a folder
* chore(rln): simplify read wasm
* fix(rln): remove unused dependencies
* cargo fmt
* fix(rln): update dependencies, fix commit
* refactor(rln): restore ark-circom original dep
Co-authored-by: Richard Ramos <info@richardramos.me>
* refactor(rln): replace merkle tree implementation
refactor(rln): before switch
refactor(rln): replace merkle tree implementation
fix(rln): cargo fmt, cargo clippy
cargo fmt
* chore(rln): add comments
* chore(rln): cargo fmt; cargo clippy
* refactor(rln): improve Merkle tree crate
- Integrate previous Full storage MT with Optimal (storage) MT implementation
- Align the two implementation to same API/traits implementations
- Align implementations as much as possible to same language and variable names/meaning
- Comment code
- Add descriptions to each module's crate
- address reviewer's comments
* refactor(rln): fmt, clippy, remove pub from next index, update output type for some proc
chore(rln): clippy and fmt
fix(rln): cargo fix
ci: update submodules
chore(rln): remove unnecessary test, restyle
fix(rln): switch to field type, add field arithmetic
feat(rln): public input computation from witness
fix(rln): fix semaphore crate version