Make nk the first argument to Nullifier::derive

This more closely matches DeriveNullifier in the spec.
This commit is contained in:
Jack Grigg 2021-03-30 13:52:20 +13:00
parent 0f6eb9ca6c
commit 5646ada113
2 changed files with 2 additions and 2 deletions

View File

@ -73,7 +73,7 @@ impl Note {
/// Derives the nullifier for this note.
pub fn nullifier(&self, fvk: &FullViewingKey) -> Nullifier {
Nullifier::derive(self.rho.0, self.rseed.psi(), self.commitment(), fvk.nk())
Nullifier::derive(fvk.nk(), self.rho.0, self.rseed.psi(), self.commitment())
}
}

View File

@ -18,10 +18,10 @@ impl Nullifier {
///
/// [commitmentsandnullifiers]: https://zips.z.cash/protocol/nu5.pdf#commitmentsandnullifiers
pub(super) fn derive(
nk: &NullifierDerivingKey,
rho: pallas::Base,
psi: pallas::Base,
cm: NoteCommitment,
nk: &NullifierDerivingKey,
) -> Self {
let k = pallas::Point::hash_to_curve("z.cash:Orchard")(b"K");