Commit Graph

1777 Commits

Author SHA1 Message Date
str4d 1590565f04
zcash_address: Minor cleanups
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
2021-06-06 23:58:52 +01:00
str4d f36034cfac
zcash_address: Use exhaustive matching in Display impl
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
2021-06-06 23:54:11 +01:00
Jack Grigg ff94f66d8e zcash_address: Fix padding and F4Jumble positions in Address::to_bytes
These need to be applied to the entire UA encoding, not to the encoding
of each individual receiver.
2021-05-25 21:24:47 +01:00
Jack Grigg ff8695de03 zcash_address: Add failing test showing unified::Address encoding bug 2021-05-25 21:24:47 +01:00
str4d c2b57048bf
Update components/zcash_address/README.md
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
2021-05-25 16:37:25 +01:00
Jack Grigg e982d7211f zcash_address: Implement Unified Address encoding / decoding 2021-05-20 22:50:59 +01:00
Jack Grigg 6717cd821c Move F4Jumble implementation into zcash_address 2021-05-20 22:50:59 +01:00
Jack Grigg ae2b8bfd6d zcash_address: Replace Orchard address encodings with Unified Addresses
This commit removes the now-undefined Orchard encoding logic, and adds
the general Bech32m encoding/decoding logic for Unified Addresses. The
internal data format of Unified Addresses is not correct in this commit.
2021-05-20 22:50:59 +01:00
Jack Grigg 9f7398cd05 zcash_address: Add convert::ToAddress helper trait 2021-05-20 14:54:27 +01:00
Jack Grigg ce8797e4b1 zcash_address: impl {Clone, Copy, Eq, Hash} for ZcashAddress 2021-05-20 14:54:27 +01:00
Jack Grigg ff07eeaabb zcash_address: Document ZcashAddress::convert 2021-05-20 14:54:27 +01:00
Jack Grigg b9f704955a zcash_address: Move ZcashAddress::convert into root
Using two separate `impl ZcashAddress` blocks resulted in separate
blocks in the documentation, which is unnecessary.
2021-05-20 14:54:27 +01:00
Jack Grigg c7fcee27a2 zcash_address: Add ZcashAddress::try_from_encoded method
This places parsing documentation front and centre, while also making
it clear that `str::parse` is the anticipated main entry point.
2021-05-20 14:54:27 +01:00
Jack Grigg f7b1058171 zcash_address: Extend MaybeZcash heuristics to 64-byte addresses 2021-05-20 14:54:27 +01:00
Jack Grigg a366460157 zcash_address: ZcashAddress::convert() -> T: FromAddress
This enables easy conversion of an encoded Zcash address to a target
type, with automatic handling of Zcash address types that are not
supported by the target.
2021-05-20 14:54:27 +01:00
Jack Grigg ec77175d2b zcash_address: Add address-encoding support
This provides round-trip encoding for Zcash addresses.
2021-05-20 14:54:27 +01:00
Jack Grigg c754363c07 zcash_address: Initial empty library crate 2021-05-20 14:54:25 +01:00
str4d 6fab0c82a7
Merge pull request #383 from nuttycom/feature/f4jumble
Implement F4Jumble
2021-05-20 14:53:13 +01:00
str4d 35dadc7f6c
f4jumble: Test both directions against test vectors 2021-05-20 14:16:39 +01:00
Kris Nuttycombe 1dcba34167 Add checks against f4jumble test vectors. 2021-05-19 08:50:50 -06:00
Kris Nuttycombe 774d166fff Use VALID_LENGTH constant for f4jumble proptest generation. 2021-05-19 08:29:10 -06:00
Kris Nuttycombe 4346ca9e50 Apply suggestions from code review
Co-authored-by: str4d <jack@electriccoin.co>
2021-05-19 08:29:10 -06:00
Kris Nuttycombe 69ce777dd1 Use macros for personalization & iterator for g function.
Co-authored-by: str4d <jack@electriccoin.co>
2021-05-19 08:29:01 -06:00
Kris Nuttycombe 08a3fb9639 Implement F4Jumble 2021-05-19 08:28:58 -06:00
str4d 05bd98b796
Merge pull request #380 from narodnik/jubjub_fr_random
Replace redundant code with call to Field::random() which does the same as the code.
2021-05-04 04:33:37 +01:00
Daira Hopwood da431a0eb2
rustfmt fix 2021-05-03 14:08:06 +01:00
narodnik 618a6165c7 Replace redundant code with call to Field::random() which does the same as the code. 2021-05-03 13:34:13 +02:00
str4d 3b02c8b26e
Merge pull request #358 from nuttycom/refactor/component_modules_2
Generalize Sapling note encryption to allow reuse with Orchard notes.
2021-04-16 04:17:57 +01:00
Jack Grigg 28a45028ab cargo fmt 2021-04-16 14:03:55 +12:00
Daira Hopwood dc0f6e7115
Update comment about which case is covered by example code 2021-04-16 00:10:05 +01:00
Kris Nuttycombe 3434cc8b6a Add a note about canonicity of ephemeral public keys. 2021-04-15 15:32:45 -06:00
Kris Nuttycombe b2b3efd4c2 Fix naming cmstar -> cmstar_bytes and cm -> cmstar 2021-04-15 15:24:45 -06:00
Kris Nuttycombe 00d04de547 Make cmstar check follow the spec more closely. 2021-04-14 15:38:58 -06:00
Kris Nuttycombe 12cb8265d8 Fix formatting. 2021-04-12 18:47:45 -06:00
Kris Nuttycombe 389e6ca6a3
Minor comment on epk canonicity. 2021-04-12 18:43:21 -06:00
Kris Nuttycombe fae1a1517a Simplify try_sapling_output_recovery. 2021-04-12 18:40:17 -06:00
Kris Nuttycombe f34e87884a Update documentation for note encryption traits. 2021-04-12 17:41:06 -06:00
Kris Nuttycombe 6fc1d1d1c0 Use ephemeral_key bytes instead of the epk abstract point where specified. 2021-04-12 16:19:50 -06:00
Kris Nuttycombe 324fc36521 Use ShieldedOutput trait for note encryption/decryption.
This change modifies note encryption and decryption functions
to treat a shielded output as a single value instead of handling
the parts of an output as independent arguments.
2021-04-12 12:59:06 -06:00
Kris Nuttycombe 4f22f1d578
Apply suggestions from code review
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
2021-04-12 09:18:51 -06:00
Kris Nuttycombe e654cc4ce6 Use constant-time equality for EphemeralKeyBytes.
Fixes #370
2021-04-12 09:13:04 -06:00
Kris Nuttycombe cfdbafe2e3 Add myself to crate contributors. 2021-04-08 10:13:04 -06:00
Kris Nuttycombe 24e62d3a7b
Update comments describing COMPACT_NOTE_SIZE components.
Co-authored-by: ebfull <ewillbefull@gmail.com>
2021-04-08 10:08:58 -06:00
Kris Nuttycombe a560101bb2 Remove spurious mut references. 2021-04-08 10:08:00 -06:00
Kris Nuttycombe 879eea863a Apply suggestions from code review
Co-authored-by: str4d <jack@electriccoin.co>
2021-04-08 08:20:23 -06:00
Kris Nuttycombe dad8663c55 Fix zcash_note_encryption doctests. 2021-04-08 08:20:23 -06:00
Kris Nuttycombe 213cd6cce9 Fix Clippy complaints. 2021-04-08 08:20:23 -06:00
Kris Nuttycombe be225daabf Update zcash_primitives dev dependency for zcash_note_encryption 2021-04-08 08:20:23 -06:00
Kris Nuttycombe 5b13bb3a1e Add try_output_recovery_with_ovk to shared note encryption code. 2021-04-08 08:20:23 -06:00
Kris Nuttycombe 266285b536 Move generalized note encryption functionality to zcash_note_encryption crate. 2021-04-08 08:20:21 -06:00