Skip to content

Commit

Permalink
chore: add poseidon_permute_comp back
Browse files Browse the repository at this point in the history
  • Loading branch information
xJonathanLEI committed Sep 18, 2024
1 parent dbe467e commit 216436d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
4 changes: 3 additions & 1 deletion starknet-crypto/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ pub use starknet_types_core::felt::Felt;

pub use pedersen_hash::pedersen_hash;

pub use poseidon_hash::{poseidon_hash, poseidon_hash_many, poseidon_hash_single, PoseidonHasher};
pub use poseidon_hash::{
poseidon_hash, poseidon_hash_many, poseidon_hash_single, poseidon_permute_comp, PoseidonHasher,
};

pub use ecdsa::{get_public_key, recover, sign, verify, ExtendedSignature, Signature};

Expand Down
5 changes: 5 additions & 0 deletions starknet-crypto/src/poseidon_hash.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,11 @@ pub fn poseidon_hash_many<'a, I: IntoIterator<Item = &'a Felt>>(msgs: I) -> Felt
state[0]
}

/// Poseidon permutation function.
pub fn poseidon_permute_comp(state: &mut [Felt; 3]) {
Poseidon::hades_permutation(state)
}

#[cfg(test)]
mod tests {
use starknet_types_core::hash::StarkHash;
Expand Down

0 comments on commit 216436d

Please sign in to comment.