Skip to content

Commit

Permalink
Test lambdaworks hash as a const
Browse files Browse the repository at this point in the history
  • Loading branch information
entropidelic committed Mar 26, 2024
1 parent e7cd807 commit c5af9f6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions crates/starknet-types-core/src/hash/pedersen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@ use lambdaworks_math::field::{
};

use super::traits::StarkHash;
const PEDERSEN_LAMBDAWORKS: lambdaworks_crypto::hash::pedersen::Pedersen =
PedersenLambdaworks::default();

#[derive(Default)]
pub struct Pedersen(PedersenLambdaworks);
pub struct Pedersen;

impl StarkHash for Pedersen {
/// Computes the Pedersen hash of two Felts, as defined
/// in <https://docs.starknet.io/documentation/architecture_and_concepts/Hashing/hash-functions/#pedersen_hash.>
fn hash(felt_0: &Felt, felt_1: &Felt) -> Felt {
// let pedersen = PedersenLambdaworks::default();

let hash = Self.0.hash(&felt_0.0, &felt_1.0);
let hash = PEDERSEN_LAMBDAWORKS.hash(&felt_0.0, &felt_1.0);

Felt(hash)
}
Expand Down

0 comments on commit c5af9f6

Please sign in to comment.