From 2942bad6ff0ad88538fbef130c66f1bb64f753e6 Mon Sep 17 00:00:00 2001 From: Deirdre Connolly Date: Wed, 5 Aug 2020 18:54:56 -0400 Subject: [PATCH] Make diversify_hash() private again --- zebra-chain/src/commitments/sapling.rs | 3 +++ zebra-chain/src/keys/sapling.rs | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/zebra-chain/src/commitments/sapling.rs b/zebra-chain/src/commitments/sapling.rs index 88dbdc4c..b7ba0548 100644 --- a/zebra-chain/src/commitments/sapling.rs +++ b/zebra-chain/src/commitments/sapling.rs @@ -220,6 +220,9 @@ impl NoteCommitment { // Jubjub repr_J canonical byte encoding // https://zips.z.cash/protocol/protocol.pdf#jubjub + // + // The `From` impls for the `jubjub::*Point`s handles + // calling `DiversifyHash` implicitly. let g_d_bytes = jubjub::AffinePoint::from(diversifier).to_bytes(); let pk_d_bytes = <[u8; 32]>::from(transmission_key); let v_bytes = value.to_bytes(); diff --git a/zebra-chain/src/keys/sapling.rs b/zebra-chain/src/keys/sapling.rs index 6832b419..9c2b89c5 100644 --- a/zebra-chain/src/keys/sapling.rs +++ b/zebra-chain/src/keys/sapling.rs @@ -155,7 +155,7 @@ fn zcash_h() -> jubjub::ExtendedPoint { /// Used to derive a diversified base point from a diversifier value. /// /// https://zips.z.cash/protocol/protocol.pdf#concretediversifyhash -pub fn diversify_hash(d: [u8; 11]) -> Option { +fn diversify_hash(d: [u8; 11]) -> Option { jubjub_group_hash(*b"Zcash_gd", &d) }