Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support padding for the leaves of the merkle tree (#647)
* Did some organization in test_hash_api and fixed some edge case that can cause the test to seg-fault Signed-off-by: Koren-Brand <[email protected]> * basic test pass * all tests pass without padding * basic test pass * Revert "basic test pass" This reverts commit 8018c0d. * basic tests pass * Initial test for padding in merkle tree. currently crashes when trying to generate a proof of the last (and only) leaf index Signed-off-by: Koren-Brand <[email protected]> * bug fix at proof allocation * output buffer overflow in hash (seems to launch hash twice) Signed-off-by: Koren-Brand <[email protected]> * bug fix for the case of 17 hases at the last layer * formating * Partial leaf test of zero padding has memory overflow when copying to padded_leaves (during build, init_padded_leaves, line 441) Signed-off-by: Koren-Brand <[email protected]> * bug fix T tHe padded vector * Added interesting cases for zero padding and duplicated the zero padding test for last value padding Signed-off-by: Koren-Brand <[email protected]> * format * input_default -> default_input * assert changed * spelling fix * format * Weird test with cuda and cpu MerkleTreeLarge - root doesn't match and cuda always has zeros in some parts Signed-off-by: Koren-Brand <[email protected]> * Prints now work (Decimal instead of hex) Signed-off-by: Koren-Brand <[email protected]> * Fixed stack-use-after-scope error (Accessing root after tree is deleted) and some additional memory leaks in Merkle tree cpu backend as well as the hash tests Signed-off-by: Koren-Brand <[email protected]> * formatting Signed-off-by: Koren-Brand <[email protected]> * Fixed bug that caused poseidon merkle tree to fail on rust (And added the same test to cpp test_hash_api) Signed-off-by: Koren-Brand <[email protected]> * Bug fix in poseidon_tree test in test-hash-api (CPP) where field elements weren't randomized properly Signed-off-by: Koren-Brand <[email protected]> * formatting Signed-off-by: Koren-Brand <[email protected]> * Fixed the documentation to match the actual function is_valid_tree Signed-off-by: Koren-Brand <[email protected]> * other PR changes Signed-off-by: Koren-Brand <[email protected]> * fix device that was not defined in scope to s_reference_target in padding tests Signed-off-by: Koren-Brand <[email protected]> * use smart pointers * format * Standardized the Merkle tree test in test_hash_api.cpp to all use the same test_merkle_tree function Signed-off-by: Koren-Brand <[email protected]> * spelling Signed-off-by: Koren-Brand <[email protected]> * Statistically possible valid wrong leaves during Merkle tree test has been addressed Signed-off-by: Koren-Brand <[email protected]> * formatting Signed-off-by: Koren-Brand <[email protected]> --------- Signed-off-by: Koren-Brand <[email protected]> Co-authored-by: Koren-Brand <[email protected]>
- Loading branch information