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
Kris Nuttycombe
4afdeeeb76
Add mapping over bundle value balance.
2021-04-30 09:43:51 -06:00
Kris Nuttycombe
a119a27ee7
Clean up value balance generation.
2021-04-30 07:59:46 -06:00
Kris Nuttycombe
25c90dda4b
Add fast generation for not-consensus-valid authorized bundles and actions.
2021-04-29 16:14:16 -06:00
Kris Nuttycombe
f91088d35b
Use builder to generate "valid" bundles via proptest.
2021-04-28 18:21:12 -06:00
Kris Nuttycombe
4d89d45332
Add proptest generators for action and bundle types.
2021-04-28 18:04:17 -06:00
Kris Nuttycombe
75573d331a
Add canonical byte conversions for value commitments.
2021-04-28 18:03:50 -06:00
Kris Nuttycombe
fc0f55d82b
Make ValueSum correctly respect the proper specified range.
2021-04-28 18:03:50 -06:00
Kris Nuttycombe
a5c9fb953b
Add accessors necessary for zip-225 write.
2021-04-28 18:02:36 -06:00
Kris Nuttycombe
e743198a50
Expose constructors required for ZIP-225 parsing.
2021-04-28 18:02:36 -06:00
Jack Grigg
30f01d122c
Bundle builder
2021-04-27 14:31:21 +12:00
Jack Grigg
497f7e0b86
Remove bundle::Unauthorized type
...
It is being replaced by context-specific unauthorized or
partially-authorized types. The only general type we need is Authorized
which is used in transactions.
2021-04-27 12:30:16 +12:00
Jack Grigg
316729302d
cargo fmt
2021-04-27 12:28:42 +12:00
Jack Grigg
5ec65c5d2a
Add a mutable context to Bundle::{try_}authorize
...
This enables us to work around lifetime restrictions on e.g. the
randomness source at signing time, where it is needed for both
per-Action and Bundle-level signatures.
2021-04-27 12:24:33 +12:00
Jack Grigg
29b3071c67
Fix doc comments for bundle flags
2021-04-27 09:10:32 +12:00
Kris Nuttycombe
36529629bc
Expose Flags constructor & accessors.
2021-04-27 09:04:03 +12:00
Kris Nuttycombe
7d243ae60a
Apply suggestions from code review
...
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
2021-04-22 07:32:20 -06:00
Jack Grigg
3c2e32e156
Add some internal doc comments
2021-04-22 16:39:36 +12:00
Jack Grigg
09cca41ffb
Add getters for bundle and action internals
2021-04-22 16:39:36 +12:00
Jack Grigg
f1ad9d08de
Bundle and action constructors
2021-04-22 16:39:26 +12:00
Jack Grigg
01d241df7c
Rename some bundle and action variables to match the protocol spec
2021-04-22 16:38:17 +12:00
Jack Grigg
5dbcbf28fb
Bundle Authorization transformations
2021-04-22 16:37:31 +12:00
Jack Grigg
b1286b4e94
Fix bundle::Action to hold cmx instead of cm
2021-04-20 10:26:58 +12:00
Jack Grigg
9882373e85
Make Bundle a parametric type over an Authorization trait
...
This enables us to construct Bundles at various stages of
authorization:
- `Bundle<Unauthorized>`: A bundle with all effecting data but no
proofs or signatures.
- `Bundle<Authorized>`: A bundle with all proofs and signatures,
suitable for inclusion in a block.
- `Bundle<Partial>`: Example of some in-progress bundle authorization,
for example during a FROST threshold multisignature protocol.
Also adds the bundle flags field from ZIP 225.
2021-03-03 17:39:53 +00:00
Jack Grigg
97d75bab9a
Enforce in type system that a Bundle contains at least one Action
2021-02-24 20:10:10 +00:00