Commit Graph

39 Commits

Author SHA1 Message Date
Kris Nuttycombe d8091dd575 Update incrementalmerkletree version. 2021-08-05 07:51:19 -06:00
therealyingtong 8cf7a6872c Minor refactors, text fixes, and docfixes.
Co-authored-by: Jack Grigg <jack@electriccoin.co>
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
2021-07-23 00:15:54 +08:00
therealyingtong 6f4b5b0340 circuit.rs: Constrain derived circuit values to equal public inputs. 2021-07-21 20:35:43 +08:00
therealyingtong 07770a0be0 builder.rs: Update ActionInfo::build() to fill in Circuit fields. 2021-07-21 20:35:43 +08:00
Kris Nuttycombe 64c5b25d1c Rename OrchardIncrementalTreeDigest to MerkleCrhOrchardOutput 2021-07-01 12:09:24 -06:00
Kris Nuttycombe fd94759fab Implements the updated, total definition of MerkleCRH^Orchard
See https://github.com/zcash/zips/pull/530
2021-07-01 12:09:24 -06:00
Jack Grigg 9bf066ef8b rustfmt 2021-06-28 18:48:58 +01:00
str4d 93ab753b8c
Apply string fixes from code review
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
2021-06-28 18:47:02 +01:00
Kris Nuttycombe ffafb6308c Fix clippy complaints. 2021-06-28 10:56:25 -06:00
Kris Nuttycombe 0d078c8a90 Rustfmt 2021-06-28 10:01:13 -06:00
Kris Nuttycombe e37cec1e53 Apply suggestions from code review
Co-authored-by: str4d <jack@electriccoin.co>
2021-06-24 12:39:28 -06:00
Kris Nuttycombe fc41db1ab5 Add UNCOMMITTED_ORCHARD constant. 2021-06-24 12:33:02 -06:00
Kris Nuttycombe 90d0c254cf Account for non-canonical base in serde deserialization. 2021-06-24 09:57:35 -06:00
Kris Nuttycombe 78adc9c810 Anchor computation is partial. 2021-06-24 09:43:10 -06:00
Kris Nuttycombe 52394b8e8d Add test for incremental Merkle tree root calculation.
Fix indexing in perfect subtree computation test for auth paths.
2021-06-23 15:57:33 -06:00
Kris Nuttycombe c876f74ab1 Fix level/layer confusion. 2021-06-23 15:57:33 -06:00
Kris Nuttycombe 4888f0d16c Rename Level -> Altitude 2021-06-23 15:57:33 -06:00
Kris Nuttycombe e3abbf9a42 Add serde support for OrchardIncrementalTreeDigest 2021-06-23 15:57:33 -06:00
Kris Nuttycombe 7e79fd4b1c Add necessary trait impls for OrchardIncrementalTreeDigest
Required to make the wrapper type usable for digests in
a serializable incremental merkle tree.
2021-06-23 15:57:33 -06:00
Kris Nuttycombe ce4697aca5 Add construction of OrchardIncrementalTreeDigest 2021-06-22 18:14:27 -06:00
Kris Nuttycombe 4bb252eb0c Add Orchard incremental merkle tree digests. 2021-06-22 18:14:27 -06:00
Jack Grigg 5264d53498 impl Copy for Anchor 2021-06-15 15:42:06 +01:00
Jack Grigg 019ae7da8e Anchor::{from_bytes, to_bytes} 2021-06-15 15:41:57 +01:00
Jack Grigg de78186503 Store anchors as pallas::Base instead of [u8; 32]
This matches what we store in `MerklePath`, and better enforces the
required type.
2021-06-12 21:35:37 +01:00
str4d bd30783a52 Make `hash_layer` comment a doc comment
This way, it renders with `cargo doc --document-private-items`
2021-06-11 20:46:30 +01:00
str4d d8f2af8983 Simplify `gen_const_array` implementation
Also includes a performance improvement to `i2lebsp_k`.
2021-06-11 20:46:30 +01:00
therealyingtong 0e9726ae69 tree.rs: Use 2 as uncommitted leaf and check against test vectors. 2021-06-11 20:24:55 +08:00
therealyingtong 380128ed49 tree::MerklePath: Add postion() and auth_path() getters. 2021-06-10 16:55:49 +08:00
therealyingtong b3daeb0861 tree::testing: Fix and test arb_tree(). 2021-06-10 13:54:42 +08:00
therealyingtong 2d0afe9357 constants.rs: Introduce L_ORCHARD_MERKLE constant
Also test that L_ORCHARD_BASE, L_ORCHARD_SCALAR, L_ORCHARD_MERKLE
are consistent with the Pallas curve.

Co-authored-by: Jack Grigg <jack@electriccoin.co>
2021-06-10 10:33:06 +08:00
therealyingtong e8e22886f4 tree.rs: MerklePath.root(): Fix missing bitmask in swap calculation
Co-authored-by: Jack Grigg <jack@electriccoin.co>
2021-06-10 10:29:08 +08:00
therealyingtong 18535894d6 constants::util.rs: Factor out gen_fixed_array() method. 2021-06-10 10:03:15 +08:00
therealyingtong 8f8eff23d8 Update proptests to generate Merkle paths 2021-06-08 22:38:11 +08:00
therealyingtong b33248bdb0 src::tree.rs: Implement MerklePath.root() method.
Co-authored-by: Kris Nuttycombe <kris@electriccoin.co>
2021-06-08 22:31:24 +08:00
Kris Nuttycombe f91088d35b Use builder to generate "valid" bundles via proptest. 2021-04-28 18:21:12 -06:00
Kris Nuttycombe e743198a50 Expose constructors required for ZIP-225 parsing. 2021-04-28 18:02:36 -06:00
Jack Grigg d383ff5054 Fix clippy lints 2021-04-29 10:57:53 +12:00
Jack Grigg 30f01d122c Bundle builder 2021-04-27 14:31:21 +12:00
Jack Grigg 1b9f6450cb Add skeleton for actions and bundles 2021-01-20 20:31:09 +00:00