Jack Grigg
01c768dbeb
zcash_note_encryption: Place pre-ZIP 212 APIs behind a feature flag
2021-12-17 04:30:57 +00:00
Kris Nuttycombe
c72ddb1251
Improve documentation of DiversifierKey#diversifier_index
...
Co-authored-by: str4d <jack@electriccoin.co>
2021-12-13 13:37:11 -07:00
Kris Nuttycombe
8e934682bb
Add decryption of Sapling diversifiers.
...
Given a diversifier key, decrypts a diversifier to obtain
the diversifier index from which the diversifier was originally
produced.
Co-authored-by: str4d <jack@electriccoin.co>
2021-12-13 13:08:58 -07:00
Kris Nuttycombe
06bea7f936
Factors out sapling address generation from SaplingExtendedFullViewingKey.
...
Sapling address generation depends only on an FVK and
a diversifier key. For the purpose of unified full viewing
keys, we need to break the dependence upon Sapling extended
full viewing keys, so this makes the address generation
methods of SaplingExtendedFullViewingKey usable without
coupling them to the ability to derive child full viewing keys.
2021-11-30 20:00:36 -07:00
Jack Grigg
5055033c31
zcash_primitives: Migrate to `zcash_note_encryption::BatchDomain`
2021-11-17 12:17:10 +00:00
Kris Nuttycombe
48340a4846
Fix doc comment for default address generation.
2021-10-15 13:19:25 -06:00
Kris Nuttycombe
86d4affe73
Add tests for `ExtendedFullViewingKey::address`
2021-10-11 16:34:37 -06:00
Kris Nuttycombe
70e65081c5
Add a test for DiversifierKey::diversifier
2021-10-11 16:34:37 -06:00
Kris Nuttycombe
120cc70a6d
Fix type of default_address
2021-10-11 16:34:37 -06:00
Daira Hopwood
bec497f6bf
Apply suggestions from code review
...
Co-authored-by: ying tong <yingtong@z.cash>
2021-10-11 16:34:37 -06:00
Kris Nuttycombe
1373221439
Renames the `ExtendedFullViewingKey::address` method to `find_address`.
...
This also adds a new semantically different `address` method which
attempts to produce an address given the specified diversifier index,
and returns `None` if that index does not produce a valid diversifier.
It is then up to the caller to search the diversifier index space if
the diversifier index that they are attempting to use does not result in
a valid diversifier.
2021-10-11 16:34:37 -06:00
Kris Nuttycombe
28112de234
Make it possible for callers to search for valid Sapling diversifiers.
2021-10-11 16:34:37 -06:00
Jack Grigg
b29803ae34
Update ZIP 244 test vectors with new consensus branch ID
2021-09-28 22:31:11 +01:00
Jack Grigg
a90af6cb2d
Update NU5 consensus branch ID and set testnet activation height
2021-09-28 22:12:31 +01:00
Jack Grigg
8f9ea0d116
pasta_curves 0.2.1
...
This is the first version that was relicensed as MIT OR Apache-2.0.
2021-09-22 22:16:59 +01:00
Jack Grigg
afd4a4803c
bip0039 0.9
2021-09-22 22:14:03 +01:00
Jack Grigg
4770675542
Bump Orchard patch to include Merkle path cleanups
2021-09-16 22:55:22 +01:00
Jack Grigg
eae4ac4110
`impl memuse::DynamicUsage for Amount`
...
Required to use `DynamicUsage` with `orchard::Bundle<_, Amount>`.
2021-09-14 20:48:58 +01:00
Jack Grigg
65e1d32774
ff 0.11, group 0.11, etc.
2021-09-09 18:20:37 +01:00
Kris Nuttycombe
427e6acbd4
Allow CompactSize deserialization to target any type that can be TryFrom<u64>
2021-09-01 13:57:51 -06:00
str4d
edcde252de
Merge pull request #428 from nuttycom/public_compact_size
...
Move the CompactSize, Vector, Array and Option encodings to a new zcash_encoding crate.
2021-09-01 20:45:28 +01:00
Kris Nuttycombe
c1bad64fbd
Apply suggestions from code review
...
Co-authored-by: str4d <jack@electriccoin.co>
2021-09-01 11:08:52 -06:00
Kris Nuttycombe
fa092da456
Fix stray clippy complaints.
2021-08-31 13:19:24 -06:00
Kris Nuttycombe
ef98c7e48c
Add zcash_encoding crate.
...
The CompactSize type, and the standardized encodings for the Vector,
Array and Option types are moved to the newly created crate.
2021-08-31 13:19:24 -06:00
Jack Grigg
f03f05f251
zcash_note_encryption: Switch to chacha20poly1305 crate
2021-08-30 15:03:39 +01:00
Kris Nuttycombe
ac139c6e9b
Make CompactSize serialization functions public.
2021-08-25 09:55:08 -06:00
Jack Grigg
f185f8dc83
pprof 0.5
2021-08-23 20:18:45 +01:00
Jack Grigg
5054621a6d
fpe 0.5
2021-08-23 20:16:40 +01:00
str4d
9be36f3e54
Merge pull request #417 from nuttycom/incremental_merkle_tree_ser
...
Add manual serialization for bridgetree::Frontier
2021-08-17 14:57:59 +01:00
Kris Nuttycombe
77bb78d960
Apply suggestions from code review.
2021-08-17 07:31:15 -06:00
Kris Nuttycombe
1ed538b655
Fix clippy complaints.
2021-08-16 17:36:07 -06:00
Kris Nuttycombe
7b953283ce
Add blanket implementation of Hashable for incrementalmerkletree::Hashable + HashSer
2021-08-16 13:48:37 -06:00
Kris Nuttycombe
837ad19262
Apply suggestions from code review
...
Co-authored-by: str4d <jack@electriccoin.co>
2021-08-16 10:20:14 -06:00
Kris Nuttycombe
5ba7bbc53b
Serialize `Option` values by value, not by reference.
...
Co-authored-by: str4d <jack@electriccoin.co>
2021-08-16 10:06:38 -06:00
Kris Nuttycombe
98dc330cdb
Merge pull request #424 from daira/zip339-primitives
...
ZIP 339 support
2021-08-12 07:23:15 -06:00
Jack Grigg
d8410063ab
zcash_primitives: Implement `Domain::batch_epk` for `jubjub`
2021-08-11 00:21:00 +01:00
Jack Grigg
45521c7849
zcash_primitives: Test that batched trial decryption matches unbatched
2021-08-11 00:18:39 +01:00
Jack Grigg
d0026b460b
zcash_primitives: Implement batched trial decryption optimisation
2021-08-10 02:17:10 +01:00
Jack Grigg
0facec094f
Update changelogs with `EphemeralKeyBytes` changes
2021-08-09 21:45:16 +01:00
Jack Grigg
279a8b6bb6
Use `EphemeralKeyBytes` type in place of `[u8; 32]`
2021-08-09 21:28:42 +01:00
Daira Hopwood
d1443e5049
ZIP 339 support.
...
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2021-08-07 01:07:54 +01:00
Jack Grigg
83c6a2d1ca
Store OutputDescription `ephemeral_key` as bytes
...
This removes an unnecessary `to_bytes` during trial decryption of notes,
and more closely matches the protocol spec. We retain the consensus rule
canonicity check on epk due to `SaplingVerificationContext::check_output`
taking a `jubjub::ExtendedPoint`, forcing `zcashd` to parse the bytes.
2021-08-06 16:54:48 +01:00
str4d
945a199ddd
zcash_primitives: Use `not(unix)` instead of `windows` for flamegraphs
...
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
2021-08-05 23:22:12 +01:00
Jack Grigg
16d38ea354
zcash_primitives: Remove spaces from benchmark group names
2021-08-05 22:40:46 +01:00
Jack Grigg
0f15743200
Disable default benchmark harness for all workspace crates
...
This is necessary in order to provide criterion-specific arguments to
`cargo bench`, such as `--profile-time`.
2021-08-05 22:39:36 +01:00
Jack Grigg
3ffa3ae435
zcash_primitives: Add flamegraph support to benchmarks on Unix
...
Use `cargo bench -- --profile-time TIME_IN_SECONDS` to measure the
flamegraphs. They will be placed in `target/criterion/`.
2021-08-05 22:24:16 +01:00
Jack Grigg
8b05727361
zcash_primitives: Benchmark trial decryption of compact outputs
...
These are effectively identical to full-output trial decryption (as the
primary cost is the scalar multiplication), but it's good to check.
2021-08-05 22:13:23 +01:00
Kris Nuttycombe
2945905d52
Implement manual serialization for incremental Merkle tree components.
...
This also adds parsing of the legacy CommitmentTree format,
to permit easy migration of persisted data.
2021-08-05 09:32:44 -06:00
Kris Nuttycombe
232feb71be
Use orchard::Flags::to_byte/from_byte
2021-07-29 10:38:43 -06:00
Kris Nuttycombe
3b8f0214eb
Move Orchard bundle commitments to the `orchard` crate.
2021-07-29 10:38:43 -06:00