diff --git a/starknet-core/src/types/contract/legacy.rs b/starknet-core/src/types/contract/legacy.rs index 30360ca2..56cab605 100644 --- a/starknet-core/src/types/contract/legacy.rs +++ b/starknet-core/src/types/contract/legacy.rs @@ -280,8 +280,9 @@ struct AttributeForHintedHash; impl From for u64 { fn from(value: LegacyEntrypointOffset) -> Self { match value { - LegacyEntrypointOffset::U64AsHex(inner) => inner, - LegacyEntrypointOffset::U64AsInt(inner) => inner, + LegacyEntrypointOffset::U64AsHex(inner) | LegacyEntrypointOffset::U64AsInt(inner) => { + inner + } } } } @@ -289,8 +290,9 @@ impl From for u64 { impl From for Felt { fn from(value: LegacyEntrypointOffset) -> Self { match value { - LegacyEntrypointOffset::U64AsHex(inner) => inner.into(), - LegacyEntrypointOffset::U64AsInt(inner) => inner.into(), + LegacyEntrypointOffset::U64AsHex(inner) | LegacyEntrypointOffset::U64AsInt(inner) => { + inner.into() + } } } } diff --git a/starknet-crypto/src/pedersen_hash.rs b/starknet-crypto/src/pedersen_hash.rs index 124740e8..a5026750 100644 --- a/starknet-crypto/src/pedersen_hash.rs +++ b/starknet-crypto/src/pedersen_hash.rs @@ -4,9 +4,6 @@ use starknet_types_core::felt::Felt; use crate::pedersen_points::*; -// const SHIFT_POINT: Result = -// ProjectivePoint::from_affine(curve_params::SHIFT_POINT.x(), curve_params::SHIFT_POINT.y()); - /// Computes the Starkware version of the Pedersen hash of x and y. All inputs are little-endian. /// /// ### Arguments @@ -14,8 +11,8 @@ use crate::pedersen_points::*; /// * `x`: The x coordinate /// * `y`: The y coordinate pub fn pedersen_hash(x: &Felt, y: &Felt) -> Felt { - let x = x.to_bits_be(); - let y = y.to_bits_be(); + let x = x.to_bits_le(); + let y = y.to_bits_le(); // Preprocessed material is lookup-tables for each chunk of bits let table_size = (1 << CURVE_CONSTS_BITS) - 1;