Struct lambdaworks_crypto::hash::pedersen::PedersenStarkCurve
source · pub struct PedersenStarkCurve;
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PedersenStarkCurve
impl RefUnwindSafe for PedersenStarkCurve
impl Send for PedersenStarkCurve
impl Sync for PedersenStarkCurve
impl Unpin for PedersenStarkCurve
impl UnwindSafe for PedersenStarkCurve
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<P> Pedersen for Pwhere
P: PedersenParameters<F = MontgomeryBackendPrimeField<MontgomeryConfigStark252PrimeField, 4>>,
impl<P> Pedersen for Pwhere
P: PedersenParameters<F = MontgomeryBackendPrimeField<MontgomeryConfigStark252PrimeField, 4>>,
source§fn hash(
x: &FieldElement<<P as PedersenParameters>::F>,
y: &FieldElement<<P as PedersenParameters>::F>,
) -> FieldElement<<P as PedersenParameters>::F>
fn hash( x: &FieldElement<<P as PedersenParameters>::F>, y: &FieldElement<<P as PedersenParameters>::F>, ) -> FieldElement<<P as PedersenParameters>::F>
Implements Starkware version of Pedersen hash of x and y.
Divides each of x and y into 4-bit chunks, and uses lookup tables to accumulate pre-calculated
points corresponding to a given chunk.
Accumulation starts from a “shift_point” whose points are derived from digits of pi.
Pre-calculated points are multiples by powers of 2 of the “shift_point”. Read more
source§fn lookup_and_accumulate(
acc: &mut ShortWeierstrassProjectivePoint<<P as PedersenParameters>::EC>,
bits: &[bool],
prep: &[ShortWeierstrassProjectivePoint<<P as PedersenParameters>::EC>],
)
fn lookup_and_accumulate( acc: &mut ShortWeierstrassProjectivePoint<<P as PedersenParameters>::EC>, bits: &[bool], prep: &[ShortWeierstrassProjectivePoint<<P as PedersenParameters>::EC>], )
Performs lookup to find the constant point corresponding to 4-bit chunks of given input.
Keeps adding up those points to the given accumulation point.