diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/storage/map.nr b/noir-projects/noir-protocol-circuits/crates/types/src/storage/map.nr index 13a82bc58b58..33b7c4443eda 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/storage/map.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/storage/map.nr @@ -1,7 +1,7 @@ -use crate::{hash::pedersen_hash, traits::ToField}; +use crate::{hash::poseidon2_hash, traits::ToField}; pub fn derive_storage_slot_in_map(storage_slot: Field, key: K) -> Field where K: ToField { - pedersen_hash([storage_slot, key.to_field()], 0) + poseidon2_hash([storage_slot, key.to_field()]) } mod test { diff --git a/yarn-project/circuits.js/src/hash/map_slot.ts b/yarn-project/circuits.js/src/hash/map_slot.ts index d14b85b0ea9f..12b055b8fddc 100644 --- a/yarn-project/circuits.js/src/hash/map_slot.ts +++ b/yarn-project/circuits.js/src/hash/map_slot.ts @@ -1,4 +1,4 @@ -import { pedersenHash } from '@aztec/foundation/crypto'; +import { poseidon2Hash } from '@aztec/foundation/crypto'; import { type Fr } from '@aztec/foundation/fields'; /** @@ -14,5 +14,5 @@ export function deriveStorageSlotInMap( toField: () => Fr; }, ): Fr { - return pedersenHash([mapSlot, key.toField()]); + return poseidon2Hash([mapSlot, key.toField()], 0); }