Commit Graph

126 Commits

Author SHA1 Message Date
therealyingtong fc82523e31 unified::ivk::tests: Add unit tests for parsing UIVK. 2021-12-02 14:44:38 -07:00
therealyingtong 7cd12f4ee2 unified::ivk: Parse unified incoming viewing keys. 2021-12-02 14:44:38 -07:00
Kris Nuttycombe 1c32172209
Merge pull request #460 from zcash/unified-encoding-logic
kind::unified: Extract common unified encoding logic.
2021-12-02 12:43:27 -07:00
Kris Nuttycombe 566c973ea7
Fix comment in components/zcash_address/src/kind/unified.rs
Co-authored-by: str4d <jack@electriccoin.co>
2021-12-02 11:35:54 -07:00
Kris Nuttycombe 82be04dfaf Generalize the naming of unified containers and items. 2021-12-02 09:10:03 -07:00
Kris Nuttycombe 75591047f7 Separates raw encoding from jumbling of unified container contents. 2021-12-02 09:04:46 -07:00
therealyingtong a6e6f8ace2 kind::unified: Make address::Address available outside the crate. 2021-11-30 09:05:24 -05:00
therealyingtong da1c6224f8 kind::unified: Split Unified trait into FromReceivers, ToReceivers.
This allows us to move to_bytes() into the private::SealedContainer
trait without introducing a circular dependency. This also lets us
move the Receivers type to a public trait.
2021-11-29 14:21:43 -05:00
therealyingtong c31db1b839 Move HRPs into from public Unified trait to SealedContainer trait.
Co-authored-by: Jack Grigg <jack@electriccoin.co>
2021-11-29 13:49:24 -05:00
therealyingtong b8ff3d2d48 kind::unified: Introduce private::SealedContainer and Unified traits.
Co-authored-by: Jack Grigg <jack@electriccoin.co>
2021-11-28 18:56:24 -05:00
therealyingtong 18393eefa8 kind::unified: Introduce private::SealedReceiver trait.
Co-authored-by: Jack Grigg <jack@electriccoin.co>
2021-11-28 18:55:37 -05:00
therealyingtong 406e62e7e5 [move-only] Move Receiver and test code into kind::unified::address.
Co-authored-by: Jack Grigg <jack@electriccoin.co>
2021-11-28 17:09:59 -05:00
jarys 0ec7f97c97
Add `#![no_std]` support for zcash_note_encryption (#450)
Co-authored-by: str4d <thestr4d@gmail.com>
2021-11-24 13:58:52 +00:00
Jack Grigg 35e7542065 zcash_note_encryption: Move domain batch APIs into a BatchDomain trait
These are the only allocating APIs; this change makes it possible to
make the crate no-std compatible.
2021-11-17 12:14:26 +00:00
jarys 6e39480c58
Add `#![no_std]` support for f4jumble. (#446)
The new `f4jumble_mut` and `f4jumble_inv_mut` functions take a `&mut [u8]`, and return a new `Error` type if the slice has an invalid length.

The original `f4jumble` and `f4jumble_inv` functions are now more efficient as they only allocate once.
2021-11-03 13:46:30 +00:00
str4d edd341faba
f4jumble: Add description to README
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
2021-09-23 04:38:39 +12:00
str4d 501a343fc9
f4jumble: Update authors list
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
2021-09-23 04:22:18 +12:00
Jack Grigg e13e746e8a Move F4Jumble implementation into f4jumble crate 2021-09-22 14:21:48 +01:00
Jack Grigg 06b7f13356 Empty f4jumble crate 2021-09-22 14:13:34 +01:00
str4d 663a394b62
Merge pull request #434 from nuttycom/feature/longer_uas
Update unified addresses to use CompactSize for typecode & length fields.
2021-09-16 05:47:18 +12:00
Kris Nuttycombe 3c42fcff6d Fix upper CompactSize bound.
Co-authored-by: str4d <jack@electriccoin.co>
2021-09-15 10:27:27 -06:00
Kris Nuttycombe 4b67977ec0 Use u32 for typecodes.
Co-authored-by: str4d <jack@electriccoin.co>
2021-09-14 18:08:21 -06:00
Kris Nuttycombe 74d430102a Add test vector checking for long f4jumble values. 2021-09-14 17:11:37 -06:00
Daira Hopwood f9522ed2bc
Add a test that uses the second bytes of the index to G 2021-09-13 14:41:45 +01:00
Jack Grigg 65e1d32774 ff 0.11, group 0.11, etc. 2021-09-09 18:20:37 +01:00
str4d eca002dae0
zcash_address: Assert that the unified encoding is exactly consumed 2021-09-02 23:24:23 +01:00
Kris Nuttycombe ce6ac7aee6 Avoid reallocation in read_receiver. 2021-09-02 16:12:11 -06:00
Kris Nuttycombe cd3d40aab3 Update f4jumble personalization.
Also, update the test vectors for both f4jumble and
unified addresses.
2021-09-01 14:46:44 -06:00
Kris Nuttycombe b7ae3ddfe5 Modify unified address encoding to use CompactSize for typecode & address length 2021-09-01 14:46:44 -06:00
str4d 993925e049
Merge pull request #437 from nuttycom/zcash_note_encryption_doc_fixes
Fix a couple of broken doc links.
2021-09-01 21:43:46 +01:00
Kris Nuttycombe 5541552453 Fix a couple of broken doc links. 2021-09-01 14:01:47 -06: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
str4d 21a0d0760c
zcash_encoding: Adjust doc comments on public APIs 2021-09-01 20:43:59 +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 e9c18ebaed Document zcash_encoding functions. 2021-09-01 10:17:03 -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
Jack Grigg 0d00e1eb53 proptest 1 2021-08-23 20:21:13 +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
Jack Grigg 4b4dd2ea55 zcash_note_encryption: Add support for batch-parsing `ephemeral_key`
This is useful when the underlying curve requires an inversion to parse
an encoded point (such as for Jubjub).
2021-08-10 02:57:11 +01:00
Jack Grigg 8a615c4393 zcash_note_encryption: Add batched trial decryption APIs 2021-08-10 02:17:10 +01:00
Jack Grigg 279a8b6bb6 Use `EphemeralKeyBytes` type in place of `[u8; 32]` 2021-08-09 21:28:42 +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
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
str4d c02931dc82
Tweak test comment 2021-07-30 20:35:23 +01:00
Jack Grigg 00b369b2a4 zcash_address: Include HRP inside Unified Address Padding bytes
Closes zcash/librustzcash#418.
2021-07-30 15:34:36 +01:00
Jack Grigg b875f6c34b zcash_address: Fix clippy lint by using matches! macro 2021-07-12 21:17:25 +01:00
Jack Grigg 8527dcbc32 zcash_address: Remove outdated unified::Receiver documentation
Receiver ordering is now explicitly defined by Typecode, and Receiver
is now a public type.
2021-07-12 21:11:24 +01:00