Commit Graph

78 Commits

Author SHA1 Message Date
Kris Nuttycombe 082c8de59c Add kdf_personalized to OrchardDomain 2023-06-16 17:30:32 -06:00
Jack Grigg 3beea4adb7 Migrate to `ff 0.13`
Closes zcash/orchard#371.
2023-03-09 21:14:41 +00:00
Kris Nuttycombe 7080c37532 Prepare keys only once in decrypt_outputs_with_keys 2022-10-18 12:47:18 -06:00
Jack Grigg 0b4d7bc9c6 Migrate note encryption to use prepared w-NAF APIs 2022-10-15 23:27:57 +00:00
Jack Grigg 35a76f03b8 Add `orchard::bundle::BatchValidator`
Adapted from the `BatchValidator` in `zcashd`, that only handles
RedPallas signatures.
2022-06-23 19:45:25 +00:00
Jack Grigg 70b6eb3623 Simplify witness synthesis for `v_net`
`NoteValue - NoteValue` is always guaranteed to produce a valid
`ValueSum`, so we make that infallible and introduce a new helper method
`ValueSum::magnitude_sign` that we use for circuit synthesis.
2022-04-29 20:03:17 +00:00
Jack Grigg 200c366ea4 Rename `Bundle::{try_}authorize` to `Bundle::{try_}map_authorization`
Closes zcash/orchard#71.
2022-04-29 00:16:16 +00:00
Jack Grigg 5c5c999439 Move `orchard::bundle::Action` to its own module
The `Bundle` struct is variable in size and requires allocations, but
`Action` is not. This split will make it cleaner to disable the bundle
logic for no-std support.
2022-04-28 22:59:07 +00:00
Jack Grigg 30f9452743 Replace unnecessary usage of `std::io` 2022-04-28 20:45:05 +00:00
Jack Grigg b1ce38405a Use `core` instead of `std` where possible 2022-04-28 20:20:23 +00:00
Jack Grigg 4574d4793a Migrate to 2021 edition 2022-04-28 17:23:30 +00:00
Jack Grigg 01d70ec875 Hide `NonEmpty` in `Debug` impl of `Bundle`
It is an implementation detail that isn't useful to include in the debug
output.
2022-04-06 17:22:18 +00:00
Jack Grigg 6c9ff19342 Merge branch 'main' into non-consensus-changes-on-branchid-c4cd541e 2022-03-22 17:55:59 +00:00
Kris Nuttycombe 40efd57757
Apply suggestions from code review
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
2022-03-15 07:47:21 -06:00
Kris Nuttycombe 45a6a30b21 Add convenience methods on `Bundle` to decrypt actions with OVKs.
This renames `decrypt_outputs_for_keys` to `decrypt_outputs_with_keys`
for consistency with `decrypt_output_with_key` and tne newly added
`recover_output*_with_ovk*` methods.
2022-03-14 19:28:47 -06:00
Jack Grigg eb7a9668aa Merge branch 'non-consensus-changes-on-branchid-c4cd541e' into merge-non-consensus-changes-2 2022-02-28 20:46:55 +00:00
Jack Grigg def4d4d9ae Add missing `Debug` trait bounds for `Builder` components
All relevant types have `Debug` impls, but some of the trait and method
impls were lacking `Debug` bounds on their generic types. This prevented
`Debug` impls being used on the overall partially-constructed `Bundle`
types.
2022-02-28 20:09:30 +00:00
Jack Grigg 17ad25ee35 Merge branch 'non-consensus-changes-on-branchid-c4cd541e' into merge-non-consensus-changes 2022-02-15 22:46:47 +00:00
Jack Grigg 0b6bd07904 Add functional test for creating and verifying a shielding bundle
The text exposed some limitations of the current crate API, which have
been fixed.
2022-02-15 22:17:15 +00:00
therealyingtong f74cb9e4d3 Delete gadgets and their primitives; add `halo2_gadgets` dependency. 2022-01-29 01:57:01 +08:00
Jack Grigg 369b99ee3f Add `doc_cfg` annotations 2021-12-17 22:08:58 +00:00
Jack Grigg 414eef3ce5 memuse 0.2 2021-09-14 20:40:15 +01:00
Jack Grigg 7fad21e7d6 Switch to `memuse` crate for measuring heap allocations 2021-09-05 01:33:27 +01:00
Kris Nuttycombe 43abadfb55 Adds decryption for a specific index within a bundle. 2021-08-23 11:29:07 -06:00
Kris Nuttycombe c803114bf6 Go ahead and clone IVKs to limit borrowing hassles. 2021-08-23 11:29:07 -06:00
Kris Nuttycombe d8bf892c72 Return key used to decrypt an output along with decrypted note contents. 2021-08-23 11:29:07 -06:00
Kris Nuttycombe e33cd4ade4 Add trial decryption of actions to Bundle 2021-08-23 11:28:25 -06:00
str4d 8454f86d42
Merge pull request #140 from nuttycom/bundle_zip244_commitments
Implement ZIP-244 txid and authorizing commitments.
2021-07-29 14:45:24 +01:00
Kris Nuttycombe 40d80c4d6f
Apply suggestions from code review
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
2021-07-29 07:16:14 -06:00
Jack Grigg a33d1bd90f Add circuit benchmarks and (on Unix) flamegraphs
- Benchmarks:  `cargo bench`
- Flamegraphs: `cargo bench -- --profile-time 100`
2021-07-28 15:09:31 +01:00
Kris Nuttycombe aa0c0ecbec Implement ZIP-244 txid and authorizing commitments. 2021-07-01 10:10:24 -06:00
Jack Grigg 3badd42d15 nonempty 0.7
We can now correctly measure the heap-allocated memory used by a bundle.
2021-06-28 20:57:49 +01:00
Kris Nuttycombe 1b42ae707b Make proptest bundle size configurable. 2021-06-23 15:57:33 -06:00
Jack Grigg 06f7d7fbe0 Add `Bundle<Authorized, _>::dynamic_usage` method
This will be used by `zcashd` as part of tracking the memory usage of
transactions.
2021-06-22 16:06:49 +01:00
Jack Grigg 62642fd804 Add `Bundle<Authorized, _>::verify_proof` API 2021-06-21 13:38:43 +01:00
Daira Hopwood e412a5a25b
Merge pull request #115 from zcash/anchor-type
Store anchors as pallas::Base instead of [u8; 32]
2021-06-15 14:18:48 +01:00
Jack Grigg eec17a9174 Add a `Bundle::binding_validating_key` method
This derives the `bvk` for validating `Authorized::binding_signature`.
2021-06-14 21:40:28 +01:00
Jack Grigg de78186503 Store anchors as pallas::Base instead of [u8; 32]
This matches what we store in `MerklePath`, and better enforces the
required type.
2021-06-12 21:35:37 +01:00
therealyingtong 8f8eff23d8 Update proptests to generate Merkle paths 2021-06-08 22:38:11 +08:00
Jack Grigg cdfd2ab0f9 Remove clones from types that now impl Copy 2021-05-28 12:10:54 +01:00
str4d f82d00e40d
Merge pull request #77 from zcash/remove-rand-0.7
Remove rand 0.7 usage
2021-05-21 21:25:34 +01:00
Kris Nuttycombe 800e540875 Make the `Bundle` type implement `Clone`
This is required for proptest generation that handles shrinking
correctly in librustzcash.
2021-05-13 15:35:44 -06:00
Jack Grigg 012d14073d Remove rand 0.7 usage
Upstream redjubjub (on which our reddsa dependency is based) has
migrated to rand 0.8.
2021-05-09 07:51:55 +12:00
Kris Nuttycombe c9f1060bb9 Minor correction to type signature (naming) 2021-05-05 17:44:15 -06:00
Kris Nuttycombe bf4532fd7d Properly condition generators on flags. 2021-05-05 17:36:05 -06:00
Kris Nuttycombe 71736433d0 Rename arb_nonnegative_note_value -> arb_note_value_bounded 2021-05-05 17:23:21 -06:00
Kris Nuttycombe 3170096134 Publicly expose `MAX_NOTE_VALUE` 2021-05-05 17:19:42 -06:00
Kris Nuttycombe e72d74ccd6 Remove extraneous pub exports from the root. 2021-05-05 11:46:24 -06:00
Kris Nuttycombe 226673938a Pass flags to arbitrary action generators. 2021-05-05 11:21:45 -06:00
Kris Nuttycombe 88b8265165 Generate both spend and output values for actions. 2021-05-05 11:14:38 -06:00