Add explicit pedersen_hash function
This commit is contained in:
parent
83c41869e1
commit
4ccec84768
|
@ -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.
|
||||
///
|
||||
|
|
Loading…
Reference in New Issue