Commit Graph

223 Commits

Author SHA1 Message Date
Kris Nuttycombe 374882b7bc Move `zcash_note_encryption` component to https://github.com/zcash/zcash_note_encryption
The `zcash_note_encryption` component crate has been factored out to
its own repository, to avoid circular crate dependencies involving
https://github.com/zcash/librustzcash and the
https://github.com/zcash/orchard and
https://github.com/zcash/sapling-crypto repositories.
2023-11-17 20:39:14 -07:00
Jack Grigg c8e2d81f58 Render byte slices as hex more often in `Debug` impls
This is more generally useful for debugging purposes than the default
`Debug` impl for `&[u8]`.

We also provide an alternate `Debug` impl for `legacy::Script` that
parses and renders known opcodes. Note that we only parse a subset of
the full opcode set.
2023-08-30 20:41:27 +00:00
Kris Nuttycombe 60ac1070c5 Release zcash_address version 0.3.0 2023-06-06 15:53:16 -06:00
Kris Nuttycombe 75e529eea6 Upgrade to `bs58 0.5` 2023-06-06 15:53:14 -06:00
Kris Nuttycombe 80adb54e26 Release zcash_note_encryption version 0.4.0 2023-06-06 10:12:33 -06:00
Kris Nuttycombe fe3d0269d1 Add comments detailing the checks required prior to calling `check_note_validity` 2023-05-26 10:12:21 -06:00
Kris Nuttycombe 696a9be0a0 Update `zcash_primitives` to reflect argument changes to `parse_note_plaintext_without_memo_ovk` 2023-05-26 09:43:26 -06:00
Kris Nuttycombe be89e81534 Remove `esk` and `ephemeral_key` arguments from `parse_note_plaintext_without_memo_ovk`
Fixes #850
2023-05-26 09:24:22 -06:00
Jack Grigg a115a8f00f zcash_note_encryption: Remove `esk` check requirement from `Domain::parse_note_plaintext_without_memo_ovk`
This method is only called from `try_output_recovery_with_ock`, and we
can instead rely on the check performed in `check_note_validity`,
reducing the number of checks that `Domain` implementations need to
perform.

