From c72ddb1251e16ad38ed07f614ca2afc1c02a7035 Mon Sep 17 00:00:00 2001 From: Kris Nuttycombe Date: Mon, 13 Dec 2021 13:37:11 -0700 Subject: [PATCH] Improve documentation of DiversifierKey#diversifier_index Co-authored-by: str4d --- zcash_primitives/src/zip32.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/zcash_primitives/src/zip32.rs b/zcash_primitives/src/zip32.rs index b9d7825c7..406fb9271 100644 --- a/zcash_primitives/src/zip32.rs +++ b/zcash_primitives/src/zip32.rs @@ -160,8 +160,11 @@ impl DiversifierKey { Self::try_diversifier_internal(&ff, j) } - /// Decrypts a diversifier using this diversifier key to obtain the - /// diversifier index from which it was originally created. + /// Returns the diversifier index to which this key maps the given diversifier. + /// + /// This method cannot be used to verify whether the diversifier was originally + /// generated with this diversifier key, because all valid diversifiers can be + /// produced by all diversifier keys. pub fn diversifier_index(&self, d: &Diversifier) -> DiversifierIndex { let ff = FF1::::new(&self.0, 2).unwrap(); let dec = ff