zebra/zebra-chain/src/keys/sprout.rs

46 lines
1.1 KiB
Rust
Raw Normal View History

2020-03-13 14:38:42 -07:00
//! Sprout key types
//!
//! "The receiving key sk_enc, the incoming viewing key ivk = (apk,
//! sk_enc), and the shielded payment address addr_pk = (a_pk, pk_enc) are
//! derived from a_sk, as described in [Sprout Key Components][ps]
//!
//! [ps]: https://zips.z.cash/protocol/protocol.pdf#sproutkeycomponents
2020-03-13 14:38:42 -07:00
2020-02-25 15:14:59 -08:00
use std::{
fmt,
io::{self},
};
#[cfg(test)]
use proptest::{array, collection::vec, prelude::*};
#[cfg(test)]
use proptest_derive::Arbitrary;
use crate::serialization::{SerializationError, ZcashDeserialize, ZcashSerialize};
/// All other Sprout key types derive from the SpendingKey value.
pub struct SpendingKey;
/// Derived from a _SpendingKey_.
pub type ReceivingKey = x25519_dalek::StaticSecret;
/// Derived from a _SpendingKey_.
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct PayingKey(pub [u8; 32]);
/// Derived from a _ReceivingKey_.
pub type TransmissionKey = x25519_dalek::PublicKey;
///
pub struct IncomingViewingKey {
paying_key: PayingKey,
receiving_key: ReceivingKey,
}
2020-02-25 15:14:59 -08:00
#[cfg(test)]
proptest! {
// #[test]
// fn test() {}
2020-02-25 15:14:59 -08:00
}