Commit Graph

21 Commits

Author SHA1 Message Date
Jack Grigg
2064d1c801 Refactor zcash_primitives::merkle_tree::CommitmentTreeWitness
- The internal Option wrapper was an unnecessary leftover from when this
  code was directly inside the prover, where Some(x) represents an
  assigned variable.
- CommitmentTreeWitness::from_slice_with_depth is more idiomatic Rust.
2020-02-07 00:06:57 +00:00
François Garillot
865275e2a2 Correcting some trivial Rust option/iterator warts 2020-01-29 13:53:05 -08:00
NikVolf
730d2cbc7e fix outdated example 2019-09-28 12:50:28 +03:00
NikVolf
b42477a0bf update from rand_os to fix warnings 2019-09-28 10:48:43 +03:00
Jack Grigg
3a8efd9e67 Address various clippy warnings/errors in zcash_primitives 2019-08-24 00:39:49 +01:00
Eirik Ogilvie-Wigley
b0d8747697 cargo fix --edition for zcash_primitives 2019-08-20 17:15:07 -06:00
Jack Grigg
1862354ea6 Sapling transaction builder 2019-07-27 00:27:50 +01:00
Jack Grigg
8f7adec0d9 Migrate zcash_primitives to rand_core 0.4 2019-07-19 00:46:37 +02:00
Jack Grigg
6149166ccb Migrate zcash_primitives to rand 0.5 2019-07-19 00:35:06 +02:00
Jack Grigg
504c3eaeae Address Daira's review comments 2019-07-15 16:33:43 +02:00
Jack Grigg
07dbfbef59 Address Eirik's review comments 2019-07-10 13:53:22 -04:00
Jack Grigg
79006ecbdf Unify Sapling tree depth constants
When sapling-crypto is refactored, the zcash_primitives::sapling
constant would become the canonical one.
2019-07-10 13:53:22 -04:00
Jack Grigg
e67560b154 Document merkle_tree module 2019-07-10 13:53:22 -04:00
Jack Grigg
b9cea33804 Move merkle_tree::Node into sapling module
This makes the merkle_tree module properly generic over the tree hash.
It still hard-codes a depth 32 tree, because Rust doesn't yet support
generic sizes, and we are unlikely to need to alter the tree depth in
future circuit changes.
2019-07-10 13:53:22 -04:00
Jack Grigg
263bbe1207 Use Iterator::all() in place of Iterator::fold() 2019-07-10 13:53:22 -04:00
Jack Grigg
98d7621135 Don't assert when parsing a CommitmentTreeWitness 2019-07-10 13:53:22 -04:00
Jack Grigg
9b4186705a Add serialization APIs to CommitmentTree and IncrementalWitness 2019-07-10 13:53:22 -04:00
Jack Grigg
667d6101c9 Sapling incremental witnesses 2019-07-10 13:53:20 -04:00
Jack Grigg
bf74915053 Move CommitmentTreeWitness into zcash_primitives 2019-07-10 13:52:47 -04:00
Jack Grigg
f4059a5faa Sapling commitment tree 2019-07-10 13:44:21 -04:00
Jack Grigg
8f3f95ee08 Sapling commitment tree empty roots 2019-07-10 13:44:21 -04:00