Skip to content

Commit e12109b

Browse files
committed
refactor: use a single utils crate
1 parent dfb330a commit e12109b

63 files changed

Lines changed: 101 additions & 151 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Cargo.lock

Lines changed: 9 additions & 21 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ wildcard_imports = "allow"
5353

5454
[workspace.dependencies]
5555
# Local
56-
utils = { path = "crates/utils" }
5756
lean_vm = { path = "crates/lean_vm" }
5857
xmss = { path = "crates/xmss" }
5958
sub_protocols = { path = "crates/sub_protocols" }
@@ -91,7 +90,6 @@ rec_aggregation.workspace = true
9190
zk-alloc.workspace = true
9291
rand.workspace = true
9392
sub_protocols.workspace = true
94-
utils.workspace = true
9593
lean_vm.workspace = true
9694
xmss.workspace = true
9795
backend.workspace = true

crates/backend/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ whir = { path = "../whir", package = "mt-whir" }
1414
tracing.workspace = true
1515
fiat-shamir = { path = "fiat-shamir", package = "mt-fiat-shamir" }
1616
koala-bear = { path = "koala-bear", package = "mt-koala-bear" }
17-
utils = { path = "utils", package = "mt-utils" }
17+
utils = { path = "utils", package = "utils" }

crates/backend/fiat-shamir/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ edition.workspace = true
77
field = { path = "../field", package = "mt-field" }
88
koala-bear = { path = "../koala-bear", package = "mt-koala-bear" }
99
symetric = { path = "../symetric", package = "mt-symetric" }
10-
utils = { path = "../utils", package = "mt-utils" }
10+
utils = { path = "../utils", package = "utils" }
1111
tracing.workspace = true
1212
serde.workspace = true
1313
rayon.workspace = true

crates/backend/fiat-shamir/src/challenger.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
use field::PrimeField64;
22
use koala_bear::symmetric::Permutation;
3-
4-
pub const RATE: usize = 8;
5-
pub const WIDTH: usize = RATE * 2;
6-
pub const CAPACITY: usize = WIDTH - RATE;
3+
use symetric::{CAPACITY, RATE, WIDTH};
74

85
#[derive(Clone, Debug)]
96
pub struct Challenger<F, P> {

crates/backend/fiat-shamir/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ mod utils;
88
pub use utils::*;
99

1010
mod challenger;
11-
pub use challenger::{CAPACITY, RATE, WIDTH};
1211

1312
mod traits;
1413
pub use traits::*;

crates/backend/fiat-shamir/src/prover.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
1-
use crate::{
2-
MerklePaths, PrunedMerklePaths,
3-
challenger::{CAPACITY, Challenger, RATE, WIDTH},
4-
*,
5-
};
1+
use crate::challenger::Challenger;
2+
use crate::{MerklePaths, PrunedMerklePaths, *};
63
use field::Field;
74
use field::PackedValue;
85
use field::PrimeCharacteristicRing;
@@ -13,6 +10,9 @@ use rayon::prelude::*;
1310
use std::sync::atomic::{AtomicU64, Ordering};
1411
use std::time::Duration;
1512
use std::{fmt::Debug, sync::Mutex, time::Instant};
13+
use symetric::CAPACITY;
14+
use symetric::RATE;
15+
use symetric::WIDTH;
1616

1717
static POW_GRINDING_NANOS: AtomicU64 = AtomicU64::new(0);
1818

crates/backend/fiat-shamir/src/utils.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
use field::{BasedVectorSpace, ExtensionField, Field, PrimeCharacteristicRing, PrimeField64};
22
use koala_bear::symmetric::Permutation;
3+
use symetric::{RATE, WIDTH};
34

4-
use crate::challenger::{Challenger, RATE, WIDTH};
5+
use crate::challenger::Challenger;
56

67
pub(crate) type PF<F> = <F as PrimeCharacteristicRing>::PrimeSubfield;
78

crates/backend/fiat-shamir/src/verifier.rs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
1-
use std::any::TypeId;
2-
use std::collections::VecDeque;
3-
use std::iter::repeat_n;
4-
1+
use crate::challenger::Challenger;
52
use crate::{
63
MerkleOpening, MerklePaths, PrunedMerklePaths, RawProof,
7-
challenger::{CAPACITY, Challenger, RATE, WIDTH},
84
transcript::{DIGEST_LEN_FE, Proof},
95
*,
106
};
117
use field::PrimeCharacteristicRing;
128
use field::{ExtensionField, PrimeField64};
139
use koala_bear::symmetric::Permutation;
1410
use koala_bear::{KoalaBear, default_koalabear_poseidon1_16};
11+
use std::any::TypeId;
12+
use std::collections::VecDeque;
13+
use std::iter::repeat_n;
14+
use symetric::CAPACITY;
15+
use symetric::RATE;
16+
use symetric::WIDTH;
1517

1618
pub struct VerifierState<EF: ExtensionField<PF<EF>>, P> {
1719
challenger: Challenger<PF<EF>, P>,

crates/backend/field/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ version.workspace = true
44
edition.workspace = true
55

66
[dependencies]
7-
utils = { path = "../utils", package = "mt-utils" }
7+
utils = { path = "../utils", package = "utils" }
88

99
itertools.workspace = true
1010
num-bigint = "*"

0 commit comments

Comments
 (0)