From 6e1d2f1fb1a7c5d4fd2120eb50dd6a1b28b5e7c2 Mon Sep 17 00:00:00 2001 From: Deirdre Connolly Date: Mon, 8 Mar 2021 15:44:25 -0500 Subject: [PATCH] orchard: impl From for NullifierDerivingKey --- zebra-chain/src/orchard/keys.rs | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/zebra-chain/src/orchard/keys.rs b/zebra-chain/src/orchard/keys.rs index e632f8ea6..8d2dbffb9 100644 --- a/zebra-chain/src/orchard/keys.rs +++ b/zebra-chain/src/orchard/keys.rs @@ -355,16 +355,11 @@ impl From<&NullifierDerivingKey> for [u8; 32] { } impl From 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]))) } }