From e7cd80767a17f115d8a56400a7ce696fa7d21b55 Mon Sep 17 00:00:00 2001 From: Mariano Nicolini Date: Tue, 26 Mar 2024 12:38:28 -0300 Subject: [PATCH] Test pedersen refactor --- crates/starknet-types-core/src/hash/pedersen.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/crates/starknet-types-core/src/hash/pedersen.rs b/crates/starknet-types-core/src/hash/pedersen.rs index 940ddd0..752a086 100644 --- a/crates/starknet-types-core/src/hash/pedersen.rs +++ b/crates/starknet-types-core/src/hash/pedersen.rs @@ -6,15 +6,16 @@ use lambdaworks_math::field::{ use super::traits::StarkHash; -pub struct Pedersen; +#[derive(Default)] +pub struct Pedersen(PedersenLambdaworks); impl StarkHash for Pedersen { /// Computes the Pedersen hash of two Felts, as defined /// in fn hash(felt_0: &Felt, felt_1: &Felt) -> Felt { - let pedersen = PedersenLambdaworks::default(); + // let pedersen = PedersenLambdaworks::default(); - let hash = pedersen.hash(&felt_0.0, &felt_1.0); + let hash = Self.0.hash(&felt_0.0, &felt_1.0); Felt(hash) }