Skip to content

Commit

Permalink
Test pedersen refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
entropidelic committed Mar 26, 2024
1 parent 4a7656e commit e7cd807
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions crates/starknet-types-core/src/hash/pedersen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 <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 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)
}
Expand Down

0 comments on commit e7cd807

Please sign in to comment.