Use reddsa to instantiate orchard::redpallas

This commit is contained in:
Jack Grigg 2021-03-05 23:46:20 +00:00
parent ceac39d74e
commit eaa7158751
1 changed files with 7 additions and 18 deletions

View File

@ -1,38 +1,27 @@
//! TODO //! A minimal RedPallas implementation for use in Zcash.
use std::fmt;
use std::marker::PhantomData;
/// A RedPallas signature type. /// A RedPallas signature type.
pub trait SigType: private::Sealed + fmt::Debug {} pub trait SigType: reddsa::SigType + private::Sealed {}
/// A type variable corresponding to an Orchard spend authorization signature. /// A type variable corresponding to an Orchard spend authorization signature.
#[derive(Debug)] pub type SpendAuth = reddsa::orchard::SpendAuth;
pub enum SpendAuth {}
impl SigType for SpendAuth {} impl SigType for SpendAuth {}
/// A type variable corresponding to an Orchard binding signature. /// A type variable corresponding to an Orchard binding signature.
#[derive(Debug)] pub type Binding = reddsa::orchard::Binding;
pub enum Binding {}
impl SigType for Binding {} impl SigType for Binding {}
/// A RedPallas signing key. /// A RedPallas signing key.
#[derive(Debug)] #[derive(Debug)]
pub struct SigningKey<T: SigType> { pub struct SigningKey<T: SigType>(reddsa::SigningKey<T>);
_t: PhantomData<T>,
}
/// A RedPallas verification key. /// A RedPallas verification key.
#[derive(Debug)] #[derive(Debug)]
pub struct VerificationKey<T: SigType> { pub struct VerificationKey<T: SigType>(reddsa::VerificationKey<T>);
_t: PhantomData<T>,
}
/// A RedPallas signature. /// A RedPallas signature.
#[derive(Debug)] #[derive(Debug)]
pub struct Signature<T: SigType> { pub struct Signature<T: SigType>(reddsa::Signature<T>);
_t: PhantomData<T>,
}
pub(crate) mod private { pub(crate) mod private {
use super::{Binding, SpendAuth}; use super::{Binding, SpendAuth};