openzeppelin_crypto/pedersen/
params.rs

1//! Pedersen hash parameters.
2
3use crate::{curve::CurveConfig, field::prime::PrimeField};
4
5/// Pedersen hash parameters.
6pub trait PedersenParams<P: CurveConfig>
7where
8    <P as CurveConfig>::BaseField: PrimeField,
9{
10    /// The affine representation type for this Elliptic Curve.
11    type AffineRepr;
12
13    /// Number of elements in the hash.
14    const N_ELEMENT_BITS_HASH: usize;
15
16    /// Shift point.
17    const P_0: Self::AffineRepr;
18
19    /// Constant point -- `P_1`.
20    const P_1: Self::AffineRepr;
21    /// Constant point -- `P_2`.
22    const P_2: Self::AffineRepr;
23    /// Constant point -- `P_3`.
24    const P_3: Self::AffineRepr;
25    /// Constant point -- `P_4`.
26    const P_4: Self::AffineRepr;
27
28    /// Low bits of a value to hash.
29    const LOW_PART_BITS: u32;
30    /// Low part mask for a value to hash.
31    const LOW_PART_MASK: <P::BaseField as PrimeField>::BigInt;
32}