Commit Graph

192 Commits

Author SHA1 Message Date
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
Kris Nuttycombe abd63166c0 Apply suggestions from code review
Co-authored-by: str4d <jack@electriccoin.co>
2022-03-11 17:17:21 -07:00
Kris Nuttycombe 71657b4f18 Generalize vector and array writes & reads.
In a number of places, we transform other kinds of collections with
known length information into vectors simply to be able to use them with
`Vector::write` or `Vector::read`. We can avoid these extra allocations
by writing from iterators directly, and similarly by reading directly
into our desired collection types.
2022-03-11 16:48:28 -07:00
Kris Nuttycombe 600c06a408 Update MSRV to 1.56.1 2022-02-24 12:26:14 -07:00
Jack Grigg fa75c9587c zcash_address: Avoid an unnecessary allocation while parsing a UA 2022-02-03 00:02:03 +00:00
Jack Grigg 4a30679491 f4jumble: Return `Error` from allocating functions 2022-02-03 00:02:03 +00:00
Kris Nuttycombe a304c3953b Fix Clippy beta linting complaints. 2022-02-02 16:02:45 -07:00
Kris Nuttycombe 3a20176092 Apply suggestions from code review
Co-authored-by: str4d <jack@electriccoin.co>
2022-01-27 15:00:37 -07:00
Squirrel c910ffdb41
Remove unused dependencies (#479)
Remove unused dependencies

Co-authored-by: Kris Nuttycombe <kris.nuttycombe@gmail.com>
Co-authored-by: str4d <thestr4d@gmail.com>
2022-01-18 12:04:14 -07:00
Kris Nuttycombe 8d34e62114 Clean up proptest generation for unified containers. 2022-01-04 15:31:20 -07:00
Kris Nuttycombe 6065c07003 Update test vectors to respect item ordering. 2022-01-04 11:48:23 -07:00
Kris Nuttycombe 2fa73ed368 Remove `Ord` instances for sealed items.
There are two canonical orderings for sealed items: preference
order and encoding order. Removing the `Ord` instances means
that a user can't accidentally choose the wrong ordering;
these orderings are replaced by explicit `preference_order`
and `encoding_order` comparison functions.
2022-01-04 11:48:23 -07:00
Kris Nuttycombe e413f12fb5 Apply suggestions from code review
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
2022-01-04 11:48:23 -07:00
Kris Nuttycombe 4c4c0b1e63 Makes unified container parsing enforce typecode order.
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
2022-01-04 11:48:23 -07:00
Jack Grigg d5a375919d blake2{b,s}_simd 1 2021-12-17 23:44:06 +00:00
Jack Grigg 142a38e792 zcash_note_encryption 0.1.0 2021-12-17 20:00:46 +00:00
Jack Grigg c4cbb2dd74 zcash_note_encryption: License files and readme 2021-12-17 15:16:17 +00:00
Jack Grigg e8a755f633 zcash_note_encryption: Clean up dependencies
Several dependencies were copied over during the extraction of this
crate's logic from `zcash_primitives`, but are in fact only required for
the protocol-specific logic. We can also remove the `std` feature flag,
since we no longer have a dependency on `blake2b_simd` that needs its
`std` flag exposed for performance.
2021-12-17 15:06:22 +00:00
Jack Grigg d511a788c4 zcash_note_encryption: Crate documentation 2021-12-17 15:06:22 +00:00
Jack Grigg edc3557e30 zcash_note_encryption: Document APIs 2021-12-17 14:12:18 +00:00
Jack Grigg 5409291b0c zcash_note_encryption: Add `doc_cfg` annotations 2021-12-17 14:12:18 +00:00
Jack Grigg 76f364593a zcash_note_encryption: Constrain outgoing ciphertext size
This replaces a length assertion, making the API more predictable.
2021-12-17 05:23:53 +00:00
Jack Grigg 4fcd83d74e zcash_note_encryption: Constrain `ShieldedOutput` ciphertext size
Previously we were returning the ciphertext as a slice, and then
asserting its length within the APIs the caller passed it into. Now
instead we require the caller to define whether or not the output is
compact, to make the API more predictable.

This doesn't place any additional constraints on users of this trait,
because the assertions already prevented a full output from being passed
to a compact trial decryption API.
2021-12-17 05:23:53 +00:00
Jack Grigg d54e1f0bf7 zcash_note_encryption: Remove `Domain::check_epk_bytes`
`Domain::derive_esk` provides sufficient information to determine
whether or not we need to enforce `EphemeralSecretKey`-specific
decryption checks, as it returns `None` for pre-ZIP 212 notes.
2021-12-17 04:30:57 +00:00
Jack Grigg 7c1687dcc1 zcash_note_encryption: Use `*PlaintextBytes` structs in `Domain` APIs
`Domain::parse_note_plaintext_without_memo_ivk` is used with both full
note plaintexts and compact notes, so continues to accept a slice. For
all other `Domain` APIs, we constrain the input to `NotePlaintextBytes`
or `OutPlaintextBytes` as appropriate.
2021-12-17 04:30:57 +00:00
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 fd786f28b7 Ensure unrecognized prefixes map to ParseError::NotZcash 2021-12-07 12:59:41 -07:00
Kris Nuttycombe 4e906508ae Make unified container construction correctly sort items.
Newly constructed unified containers now obey ZIP 316 item
ordering rules, while parsing and reserialization preserve
order.
2021-12-07 11:07:15 -07:00
Kris Nuttycombe e7c57e4a02 Use `from` instead of a possibly-future-incompatible cast 2021-12-07 09:25:50 -07:00
Kris Nuttycombe cc8c2868eb Ensure that unknown typecodes don't duplicate known typecodes. 2021-12-07 09:16:55 -07:00
Kris Nuttycombe cccc493067 Add unknown typecodes to UA proptests. 2021-12-06 11:34:12 -07:00
Kris Nuttycombe e30f4bd094 Fix incorrect ordering of receivers in writing raw encoding. 2021-12-06 08:32:07 -07:00