The `esk` and `ephemeral_key` parameters become unused, and will be
removed in a subsequent commit (as this change needs to be synchronized
with the `orchard` crate).
2023-05-19 16:30:47 +00:00
Jack Grigg 5f7ccb6d84 zcash_address 0.2.1 2023-04-15 00:51:29 +00:00
Jack Grigg f82866dbb9 Migrate to `bech32 0.9` 2023-04-11 16:01:19 +00:00
Kris Nuttycombe 1a27a7f9ce Update zcash_note_encryption changelog for 0.3.0 release. 2023-03-22 09:54:18 -06:00
Kris Nuttycombe d6fafa291b Update Sapling note encryption for `zcash_note_encryption 0.3.0`
Fixes zcash/librustzcash#455
2023-03-21 11:09:38 -06:00
Kris Nuttycombe c696069f93 Bump zcash_note_encryption to version 0.3.0 for release.
This removes the path-based dependencies on the `zcash_note_encryption`
crate in favor of using versioned dependencies locally. This better
reflects the future state in which `zcash_note_encryption` is factored
out of the workspace and maintained in a separate repository.
2023-03-20 16:16:34 -06:00
Kris Nuttycombe c88f3e1b9d Remove the `recipient` parameter from zcash_note_encyption::Domain::note_plaintext_bytes
The `Domain::Note` type is now expected to contain information about the
recipient of the note, eliminating the need to pass this information in
via the encryption context.
2023-03-20 16:16:00 -06:00
Sean Bowe bd7f9d7c3c
Bump zcash_encoding and zcash_address crate versions to 0.2. 2022-10-19 16:51:59 -06:00
Kris Nuttycombe 42fd3c1091 Fix changelogs for `zcash_encoding` and `zcash_history` 2022-10-19 15:52:42 -06:00
Jack Grigg 8f068b3b71 zcash_note_encryption 0.2.0 2022-10-13 21:35:39 +00:00
Jack Grigg 9a010d42ff zcash_note_encryption: Clean up changelog and readme
We no longer depend on the previously-mentioned dependencies.
2022-10-13 21:23:09 +00:00
Jack Grigg 8842de18cc Remove unused dependencies
These were mostly detected with `cargo-udeps`, for which I've also added
exclusions for the dependencies it can't detect are used in doc-tests.
2022-10-13 20:06:52 +00:00
Kris Nuttycombe 34a7abd653 Update unified address test vectors
This updates unified address test vectors after
https://github.com/zcash-hackworks/zcash-test-vectors/pull/89
to check addresses across multiple diversifier indices, and also
removes the superfluous binary encoding of UA strings.
2022-10-07 19:50:32 -06:00
Kris Nuttycombe 03c3370de8 Fix problems identified by clippy's beta lints 2022-09-17 08:57:37 -06:00
Kris Nuttycombe 29220c716f Remove `zcash_primitives` as a zcash_note_encryption dev dependency.
This was only used to provide example code for Sapling usage of
the `NoteEncryption` struct; this example code has been moved
to `sapling::note_encryption`.
2022-09-16 12:52:00 -06:00
Kris Nuttycombe 72b5e6dfc3 Upgrade chacha20poly1305 dependency to version 0.10
Also upgrade  the `chacha20`, `cipher`, and `subtle` dependency
versions.
2022-09-16 12:52:00 -06:00
Daira Hopwood 515b0a40ec zcash_note_encryption: Add API to prepare epk.
Co-authored-by: Jack Grigg <jack@electriccoin.co>
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2022-09-15 03:22:41 +01:00
Kris Nuttycombe 8439f1a4f7 Add binary encoding for unified spending keys.
This encoding is wallet-internal-only and is currently
guarded under the `unstable` feature flag.
2022-09-08 11:05:59 -06:00
Kris Nuttycombe a93f5945ab Remove redundant TryFrom/TryInto imports. 2022-09-02 12:05:15 -06:00
Kris Nuttycombe 16a0e43f2d Update to Rust 2021 and explicitly set MSRVs 2022-09-02 12:05:09 -06:00
Kris Nuttycombe 199c49760b Use the new name rustdoc::broken_intra_doc_links 2022-07-29 15:56:44 -06:00
Kris Nuttycombe 73314dc682 Use batch decryption in wallet scanning.
This modifies wallet scanning to perform per-block batched
decryption. It also alters the structure of the `ScanningKey`
trait to correctly include internal (change) keys in the scan
process.
2022-07-28 17:28:31 -06:00
Kris Nuttycombe 5873950648 Restructure batch decryption to avoid cartesian product of results.
While it is necessary in the worst case to perform `m * n` decryptions,
where `m` is the number of outputs being decrypted and `n` is the number
of IVKs, it is possible to stop performing trial decryptions when the
first successful decryption is performed. Also, it's inconvenient and
unnecessary to return the full cartesian product of these results, as
only one IVK will decrypt a given output. This commit modifies batch
trial decryption to stop on the first successful decryption, and instead
of returning the cartesian product of results we return the index of the
input IVK along with the output it decrypted. Note that this means that
trial decryption is not constant-time with respect to the number and/or
order of IVKs.
2022-07-28 15:23:21 -06:00
Daira Hopwood a9aa2929d2 Address feedback about the use of "permissive".
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2022-06-28 16:46:13 +01:00
Daira Hopwood 75ca854005 Projects that rely on BOSL exceptions should say that they do.
fixes #576

Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2022-06-28 12:29:16 +01:00
Jack Grigg e952ff637e zcash_primitives 0.7.0 2022-06-24 17:00:39 +00:00
Jack Grigg a3cae5d36a equihash 0.2.0 2022-06-24 17:00:26 +00:00
str4d 3f5ba8de48
Merge pull request #569 from zcash/f4jumble-readme-link-fix
Fix a broken link to ZIP 316 in F4Jumble crate README.
2022-06-14 00:45:57 +01:00
Nathan Wilcox e2b688ea61
Fix a broken link to ZIP 316. 2022-06-13 09:50:01 -07:00
Jack Grigg b8e8a0c491 zcash_address: Add `ZcashAddress::convert_if_network`
This, along with the corresponding `TryFromRawAddress` trait, enables
converting `ZcashAddress` into a network-agnostic type.

Closes zcash/librustzcash#564.
2022-06-10 15:19:42 +00:00
Jack Grigg 16938d1c4f zcash_address: Replace `FromAddress` with `TryFromAddress`
This enables the user-defined conversions to be fallible, which they
will almost always want to be (as address data needs to be validated
before it can be used).
2022-06-07 18:09:42 +00:00
Jack Grigg 3ecfd26d79 zcash_primitives 0.6.0 2022-05-10 23:33:05 +00:00
Jack Grigg 54e9eb8708 zcash_address 0.1.0 2022-05-10 23:33:05 +00:00
Jack Grigg 6976d3fe85 zcash_encoding 0.1.0 2022-05-10 23:33:05 +00:00
Jack Grigg a27a5428f0 f4jumble 0.1.0 2022-05-10 23:33:05 +00:00
Jack Grigg 144512b547 Migrate to `ff 0.12` 2022-05-06 20:03:49 +00:00
Kris Nuttycombe 073d939859 Add `Vector::read_collected_mut` and `Array::read_collected_mut`
These variants allow parsing to be informed by additional
mutable external state.
2022-05-04 09:25:07 -06:00
Jack Grigg 32d6b57d71 f4jumble: Document APIs that require feature flags 2022-04-25 16:53:27 +00:00
Jack Grigg b02d64a6ef f4jumble: Add method documentation 2022-04-25 16:52:56 +00:00
Jack Grigg 0756ea2f3e f4jumble: Add crate-level documentation 2022-04-25 16:52:28 +00:00
Kris Nuttycombe 981fc62b08 Add `ZcashAddress::encode` method.
This provides the encoding corresponding to
`ZcashAddress::try_from_encoded` and documents the fact that the
`Display` instance can also provide this encoding.

Fixes #463
2022-04-11 10:36:27 -06:00
Kris Nuttycombe 990b0afe5d Update unified address test vectors 2022-03-29 14:56:00 -06:00