diff --git a/Cargo.lock b/Cargo.lock index c2522c72..49f263de 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1769,6 +1769,7 @@ name = "starknet-crypto-codegen" version = "0.3.3" dependencies = [ "starknet-curve", + "starknet-types-core", "syn 2.0.55", ] diff --git a/starknet-crypto-codegen/Cargo.toml b/starknet-crypto-codegen/Cargo.toml index 259857fc..18ddd910 100644 --- a/starknet-crypto-codegen/Cargo.toml +++ b/starknet-crypto-codegen/Cargo.toml @@ -18,3 +18,4 @@ proc-macro = true [dependencies] starknet-curve = { version = "0.4.2", path = "../starknet-curve" } syn = { version = "2.0.15", default-features = false } +starknet-types-core = "0.0.10" diff --git a/starknet-crypto/src/pedersen_hash.rs b/starknet-crypto/src/pedersen_hash.rs index d8a98e38..8aef9945 100644 --- a/starknet-crypto/src/pedersen_hash.rs +++ b/starknet-crypto/src/pedersen_hash.rs @@ -37,6 +37,9 @@ pub fn pedersen_hash(x: &Felt, y: &Felt) -> Felt { add_points(&mut acc, &y[..248], &CURVE_CONSTS_P2); // Add b_low * P3 add_points(&mut acc, &y[248..252], &CURVE_CONSTS_P3); // Add b_high * P4 + // Convert to affine + let result = AffinePoint::from(&acc); + // Return x-coordinate result.x }