mirror of https://github.com/zcash/halo2.git
Expose RedPallas rerandomization
This commit is contained in:
parent
0ccb0101df
commit
35f65bb26a
|
@ -109,6 +109,13 @@ impl From<&SpendAuthorizingKey> for SpendValidatingKey {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl SpendValidatingKey {
|
||||||
|
/// Randomizes this spend validating key with the given `randomizer`.
|
||||||
|
pub fn randomize(&self, randomizer: &pallas::Scalar) -> redpallas::VerificationKey<SpendAuth> {
|
||||||
|
self.0.randomize(randomizer)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// A key used to derive [`Nullifier`]s from [`Note`]s.
|
/// A key used to derive [`Nullifier`]s from [`Note`]s.
|
||||||
///
|
///
|
||||||
/// Defined in [Zcash Protocol Spec § 4.2.3: Orchard Key Components][orchardkeycomponents].
|
/// Defined in [Zcash Protocol Spec § 4.2.3: Orchard Key Components][orchardkeycomponents].
|
||||||
|
|
|
@ -2,6 +2,8 @@
|
||||||
|
|
||||||
use std::convert::{TryFrom, TryInto};
|
use std::convert::{TryFrom, TryInto};
|
||||||
|
|
||||||
|
use pasta_curves::pallas;
|
||||||
|
|
||||||
/// A RedPallas signature type.
|
/// A RedPallas signature type.
|
||||||
pub trait SigType: reddsa::SigType + private::Sealed {}
|
pub trait SigType: reddsa::SigType + private::Sealed {}
|
||||||
|
|
||||||
|
@ -73,6 +75,15 @@ impl<T: SigType> PartialEq for VerificationKey<T> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl VerificationKey<SpendAuth> {
|
||||||
|
/// Randomizes this verification key with the given `randomizer`.
|
||||||
|
///
|
||||||
|
/// Randomization is only supported for `SpendAuth` keys.
|
||||||
|
pub fn randomize(&self, randomizer: &pallas::Scalar) -> Self {
|
||||||
|
VerificationKey(self.0.randomize(randomizer))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// A RedPallas signature.
|
/// A RedPallas signature.
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct Signature<T: SigType>(reddsa::Signature<T>);
|
pub struct Signature<T: SigType>(reddsa::Signature<T>);
|
||||||
|
|
Loading…
Reference in New Issue