Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use starknet-crypto for poseidon #890

Merged
merged 1 commit into from
Mar 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ hex = { version = "0.4.3", default-features = false }
bincode = { tag = "v2.0.0-rc.2", git = "https://github.com/bincode-org/bincode.git", default-features = false, features = [
"serde",
] }
starknet-crypto = { git = "https://github.com/tdelabro/starknet-rs.git", branch = "feature/manual-no-std-bigdecimal", default-features = false }
starknet-crypto = { version = "0.4.1", default-features = false, features = ["signature-display"] }
sha3 = { version = "0.10.1", default-features = false }
rand_core = { version = "0.6.4", default-features = false }
lazy_static = { version = "1.4.0", default-features = false, features = [
Expand Down
1 change: 0 additions & 1 deletion src/vm/runners/builtin_runner/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ mod hash;
mod keccak;
mod output;
mod poseidon;
mod poseidon_utils;
mod range_check;
mod signature;

Expand Down
5 changes: 2 additions & 3 deletions src/vm/runners/builtin_runner/poseidon.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,8 @@ use crate::vm::vm_memory::memory::Memory;
use crate::vm::vm_memory::memory_segments::MemorySegmentManager;
use felt::Felt;
use num_integer::div_ceil;
use starknet_crypto::FieldElement;
use starknet_crypto::{poseidon_permute_comp, FieldElement};

use super::poseidon_utils::poseidon_hash::permute_comp;
use super::POSEIDON_BUILTIN_NAME;

#[derive(Debug, Clone)]
Expand Down Expand Up @@ -99,7 +98,7 @@ impl PoseidonBuiltinRunner {
}
// n_input_cells is fixed to 3, so this try_into will never fail
let mut poseidon_state: [FieldElement; 3] = input_felts.try_into().unwrap();
permute_comp(&mut poseidon_state);
poseidon_permute_comp(&mut poseidon_state);
for (i, elem) in poseidon_state.iter().enumerate() {
self.cache.borrow_mut().insert(
(first_output_addr + i)?,
Expand Down
2 changes: 0 additions & 2 deletions src/vm/runners/builtin_runner/poseidon_utils/mod.rs

This file was deleted.

Loading