Make diversify_hash() private again

This commit is contained in:
Deirdre Connolly 2020-08-05 18:54:56 -04:00 committed by Deirdre Connolly
parent 5a249f8da5
commit 2942bad6ff
2 changed files with 4 additions and 1 deletions

View File

@ -220,6 +220,9 @@ impl NoteCommitment {
// Jubjub repr_J canonical byte encoding // Jubjub repr_J canonical byte encoding
// https://zips.z.cash/protocol/protocol.pdf#jubjub // https://zips.z.cash/protocol/protocol.pdf#jubjub
//
// The `From<Diversifier>` impls for the `jubjub::*Point`s handles
// calling `DiversifyHash` implicitly.
let g_d_bytes = jubjub::AffinePoint::from(diversifier).to_bytes(); let g_d_bytes = jubjub::AffinePoint::from(diversifier).to_bytes();
let pk_d_bytes = <[u8; 32]>::from(transmission_key); let pk_d_bytes = <[u8; 32]>::from(transmission_key);
let v_bytes = value.to_bytes(); let v_bytes = value.to_bytes();

View File

@ -155,7 +155,7 @@ fn zcash_h() -> jubjub::ExtendedPoint {
/// Used to derive a diversified base point from a diversifier value. /// Used to derive a diversified base point from a diversifier value.
/// ///
/// https://zips.z.cash/protocol/protocol.pdf#concretediversifyhash /// https://zips.z.cash/protocol/protocol.pdf#concretediversifyhash
pub fn diversify_hash(d: [u8; 11]) -> Option<jubjub::ExtendedPoint> { fn diversify_hash(d: [u8; 11]) -> Option<jubjub::ExtendedPoint> {
jubjub_group_hash(*b"Zcash_gd", &d) jubjub_group_hash(*b"Zcash_gd", &d)
} }