Daira Hopwood
3b52b2abec
Minor cleanup found while performing review for zcash/zcash#5024
...
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2022-04-14 08:29:00 -06:00
therealyingtong
eaa0cfdbf6
Check that the internal IVK can be derived from a spending key
...
Co-authored-by: Jack Grigg <jack@electriccoin.co>
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
2022-03-30 20:49:38 +08:00
therealyingtong
e550c3d536
Check IVK derivations during FullViewingKey::from_bytes.
...
Closes zcash/orchard#303
Co-authored-by: Jack Grigg <jack@electriccoin.co>
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
2022-03-30 20:49:38 +08:00
therealyingtong
a0424984c6
Add explicit scoping for viewing keys and addresses
...
Co-authored-by: Jack Grigg <jack@electriccoin.co>
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
2022-03-30 20:49:37 +08:00
Jack Grigg
72b6febf7b
Move zero-handling from inside CommitIVK to outside it
...
This more closely matches the change to the protocol spec.
2022-03-17 18:51:33 +00: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
65f3e6ec32
Add `FullViewingKey::derive_internal`
...
This is identical to the changes introduced in zcash/orchard#270 , except
that the output is non-optional (since the derivation is non-fallible).
2022-02-21 14:41:47 +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
Kris Nuttycombe
5d5e289197
Remove default_diversifier and default_address methods.
2022-02-15 14:39:32 -07:00
Kris Nuttycombe
4c7ab377fb
Make the DiversifierKey type crate-private
2022-02-14 17:04:38 -07:00
Kris Nuttycombe
ae3cc78a56
Add decryption of the diversifier index for an address to the IVK.
...
Also correct a spelling error.
2022-02-14 17:04:38 -07:00
str4d
4ae32ef98a
Merge pull request #282 from zcash/clone-unauthorized-bundle
...
Add `Clone` impls to various structs
2022-02-12 03:23:11 +00:00
Jack Grigg
c4cd541e6c
Add `Clone` impls to various structs
...
This enables `InProgress<Unproven, Unauthorized>: Clone`, which allows
the bundle returned by `Builder::build` to be cloned. In pure-Rust
wallets this should not be necessary, but it is required for `zcashd`
due to FFI-crossing.
2022-02-12 02:04:52 +00:00
Kris Nuttycombe
b7f66b48e6
Merge pull request #280 from nuttycom/decrypt_diversifier
...
Add diversifier index decryption to DiversifierKey
2022-02-11 14:51:54 -07:00
Kris Nuttycombe
8c96640826
Add diversifier index decryption to DiversifierKey.
2022-02-11 14:09:07 -07:00
Jack Grigg
c1447d6af2
Fix broken main branch
...
This was a non-code merge conflict between zcash/halo2#217 and main,
that caused CI to break after the PR merged.
2022-02-08 15:19:56 +00:00
str4d
40491385c6
Merge pull request #217 from zcash/update-halo2-gadgets
...
Delete gadgets and introduce halo2_gadgets dependency.
2022-02-03 21:23:42 +00:00
therealyingtong
91e22e4f92
Use internal keys test vectors.
2022-02-01 18:55:21 +08:00
therealyingtong
9cf4e10d4f
Remove InternalSpendingKey, introduce FullViewingKey::rivk_internal.
2022-02-01 18:55:21 +08:00
therealyingtong
99119f04fa
Derive internal full viewing key.
2022-02-01 18:55:21 +08:00
therealyingtong
2412e83400
Derive internal spending key.
2022-02-01 18:55:21 +08:00
Jack Grigg
f300cea2c8
Fix clippy lints
...
These became stable lints between 1.51 and 1.54.
2022-01-28 23:00:00 +08:00
Jack Grigg
0e1220acc9
Merge branch 'main' into orchard-mainnet-circuit
2021-12-20 15:20:33 +00:00
Jack Grigg
369b99ee3f
Add `doc_cfg` annotations
2021-12-17 22:08:58 +00:00
Jack Grigg
044844c0a0
Reject the identity in `SpendValidatingKey::from_bytes`
...
`ak_P` is not allowed to be the identity in the Orchard protocol. We
were enforcing this by construction in most places, except for the
parsing of an Orchard full viewing key.
Closes zcash/orchard#261 .
2021-12-15 13:48:59 +00:00
Jack Grigg
0378898289
Replace `FieldExt::{from, to}_bytes` with `PrimeField::{from, to}_repr`
2021-12-09 15:39:37 +00:00
Jack Grigg
37f1bba998
Remove `PartialEq, PartialOrd` impls from `{Extended}SpendingKey`
2021-11-30 23:25:35 +00:00
Jack Grigg
674ceb54c8
`impl ConstantTimeEq for {Extended}SpendingKey`
2021-11-30 23:24:50 +00:00
Kris Nuttycombe
14c4b40dfc
Add construction of DiversifierIndex directly from bytes.
2021-11-24 18:09:25 -07:00
Jack Grigg
235cd791b4
Fix `IncomingViewingKey::to_bytes`
...
`slice::copy_from_slice` panics if the source and destination slices are
not the same length.
Closes zcash/orchard#228 .
2021-11-17 12:12:20 +00:00
Jack Grigg
8c82ceecbf
ff 0.11, group 0.11, pasta_curves 0.2 etc.
2021-09-06 20:39:43 +01:00
Kris Nuttycombe
e4a54cdf61
Improve error handling in zip32 APIs.
2021-08-31 16:49:58 -06:00
therealyingtong
c3e24794f0
zip32.rs: master and child key derivation for ExtendedSpendingKey
2021-08-31 15:49:32 -06:00
Kris Nuttycombe
77be355912
Apply suggestions from code review
...
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
Co-authored-by: ying tong <yingtong@z.cash>
2021-08-23 11:29:07 -06:00
Kris Nuttycombe
0449edd5b8
Validate the sign of the y-coordinate for ak when deserializing.
2021-08-23 11:29:07 -06:00
Kris Nuttycombe
872f337811
Expose SpendingKey byte representation.
2021-08-23 11:29:07 -06:00
Kris Nuttycombe
5d78ab3508
Add Eq and Ord implementations for Orchard keys.
2021-08-23 11:29:06 -06:00
Kris Nuttycombe
52f0f158ef
Add serialization and parsing of full viewing keys.
2021-08-23 11:28:27 -06:00
Kris Nuttycombe
1fd00e6236
Add raw address serialization and parsing.
2021-08-23 11:28:27 -06:00
Kris Nuttycombe
e33cd4ade4
Add trial decryption of actions to Bundle
2021-08-23 11:28:25 -06:00
Kris Nuttycombe
77cf4c9831
Implement IncomingViewingKey::to_bytes
2021-08-23 11:27:02 -06:00
Jack Grigg
79988a5317
Move the interpolation logic into `SharedSecret::batch_to_affine`
...
This makes the method interface clearer, as the same pattern of shared
secrets is returned as was provided.
2021-08-13 14:27:20 +01:00
Jack Grigg
c79acc0e08
Fix length of output Vec for `SharedSecret::batch_to_affine`
...
It was too long, and `group::Curve::batch_normalize` panics if its
inputs are not the same length (which would be the case if a batch
included an output with an invalid `ephemeral_key`).
2021-08-12 13:40:56 +01:00
Jack Grigg
8e13986101
Implement `Domain::batch_epk` for note decryption
...
Improves throughput of batched trial decryption by around 10%.
2021-08-12 01:36:38 +01:00
Jack Grigg
8c15cc25be
Benchmark batch trial decryption
2021-08-12 01:36:38 +01:00
therealyingtong
8cf7a6872c
Minor refactors, text fixes, and docfixes.
...
Co-authored-by: Jack Grigg <jack@electriccoin.co>
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
2021-07-23 00:15:54 +08:00
therealyingtong
6f4b5b0340
circuit.rs: Constrain derived circuit values to equal public inputs.
2021-07-21 20:35:43 +08:00
therealyingtong
d16b83816b
Implement needed getters and conversions in other modules.
2021-07-21 20:35:43 +08:00
Daira Hopwood
81fb944997
Make this crate clippy clean for warnings on nightly.
...
One .clone() removal; all of the other changes are removing needless borrows that are immediately
dereferenced: https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2021-06-21 18:04:00 +01:00
Jack Grigg
769be6c080
Note encryption test vectors
2021-06-11 23:55:17 +01:00