orchard: impl From<SpendingKey> for NullifierDerivingKey
This commit is contained in:
parent
f50d8697d4
commit
6e1d2f1fb1
|
@ -355,16 +355,11 @@ impl From<&NullifierDerivingKey> for [u8; 32] {
|
|||
}
|
||||
|
||||
impl From<SpendingKey> for NullifierDerivingKey {
|
||||
/// Requires JubJub's _FindGroupHash^J("Zcash_H_", "")_, then uses
|
||||
/// the resulting generator point to scalar multiply the
|
||||
/// ProofAuthorizingKey into the new NullifierDerivingKey
|
||||
/// nk = ToBase^Orchard(PRF^expand_sk ([7]))
|
||||
///
|
||||
/// https://zips.z.cash/protocol/protocol.pdf#orchardkeycomponents
|
||||
/// https://zips.z.cash/protocol/protocol.pdf#concretegrouphashjubjub
|
||||
fn from(sk: SpendingKey) -> Self {
|
||||
let generator_point = prf_expand(sk, []);
|
||||
|
||||
Self(pallas::Affine::from(generator_point * sk.0))
|
||||
Self(pallas::Base::from_bytes_wide(prf_expand(sk, [7])))
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue