Commit Graph

42 Commits

Author SHA1 Message Date
Deirdre Connolly 6ed6ccd62e Clean up imports and some doc comments 2020-04-29 22:42:52 -04:00
Deirdre Connolly b53be18c8f Remove unused From<[u8; 32]> for SpendAuthorizingKey 2020-04-18 04:40:31 -04:00
Deirdre Connolly 630d021886 Remove unused From<[u8; 32]> for ProofAuthorizingKey 2020-04-18 04:40:31 -04:00
Deirdre Connolly d445799626 Remove the Deref's and make the From's consistent for all key types 2020-04-18 04:40:31 -04:00
Deirdre Connolly 37337c9e44 Remove some impl Deref's and PartialEq's that weren't used
Add some impl From<T> for [u8; 32] 's
2020-04-18 04:40:31 -04:00
Deirdre Connolly f8022442cf Remove some currently unused From impls for [u8; 32] 2020-04-18 04:40:31 -04:00
Deirdre Connolly 252acd85d8 Tidy imports 2020-04-18 04:40:31 -04:00
Deirdre Connolly 001b39c588 Impl PartialEq for AuthorizingKey and FullViewingKey 2020-04-18 04:40:31 -04:00
Deirdre Connolly 5d430cff12 Do not try to make a jubjub extended point work as a scalar in redjubjub PublicKey From impl 2020-04-18 04:40:31 -04:00
Deirdre Connolly 94c6d74ecb Add sapling key derivation bech32 encoding roundtrip proptest
And fix SpendingKey Display impl bug.
2020-04-18 04:40:31 -04:00
Deirdre Connolly 9daa1ba3c8 Impl PartialEq for some Sapling keys 2020-04-18 04:40:31 -04:00
Deirdre Connolly ba3ba6d2d9 Impl From<SpendingKey> for Diversifier
This is the _DefaultDiversifier_ method.
2020-04-18 04:40:31 -04:00
Deirdre Connolly 16f1e3061f Impl From<(AuthorizingKey, NullifierDerivingKey)> for IncomingViewingKey 2020-04-18 04:40:31 -04:00
Deirdre Connolly e508d09e9b Move sapling key tests to own module, test key derivation against test vectors
Impl a few From<[u8; 32]>'s for a few key types.
2020-04-18 04:40:31 -04:00
Deirdre Connolly adab7335b6 Impl From<[u8; 32]>/Display/FromStr for Sapling SpendingKey, including network field 2020-04-18 04:40:31 -04:00
Deirdre Connolly 68c281c590 Impl Display/FromStr for Sapling IncomingViewingKey, including network field 2020-04-18 04:40:31 -04:00
Deirdre Connolly 3eeb9925eb Impl Debug, Display, and FromStr for Sapling FullViewingKey 2020-04-18 04:40:31 -04:00
Deirdre Connolly c30a5a64b2 Get Sapling zaddr encoding roundtrip proptest working for now
TransmissionKey is just the jubjub affine point identity for now. :/
2020-04-18 04:40:31 -04:00
Deirdre Connolly aa18937b60 Add network, impl Display and FromStr for SaplingShieldedAddress 2020-04-18 04:40:31 -04:00
Deirdre Connolly 43e60fd9a9 Lots of doc improvements 2020-04-18 04:40:31 -04:00
Deirdre Connolly f9d6625fae All Sapling key derivation looks to be working
Modulo actual test vectors! Currently testing with random data each time to
just see if all the types derive without panicking.
2020-04-18 04:40:31 -04:00
Deirdre Connolly bc13bccb8d Add a bunch of stuff for JubJub GroupHash, FindGroupHash, etc
Until it can be imported into the jubjub crate and upstreamed.
It has been ported from the types used in zcash_primitives and cleaned up
but still needs testing.
2020-04-18 04:40:31 -04:00
Deirdre Connolly 7e2ae70d66 Wrap AuthorizingKey around redjubjub::PublicKey<SpendAuth>
And derive From's and Into's for it, halfway through full key derivation via a test case.
2020-04-18 04:40:31 -04:00
Deirdre Connolly 8388b13ac9 Turn all type aliases into wrapper types with impl Deref 2020-04-18 04:40:31 -04:00
Deirdre Connolly b9deef2956 Break out crh_ivk() and invoke in IncomingViewingKey derivation
There is only one invocation of this PRF but it's nice to keep it consistent with
the PRF^expand ones we have too.
2020-04-18 04:40:31 -04:00
Deirdre Connolly 13f2c229d9 Add prf_expand() and use that in sapling key derivation 2020-04-18 04:40:31 -04:00
Deirdre Connolly 451e592b28 Tidy keys::sapling, add commented out Arbitrary impl for now 2020-04-18 04:40:31 -04:00
Deirdre Connolly 743330fd0b Make several types wrap jubjub types and impl Deref 2020-04-18 04:40:31 -04:00
Deirdre Connolly 39278a3095 Parameterize AuthorizingKey as PublicKeyBytes<SpendAuth> 2020-04-18 04:40:31 -04:00
Deirdre Connolly 097d4617df Update sapling keys derived from spending key via blake2b 2020-04-18 04:40:31 -04:00
Deirdre Connolly b167a3b96e Create our own Scalar alias for now 2020-04-18 04:40:31 -04:00
Deirdre Connolly 8add92445c Add jubjub, replace blake2 with blake2b_simd 2020-04-18 04:40:31 -04:00
Deirdre Connolly 1219f1b552 Improve FullViewingKey doc comment 2020-04-18 04:40:31 -04:00
Deirdre Connolly ebe5cce3bb Better doc comment for sapling::TranmissionKey 2020-04-18 04:40:31 -04:00
Deirdre Connolly b175d1f1ba Typo
Co-Authored-By: Daira Hopwood <daira@jacaranda.org>
2020-04-18 04:40:31 -04:00
Deirdre Connolly f5bdd449ee Derive OVK via Blake2b as PRF^expand with t=2
Co-Authored-By: Daira Hopwood <daira@jacaranda.org>
2020-04-18 04:40:31 -04:00
Deirdre Connolly 98a91ab92f Add simple FullViewingKey for now 2020-04-18 04:40:31 -04:00
Deirdre Connolly e2743c0b15 Add all simple types for Sapling key derivation tree 2020-04-18 04:40:31 -04:00
Deirdre Connolly afccdc3af6 Fix typos and doc comments 2020-03-28 02:42:13 -04:00
Deirdre Connolly 7af9b80f3b Add the beginnings of Sprout and Sapling key types 2020-03-28 02:42:13 -04:00
Deirdre Connolly b03d70090f Module-level doc comments 2020-03-28 02:42:13 -04:00
Deirdre Connolly 0998b90392 Stub out sprout, sapling key modules 2020-03-12 22:02:17 -04:00