Add explicit pedersen_hash function

This commit is contained in:
Deirdre Connolly 2020-07-26 13:35:20 -04:00 committed by Deirdre Connolly
parent 83c41869e1
commit 4ccec84768
1 changed files with 9 additions and 1 deletions

View File

@ -63,7 +63,15 @@ pub fn pedersen_hash_to_point(domain: [u8; 8], M: &BitVec<Lsb0, u8>) -> jubjub::
result
}
/// Construct a “windowed” Pedersen commitment by reusing a Perderson
/// Pedersen Hash Function
///
/// https://zips.z.cash/protocol/protocol.pdf#concretepedersenhash
#[allow(non_snake_case)]
pub fn pedersen_hash(domain: [u8; 8], M: &BitVec<Lsb0, u8>) -> jubjub::Fq {
jubjub::AffinePoint::from(pedersen_hash_to_point(domain, M)).get_u()
}
/// Construct a 'windowed' Pedersen commitment by reusing a Perderson
/// hash constructon, and adding a randomized point on the Jubjub
/// curve.
///