Skip to content

Commit

Permalink
chore: shared mutable slots use poseidon2 with separator (#8919)
Browse files Browse the repository at this point in the history
  • Loading branch information
dbanks12 authored Oct 1, 2024
1 parent b363738 commit 36431d7
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
use dep::protocol_types::{hash::{pedersen_hash, poseidon2_hash}, address::AztecAddress, traits::{FromField, ToField}};
use dep::protocol_types::{
hash::{poseidon2_hash, poseidon2_hash_with_separator}, address::AztecAddress,
traits::{FromField, ToField}
};

use crate::context::{PrivateContext, PublicContext, UnconstrainedContext};
use crate::state_vars::{
Expand Down Expand Up @@ -66,15 +69,15 @@ impl<T, let INITIAL_DELAY: u32, Context> SharedMutable<T, INITIAL_DELAY, Context
// - a ScheduledDelaChange
// - the hash of both of these (via `hash_scheduled_data`)
fn get_value_change_storage_slot(self) -> Field {
pedersen_hash([self.storage_slot], VALUE_CHANGE_SEPARATOR)
poseidon2_hash_with_separator([self.storage_slot], VALUE_CHANGE_SEPARATOR)
}

fn get_delay_change_storage_slot(self) -> Field {
pedersen_hash([self.storage_slot], DELAY_CHANGE_SEPARATOR)
poseidon2_hash_with_separator([self.storage_slot], DELAY_CHANGE_SEPARATOR)
}

fn get_hash_storage_slot(self) -> Field {
pedersen_hash([self.storage_slot], HASH_SEPARATOR)
poseidon2_hash_with_separator([self.storage_slot], HASH_SEPARATOR)
}
}

Expand Down

0 comments on commit 36431d7

Please sign in to comment.