Commit Graph

603 Commits

Author SHA1 Message Date
Deirdre Connolly 68c281c590 Impl Display/FromStr for Sapling IncomingViewingKey, including network field 2020-04-18 04:40:31 -04:00
Deirdre Connolly cdfcdc4751 Tidy imports 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 ef9ab8b0ab Remove Debug test 2020-04-18 04:40:31 -04:00
Deirdre Connolly 01599a0735 Fix unneeded initial value and mut 2020-04-18 04:40:31 -04:00
Deirdre Connolly 23cd346f28 Add missing doc comment for sapling addresses 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 33821d427d Add a lazy derive_keys_and_addresses test 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 b7bd642910 Clippy pass 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 4acce5aa30 Remove static lifetime on some constants 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 786677e07b Add and use prf_addr() for sprout key derivation 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 b3db623e29 Fill out SaplingShieldedAddress impls and some tests 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 7402a54379 Add bech32 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 145afb7bda 2 Blakes, 2 Serious 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 8e42c6d8b0 Add stub for SaplingShieldedAddress 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 62d30c0a33 Add blake2 dependency 2020-04-18 04:40:31 -04:00
Deirdre Connolly 21a8a29404 Better doc comments for Sprout SpendingKey fields 2020-04-15 03:22:48 -04:00
Deirdre Connolly dd930c678b Impl Display as the inverse of FromStr for SproutShieldedAddress
And add proptests for zcash (de)serialization and human-readable roundstrips.
2020-04-15 03:22:48 -04:00
Deirdre Connolly 75fbef462d Add proptest-regressions for new sprout spending key proptests 2020-04-15 03:22:48 -04:00
Deirdre Connolly e057e120bb Impl Display/FromStr/ZcashSerialize/ZcashDeserialize for Sprout SpendingKey
Includes new  field because the raw and Base58Check encoding depends on it.
2020-04-15 03:22:48 -04:00
Deirdre Connolly 6dc0830ea6 Impl Default for Network, as Mainnet 2020-04-15 03:22:48 -04:00
Deirdre Connolly e83cddf4c6 Impl Display/FromStr/ZcashSerialize/ZcashDeserialize for Sprout IncomingViewingKeys
To match the raw and Base58Check encodings as in
https://zips.z.cash/protocol/protocol.pdf#sproutinviewingkeyencoding
2020-04-15 03:22:48 -04:00
dependabot-preview[bot] 77375f3ba8 Bump pin-project from 0.4.8 to 0.4.9
Bumps [pin-project](https://github.com/taiki-e/pin-project) from 0.4.8 to 0.4.9.
- [Release notes](https://github.com/taiki-e/pin-project/releases)
- [Changelog](https://github.com/taiki-e/pin-project/blob/master/CHANGELOG.md)
- [Commits](https://github.com/taiki-e/pin-project/compare/v0.4.8...v0.4.9)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-04-14 14:07:15 -04:00
George Tankersley df79fa75e0
Implement minimal version handshaking (#295)
Co-authored-by: Deirdre Connolly <durumcrustulum@gmail.com>
Co-authored-by: Henry de Valence <hdevalence@hdevalence.ca>
2020-04-13 18:33:15 -04:00
Deirdre Connolly 05ca1c0c8a Refine JoinSplit ephemeral keys to be x25519_dalek::PublicKey
Impls PartialEq and Eq and Arbitrary on JoinSplit because PublicKey
does not impl them and we can't do it directly.

Resolves #313
2020-04-13 15:32:04 -04:00
dependabot-preview[bot] baf305b856 Bump tokio from 0.2.17 to 0.2.18
Bumps [tokio](https://github.com/tokio-rs/tokio) from 0.2.17 to 0.2.18.
- [Release notes](https://github.com/tokio-rs/tokio/releases)
- [Commits](https://github.com/tokio-rs/tokio/compare/tokio-0.2.17...tokio-0.2.18)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-04-13 00:02:08 -04:00
dependabot-preview[bot] 8e28db07fb Bump proptest from 0.9.5 to 0.9.6
Bumps [proptest](https://github.com/altsysrq/proptest) from 0.9.5 to 0.9.6.
- [Release notes](https://github.com/altsysrq/proptest/releases)
- [Changelog](https://github.com/AltSysrq/proptest/blob/master/CHANGELOG.md)
- [Commits](https://github.com/altsysrq/proptest/compare/0.9.5...0.9.6)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-04-12 23:48:27 -04:00
dependabot-preview[bot] dd60ce44f1 Bump thiserror from 1.0.14 to 1.0.15
Bumps [thiserror](https://github.com/dtolnay/thiserror) from 1.0.14 to 1.0.15.
- [Release notes](https://github.com/dtolnay/thiserror/releases)
- [Commits](https://github.com/dtolnay/thiserror/compare/1.0.14...1.0.15)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-04-12 23:47:37 -04:00
dependabot-preview[bot] 212eb229f4 Bump tokio from 0.2.16 to 0.2.17
Bumps [tokio](https://github.com/tokio-rs/tokio) from 0.2.16 to 0.2.17.
- [Release notes](https://github.com/tokio-rs/tokio/releases)
- [Commits](https://github.com/tokio-rs/tokio/commits)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-04-09 17:20:13 -04:00
Deirdre Connolly 955a4ebc3c Rename SpendDescription to Spend, OutputDescription to Output 2020-04-09 17:17:21 -04:00