mirror of https://github.com/zcash/halo2.git
Use reddsa to instantiate orchard::redpallas
This commit is contained in:
parent
ceac39d74e
commit
eaa7158751
|
@ -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};
|
||||||
|
|
Loading…
Reference in New Issue