diff --git a/zebra-chain/src/commitments/sapling.rs b/zebra-chain/src/commitments/sapling.rs index 88dbdc4cd..b7ba05482 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 6832b4192..9c2b89c5f 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) }