diff --git a/Cargo.toml b/Cargo.toml index a96f24e..cf00b3a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,97 +1,18 @@ -[package] -name = "miden-crypto" -version = "0.14.0" -description = "Miden Cryptographic primitives" +[workspace] +members = [ + "miden-crypto" +] +exclude = [ + "miden-crypto-fuzz" +] +resolver = "3" # Use the edition 2024 dependency resolver + +[workspace.package] authors = ["miden contributors"] -readme = "README.md" license = "MIT" repository = "https://github.com/0xPolygonMiden/crypto" -documentation = "https://docs.rs/miden-crypto/0.14.0" categories = ["cryptography", "no-std"] keywords = ["miden", "crypto", "hash", "merkle"] edition = "2024" rust-version = "1.85" -[[bin]] -name = "miden-crypto" -path = "src/main.rs" -bench = false -doctest = false -required-features = ["executable"] - -[[bench]] -name = "hash" -harness = false - -[[bench]] -name = "smt" -harness = false - -[[bench]] -name = "smt-subtree" -harness = false -required-features = ["internal"] - -[[bench]] -name = "merkle" -harness = false - -[[bench]] -name = "smt-with-entries" -harness = false - -[[bench]] -name = "store" -harness = false - -[features] -concurrent = ["dep:rayon", "hashbrown?/rayon"] -default = ["std", "concurrent"] -executable = ["dep:clap", "dep:rand-utils", "std"] -smt_hashmaps = ["dep:hashbrown"] -internal = [] -serde = ["dep:serde", "serde?/alloc", "winter-math/serde"] -std = [ - "blake3/std", - "dep:cc", - "rand/std", - "rand/thread_rng", - "winter-crypto/std", - "winter-math/std", - "winter-utils/std", -] - -[dependencies] -blake3 = { version = "1.5", default-features = false } -clap = { version = "4.5", optional = true, features = ["derive"] } -hashbrown = { version = "0.15", optional = true, features = ["serde"] } -num = { version = "0.4", default-features = false, features = ["alloc", "libm"] } -num-complex = { version = "0.4", default-features = false } -rand = { version = "0.9", default-features = false } -rand_core = { version = "0.9", default-features = false } -rand-utils = { version = "0.12", package = "winter-rand-utils", optional = true } -rayon = { version = "1.10", optional = true } -serde = { version = "1.0", default-features = false, optional = true, features = ["derive"] } -sha3 = { version = "0.10", default-features = false } -thiserror = { version = "2.0", default-features = false } -winter-crypto = { version = "0.12", default-features = false } -winter-math = { version = "0.12", default-features = false } -winter-utils = { version = "0.12", default-features = false } - -[dev-dependencies] -assert_matches = { version = "1.5", default-features = false } -criterion = { version = "0.5", features = ["html_reports"] } -getrandom = { version = "0.3", default-features = false } -hex = { version = "0.4", default-features = false, features = ["alloc"] } -proptest = { version = "1.6", default-features = false, features = ["alloc"]} -rand_chacha = { version = "0.9", default-features = false } -rand-utils = { version = "0.12", package = "winter-rand-utils" } -seq-macro = { version = "0.3" } - -[build-dependencies] -cc = { version = "1.2", optional = true, features = ["parallel"] } -glob = "0.3" - -[lints.rust] -# Suppress warnings about `cfg(fuzzing)`, which is automatically set when using `cargo-fuzz`. -unexpected_cfgs = { level = "warn", check-cfg = ['cfg(fuzzing)'] } diff --git a/Makefile b/Makefile index af430a9..7abb8d6 100644 --- a/Makefile +++ b/Makefile @@ -99,4 +99,4 @@ bench-smt-concurrent: ## Run SMT benchmarks with concurrent feature .PHONY: fuzz-smt fuzz-smt: ## Run fuzzing for SMT - cargo +nightly fuzz run smt --release -- -max_len=10485760 + cargo +nightly fuzz run smt --release --fuzz-dir miden-crypto-fuzz -- -max_len=10485760 diff --git a/README.md b/README.md index 956a4f2..4bc9625 100644 --- a/README.md +++ b/README.md @@ -10,17 +10,17 @@ This crate contains cryptographic primitives used in Polygon Miden. ## Hash -[Hash module](./src/hash) provides a set of cryptographic hash functions which are used by the Miden VM and the Miden rollup. Currently, these functions are: +[Hash module](./miden-crypto/src/hash) provides a set of cryptographic hash functions which are used by the Miden VM and the Miden rollup. Currently, these functions are: - [BLAKE3](https://github.com/BLAKE3-team/BLAKE3) hash function with 256-bit, 192-bit, or 160-bit output. The 192-bit and 160-bit outputs are obtained by truncating the 256-bit output of the standard BLAKE3. - [RPO](https://eprint.iacr.org/2022/1577) hash function with 256-bit output. This hash function is an algebraic hash function suitable for recursive STARKs. - [RPX](https://eprint.iacr.org/2023/1045) hash function with 256-bit output. Similar to RPO, this hash function is suitable for recursive STARKs but it is about 2x faster as compared to RPO. -For performance benchmarks of these hash functions and their comparison to other popular hash functions please see [here](./benches/). +For performance benchmarks of these hash functions and their comparison to other popular hash functions please see [here](./miden-crypto/benches/). ## Merkle -[Merkle module](./src/merkle/) provides a set of data structures related to Merkle trees. All these data structures are implemented using the RPO hash function described above. The data structures are: +[Merkle module](./miden-crypto/src/merkle/) provides a set of data structures related to Merkle trees. All these data structures are implemented using the RPO hash function described above. The data structures are: - `MerkleStore`: a collection of Merkle trees of different heights designed to efficiently store trees with common subtrees. When instantiated with `RecordingMap`, a Merkle store records all accesses to the original data. - `MerkleTree`: a regular fully-balanced binary Merkle tree. The depth of this tree can be at most 64. @@ -34,7 +34,7 @@ The module also contains additional supporting components such as `NodeIndex`, ` ## Signatures -[DSA module](./src/dsa) provides a set of digital signature schemes supported by default in the Miden VM. Currently, these schemes are: +[DSA module](./miden-crypto/src/dsa) provides a set of digital signature schemes supported by default in the Miden VM. Currently, these schemes are: - `RPO Falcon512`: a variant of the [Falcon](https://falcon-sign.info/) signature scheme. This variant differs from the standard in that instead of using SHAKE256 hash function in the _hash-to-point_ algorithm we use RPO256. This makes the signature more efficient to verify in Miden VM. @@ -42,7 +42,7 @@ For the above signatures, key generation, signing, and signature verification ar ## Pseudo-Random Element Generator -[Pseudo random element generator module](./src/rand/) provides a set of traits and data structures that facilitate generating pseudo-random elements in the context of Miden VM and Miden rollup. The module currently includes: +[Pseudo random element generator module](./miden-crypto/src/rand/) provides a set of traits and data structures that facilitate generating pseudo-random elements in the context of Miden VM and Miden rollup. The module currently includes: - `FeltRng`: a trait for generating random field elements and random 4 field elements. - `RpoRandomCoin`: a struct implementing `FeltRng` as well as the [`RandomCoin`](https://github.com/facebook/winterfell/blob/main/crypto/src/random/mod.rs) trait using RPO hash function. diff --git a/fuzz/.gitignore b/miden-crypto-fuzz/.gitignore similarity index 100% rename from fuzz/.gitignore rename to miden-crypto-fuzz/.gitignore diff --git a/fuzz/Cargo.lock b/miden-crypto-fuzz/Cargo.lock similarity index 79% rename from fuzz/Cargo.lock rename to miden-crypto-fuzz/Cargo.lock index 201f30a..965dc96 100644 --- a/fuzz/Cargo.lock +++ b/miden-crypto-fuzz/Cargo.lock @@ -32,6 +32,12 @@ version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" +[[package]] +name = "bitflags" +version = "2.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c8214115b7bf84099f1309324e63141d4c5d7cc26862f97a0a857dbefe165bd" + [[package]] name = "blake3" version = "1.6.0" @@ -167,13 +173,14 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.15" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" +checksum = "43a49c392881ce6d5c3b8cb70f98717b7c07aabbdff06687b9030dbfbe2725f8" dependencies = [ "cfg-if", "libc", "wasi", + "windows-targets", ] [[package]] @@ -344,7 +351,7 @@ version = "0.2.20" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "77957b295656769bb8ad2b6a6b09d897d94f05c41b069aede1fcdaa675eaea04" dependencies = [ - "zerocopy", + "zerocopy 0.7.35", ] [[package]] @@ -367,20 +374,20 @@ dependencies = [ [[package]] name = "rand" -version = "0.8.5" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +checksum = "3779b94aeb87e8bd4e834cee3650289ee9e0d5677f976ecdb6d219e5f4f6cd94" dependencies = [ - "libc", "rand_chacha", "rand_core", + "zerocopy 0.8.23", ] [[package]] name = "rand_chacha" -version = "0.3.1" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +checksum = "d3022b5f1df60f26e1ffddd6c66e8aa15de382ae63b3a0c1bfc0e4d3e3f325cb" dependencies = [ "ppv-lite86", "rand_core", @@ -388,9 +395,9 @@ dependencies = [ [[package]] name = "rand_core" -version = "0.6.4" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +checksum = "99d9a13982dcf210057a8a78572b2217b667c3beacbf3a0d8b454f6f82837d38" dependencies = [ "getrandom", ] @@ -502,9 +509,76 @@ checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" [[package]] name = "wasi" -version = "0.11.0+wasi-snapshot-preview1" +version = "0.13.3+wasi-0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" +checksum = "26816d2e1a4a36a2940b96c5296ce403917633dff8f3440e9b236ed6f6bacad2" +dependencies = [ + "wit-bindgen-rt", +] + +[[package]] +name = "windows-targets" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +dependencies = [ + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_gnullvm", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "winter-crypto" @@ -533,6 +607,15 @@ version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2d47518e6931955dcac73a584cacb04550b82ab2f45c72880cbbbdbe13adb63c" +[[package]] +name = "wit-bindgen-rt" +version = "0.33.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3268f3d866458b787f390cf61f4bbb563b922d091359f9608842999eaee3943c" +dependencies = [ + "bitflags", +] + [[package]] name = "zerocopy" version = "0.7.35" @@ -540,7 +623,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" dependencies = [ "byteorder", - "zerocopy-derive", + "zerocopy-derive 0.7.35", +] + +[[package]] +name = "zerocopy" +version = "0.8.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd97444d05a4328b90e75e503a34bad781f14e28a823ad3557f0750df1ebcbc6" +dependencies = [ + "zerocopy-derive 0.8.23", ] [[package]] @@ -553,3 +645,14 @@ dependencies = [ "quote", "syn", ] + +[[package]] +name = "zerocopy-derive" +version = "0.8.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6352c01d0edd5db859a63e2605f4ea3183ddbd15e2c4a9e7d32184df75e4f154" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] diff --git a/fuzz/Cargo.toml b/miden-crypto-fuzz/Cargo.toml similarity index 81% rename from fuzz/Cargo.toml rename to miden-crypto-fuzz/Cargo.toml index eb8ee2c..0391298 100644 --- a/fuzz/Cargo.toml +++ b/miden-crypto-fuzz/Cargo.toml @@ -9,7 +9,7 @@ cargo-fuzz = true [dependencies] libfuzzer-sys = "0.4" -miden-crypto = { path = "..", features = ["concurrent"] } +miden-crypto = { path = "../miden-crypto", features = ["concurrent"] } rand = { version = "0.9", default-features = false } [[bin]] diff --git a/fuzz/fuzz_targets/smt.rs b/miden-crypto-fuzz/fuzz_targets/smt.rs similarity index 95% rename from fuzz/fuzz_targets/smt.rs rename to miden-crypto-fuzz/fuzz_targets/smt.rs index 8304292..ad43221 100644 --- a/fuzz/fuzz_targets/smt.rs +++ b/miden-crypto-fuzz/fuzz_targets/smt.rs @@ -11,8 +11,8 @@ struct FuzzInput { impl FuzzInput { fn from_bytes(data: &[u8]) -> Self { - let mut rng = rand::thread_rng(); - let split_percentage = rng.gen_range(20..80); // Randomly choose between 20% and 80% + let mut rng = rand::rng(); + let split_percentage = rng.random_range(20..80); // Randomly choose between 20% and 80% let split_index = (data.len() * split_percentage) / 100; let (construction_data, update_data) = data.split_at(split_index); diff --git a/miden-crypto/Cargo.toml b/miden-crypto/Cargo.toml new file mode 100644 index 0000000..a77e66b --- /dev/null +++ b/miden-crypto/Cargo.toml @@ -0,0 +1,97 @@ +[package] +name = "miden-crypto" +version = "0.14.0" +description = "Miden Cryptographic primitives" +authors.workspace = true +readme = "README.md" +license.workspace = true +repository.workspace = true +documentation = "https://docs.rs/miden-crypto/0.14.0" +categories.workspace = true +keywords.workspace = true +edition.workspace = true +rust-version.workspace = true + +[[bin]] +name = "miden-crypto" +path = "src/main.rs" +bench = false +doctest = false +required-features = ["executable"] + +[[bench]] +name = "hash" +harness = false + +[[bench]] +name = "smt" +harness = false + +[[bench]] +name = "smt-subtree" +harness = false +required-features = ["internal"] + +[[bench]] +name = "merkle" +harness = false + +[[bench]] +name = "smt-with-entries" +harness = false + +[[bench]] +name = "store" +harness = false + +[features] +concurrent = ["dep:rayon", "hashbrown?/rayon"] +default = ["std", "concurrent"] +executable = ["dep:clap", "dep:rand-utils", "std"] +smt_hashmaps = ["dep:hashbrown"] +internal = [] +serde = ["dep:serde", "serde?/alloc", "winter-math/serde"] +std = [ + "blake3/std", + "dep:cc", + "rand/std", + "rand/thread_rng", + "winter-crypto/std", + "winter-math/std", + "winter-utils/std", +] + +[dependencies] +blake3 = { version = "1.5", default-features = false } +clap = { version = "4.5", optional = true, features = ["derive"] } +hashbrown = { version = "0.15", optional = true, features = ["serde"] } +num = { version = "0.4", default-features = false, features = ["alloc", "libm"] } +num-complex = { version = "0.4", default-features = false } +rand = { version = "0.9", default-features = false } +rand_core = { version = "0.9", default-features = false } +rand-utils = { version = "0.12", package = "winter-rand-utils", optional = true } +rayon = { version = "1.10", optional = true } +serde = { version = "1.0", default-features = false, optional = true, features = ["derive"] } +sha3 = { version = "0.10", default-features = false } +thiserror = { version = "2.0", default-features = false } +winter-crypto = { version = "0.12", default-features = false } +winter-math = { version = "0.12", default-features = false } +winter-utils = { version = "0.12", default-features = false } + +[dev-dependencies] +assert_matches = { version = "1.5", default-features = false } +criterion = { version = "0.5", features = ["html_reports"] } +getrandom = { version = "0.3", default-features = false } +hex = { version = "0.4", default-features = false, features = ["alloc"] } +proptest = { version = "1.6", default-features = false, features = ["alloc"]} +rand_chacha = { version = "0.9", default-features = false } +rand-utils = { version = "0.12", package = "winter-rand-utils" } +seq-macro = { version = "0.3" } + +[build-dependencies] +cc = { version = "1.2", optional = true, features = ["parallel"] } +glob = "0.3" + +[lints.rust] +# Suppress warnings about `cfg(fuzzing)`, which is automatically set when using `cargo-fuzz`. +unexpected_cfgs = { level = "warn", check-cfg = ['cfg(fuzzing)'] } \ No newline at end of file diff --git a/arch/arm64-sve/rpo/library.c b/miden-crypto/arch/arm64-sve/rpo/library.c similarity index 100% rename from arch/arm64-sve/rpo/library.c rename to miden-crypto/arch/arm64-sve/rpo/library.c diff --git a/arch/arm64-sve/rpo/library.h b/miden-crypto/arch/arm64-sve/rpo/library.h similarity index 100% rename from arch/arm64-sve/rpo/library.h rename to miden-crypto/arch/arm64-sve/rpo/library.h diff --git a/arch/arm64-sve/rpo/rpo_hash_128bit.h b/miden-crypto/arch/arm64-sve/rpo/rpo_hash_128bit.h similarity index 100% rename from arch/arm64-sve/rpo/rpo_hash_128bit.h rename to miden-crypto/arch/arm64-sve/rpo/rpo_hash_128bit.h diff --git a/arch/arm64-sve/rpo/rpo_hash_256bit.h b/miden-crypto/arch/arm64-sve/rpo/rpo_hash_256bit.h similarity index 100% rename from arch/arm64-sve/rpo/rpo_hash_256bit.h rename to miden-crypto/arch/arm64-sve/rpo/rpo_hash_256bit.h diff --git a/benches/README.md b/miden-crypto/benches/README.md similarity index 100% rename from benches/README.md rename to miden-crypto/benches/README.md diff --git a/benches/hash.rs b/miden-crypto/benches/hash.rs similarity index 100% rename from benches/hash.rs rename to miden-crypto/benches/hash.rs diff --git a/benches/merkle.rs b/miden-crypto/benches/merkle.rs similarity index 100% rename from benches/merkle.rs rename to miden-crypto/benches/merkle.rs diff --git a/benches/smt-subtree.rs b/miden-crypto/benches/smt-subtree.rs similarity index 100% rename from benches/smt-subtree.rs rename to miden-crypto/benches/smt-subtree.rs diff --git a/benches/smt-with-entries.rs b/miden-crypto/benches/smt-with-entries.rs similarity index 100% rename from benches/smt-with-entries.rs rename to miden-crypto/benches/smt-with-entries.rs diff --git a/benches/smt.rs b/miden-crypto/benches/smt.rs similarity index 100% rename from benches/smt.rs rename to miden-crypto/benches/smt.rs diff --git a/benches/store.rs b/miden-crypto/benches/store.rs similarity index 100% rename from benches/store.rs rename to miden-crypto/benches/store.rs diff --git a/build.rs b/miden-crypto/build.rs similarity index 100% rename from build.rs rename to miden-crypto/build.rs diff --git a/src/dsa/mod.rs b/miden-crypto/src/dsa/mod.rs similarity index 100% rename from src/dsa/mod.rs rename to miden-crypto/src/dsa/mod.rs diff --git a/src/dsa/rpo_falcon512/hash_to_point.rs b/miden-crypto/src/dsa/rpo_falcon512/hash_to_point.rs similarity index 100% rename from src/dsa/rpo_falcon512/hash_to_point.rs rename to miden-crypto/src/dsa/rpo_falcon512/hash_to_point.rs diff --git a/src/dsa/rpo_falcon512/keys/mod.rs b/miden-crypto/src/dsa/rpo_falcon512/keys/mod.rs similarity index 100% rename from src/dsa/rpo_falcon512/keys/mod.rs rename to miden-crypto/src/dsa/rpo_falcon512/keys/mod.rs diff --git a/src/dsa/rpo_falcon512/keys/public_key.rs b/miden-crypto/src/dsa/rpo_falcon512/keys/public_key.rs similarity index 100% rename from src/dsa/rpo_falcon512/keys/public_key.rs rename to miden-crypto/src/dsa/rpo_falcon512/keys/public_key.rs diff --git a/src/dsa/rpo_falcon512/keys/secret_key.rs b/miden-crypto/src/dsa/rpo_falcon512/keys/secret_key.rs similarity index 100% rename from src/dsa/rpo_falcon512/keys/secret_key.rs rename to miden-crypto/src/dsa/rpo_falcon512/keys/secret_key.rs diff --git a/src/dsa/rpo_falcon512/math/ffsampling.rs b/miden-crypto/src/dsa/rpo_falcon512/math/ffsampling.rs similarity index 100% rename from src/dsa/rpo_falcon512/math/ffsampling.rs rename to miden-crypto/src/dsa/rpo_falcon512/math/ffsampling.rs diff --git a/src/dsa/rpo_falcon512/math/fft.rs b/miden-crypto/src/dsa/rpo_falcon512/math/fft.rs similarity index 100% rename from src/dsa/rpo_falcon512/math/fft.rs rename to miden-crypto/src/dsa/rpo_falcon512/math/fft.rs diff --git a/src/dsa/rpo_falcon512/math/field.rs b/miden-crypto/src/dsa/rpo_falcon512/math/field.rs similarity index 100% rename from src/dsa/rpo_falcon512/math/field.rs rename to miden-crypto/src/dsa/rpo_falcon512/math/field.rs diff --git a/src/dsa/rpo_falcon512/math/mod.rs b/miden-crypto/src/dsa/rpo_falcon512/math/mod.rs similarity index 100% rename from src/dsa/rpo_falcon512/math/mod.rs rename to miden-crypto/src/dsa/rpo_falcon512/math/mod.rs diff --git a/src/dsa/rpo_falcon512/math/polynomial.rs b/miden-crypto/src/dsa/rpo_falcon512/math/polynomial.rs similarity index 100% rename from src/dsa/rpo_falcon512/math/polynomial.rs rename to miden-crypto/src/dsa/rpo_falcon512/math/polynomial.rs diff --git a/src/dsa/rpo_falcon512/math/samplerz.rs b/miden-crypto/src/dsa/rpo_falcon512/math/samplerz.rs similarity index 100% rename from src/dsa/rpo_falcon512/math/samplerz.rs rename to miden-crypto/src/dsa/rpo_falcon512/math/samplerz.rs diff --git a/src/dsa/rpo_falcon512/mod.rs b/miden-crypto/src/dsa/rpo_falcon512/mod.rs similarity index 100% rename from src/dsa/rpo_falcon512/mod.rs rename to miden-crypto/src/dsa/rpo_falcon512/mod.rs diff --git a/src/dsa/rpo_falcon512/signature.rs b/miden-crypto/src/dsa/rpo_falcon512/signature.rs similarity index 100% rename from src/dsa/rpo_falcon512/signature.rs rename to miden-crypto/src/dsa/rpo_falcon512/signature.rs diff --git a/src/hash/blake/mod.rs b/miden-crypto/src/hash/blake/mod.rs similarity index 100% rename from src/hash/blake/mod.rs rename to miden-crypto/src/hash/blake/mod.rs diff --git a/src/hash/blake/tests.rs b/miden-crypto/src/hash/blake/tests.rs similarity index 100% rename from src/hash/blake/tests.rs rename to miden-crypto/src/hash/blake/tests.rs diff --git a/src/hash/mod.rs b/miden-crypto/src/hash/mod.rs similarity index 100% rename from src/hash/mod.rs rename to miden-crypto/src/hash/mod.rs diff --git a/src/hash/rescue/arch/mod.rs b/miden-crypto/src/hash/rescue/arch/mod.rs similarity index 100% rename from src/hash/rescue/arch/mod.rs rename to miden-crypto/src/hash/rescue/arch/mod.rs diff --git a/src/hash/rescue/arch/x86_64_avx2.rs b/miden-crypto/src/hash/rescue/arch/x86_64_avx2.rs similarity index 100% rename from src/hash/rescue/arch/x86_64_avx2.rs rename to miden-crypto/src/hash/rescue/arch/x86_64_avx2.rs diff --git a/src/hash/rescue/mds/freq.rs b/miden-crypto/src/hash/rescue/mds/freq.rs similarity index 100% rename from src/hash/rescue/mds/freq.rs rename to miden-crypto/src/hash/rescue/mds/freq.rs diff --git a/src/hash/rescue/mds/mod.rs b/miden-crypto/src/hash/rescue/mds/mod.rs similarity index 100% rename from src/hash/rescue/mds/mod.rs rename to miden-crypto/src/hash/rescue/mds/mod.rs diff --git a/src/hash/rescue/mod.rs b/miden-crypto/src/hash/rescue/mod.rs similarity index 100% rename from src/hash/rescue/mod.rs rename to miden-crypto/src/hash/rescue/mod.rs diff --git a/src/hash/rescue/rpo/digest.rs b/miden-crypto/src/hash/rescue/rpo/digest.rs similarity index 100% rename from src/hash/rescue/rpo/digest.rs rename to miden-crypto/src/hash/rescue/rpo/digest.rs diff --git a/src/hash/rescue/rpo/mod.rs b/miden-crypto/src/hash/rescue/rpo/mod.rs similarity index 100% rename from src/hash/rescue/rpo/mod.rs rename to miden-crypto/src/hash/rescue/rpo/mod.rs diff --git a/src/hash/rescue/rpo/tests.rs b/miden-crypto/src/hash/rescue/rpo/tests.rs similarity index 100% rename from src/hash/rescue/rpo/tests.rs rename to miden-crypto/src/hash/rescue/rpo/tests.rs diff --git a/src/hash/rescue/rpx/digest.rs b/miden-crypto/src/hash/rescue/rpx/digest.rs similarity index 100% rename from src/hash/rescue/rpx/digest.rs rename to miden-crypto/src/hash/rescue/rpx/digest.rs diff --git a/src/hash/rescue/rpx/mod.rs b/miden-crypto/src/hash/rescue/rpx/mod.rs similarity index 100% rename from src/hash/rescue/rpx/mod.rs rename to miden-crypto/src/hash/rescue/rpx/mod.rs diff --git a/src/hash/rescue/rpx/tests.rs b/miden-crypto/src/hash/rescue/rpx/tests.rs similarity index 100% rename from src/hash/rescue/rpx/tests.rs rename to miden-crypto/src/hash/rescue/rpx/tests.rs diff --git a/src/hash/rescue/tests.rs b/miden-crypto/src/hash/rescue/tests.rs similarity index 100% rename from src/hash/rescue/tests.rs rename to miden-crypto/src/hash/rescue/tests.rs diff --git a/src/lib.rs b/miden-crypto/src/lib.rs similarity index 100% rename from src/lib.rs rename to miden-crypto/src/lib.rs diff --git a/src/main.rs b/miden-crypto/src/main.rs similarity index 100% rename from src/main.rs rename to miden-crypto/src/main.rs diff --git a/src/merkle/empty_roots.rs b/miden-crypto/src/merkle/empty_roots.rs similarity index 100% rename from src/merkle/empty_roots.rs rename to miden-crypto/src/merkle/empty_roots.rs diff --git a/src/merkle/error.rs b/miden-crypto/src/merkle/error.rs similarity index 100% rename from src/merkle/error.rs rename to miden-crypto/src/merkle/error.rs diff --git a/src/merkle/index.rs b/miden-crypto/src/merkle/index.rs similarity index 100% rename from src/merkle/index.rs rename to miden-crypto/src/merkle/index.rs diff --git a/src/merkle/merkle_tree.rs b/miden-crypto/src/merkle/merkle_tree.rs similarity index 100% rename from src/merkle/merkle_tree.rs rename to miden-crypto/src/merkle/merkle_tree.rs diff --git a/src/merkle/mmr/bit.rs b/miden-crypto/src/merkle/mmr/bit.rs similarity index 100% rename from src/merkle/mmr/bit.rs rename to miden-crypto/src/merkle/mmr/bit.rs diff --git a/src/merkle/mmr/delta.rs b/miden-crypto/src/merkle/mmr/delta.rs similarity index 100% rename from src/merkle/mmr/delta.rs rename to miden-crypto/src/merkle/mmr/delta.rs diff --git a/src/merkle/mmr/error.rs b/miden-crypto/src/merkle/mmr/error.rs similarity index 100% rename from src/merkle/mmr/error.rs rename to miden-crypto/src/merkle/mmr/error.rs diff --git a/src/merkle/mmr/full.rs b/miden-crypto/src/merkle/mmr/full.rs similarity index 100% rename from src/merkle/mmr/full.rs rename to miden-crypto/src/merkle/mmr/full.rs diff --git a/src/merkle/mmr/inorder.rs b/miden-crypto/src/merkle/mmr/inorder.rs similarity index 100% rename from src/merkle/mmr/inorder.rs rename to miden-crypto/src/merkle/mmr/inorder.rs diff --git a/src/merkle/mmr/mod.rs b/miden-crypto/src/merkle/mmr/mod.rs similarity index 100% rename from src/merkle/mmr/mod.rs rename to miden-crypto/src/merkle/mmr/mod.rs diff --git a/src/merkle/mmr/partial.rs b/miden-crypto/src/merkle/mmr/partial.rs similarity index 100% rename from src/merkle/mmr/partial.rs rename to miden-crypto/src/merkle/mmr/partial.rs diff --git a/src/merkle/mmr/peaks.rs b/miden-crypto/src/merkle/mmr/peaks.rs similarity index 100% rename from src/merkle/mmr/peaks.rs rename to miden-crypto/src/merkle/mmr/peaks.rs diff --git a/src/merkle/mmr/proof.rs b/miden-crypto/src/merkle/mmr/proof.rs similarity index 100% rename from src/merkle/mmr/proof.rs rename to miden-crypto/src/merkle/mmr/proof.rs diff --git a/src/merkle/mmr/tests.rs b/miden-crypto/src/merkle/mmr/tests.rs similarity index 100% rename from src/merkle/mmr/tests.rs rename to miden-crypto/src/merkle/mmr/tests.rs diff --git a/src/merkle/mod.rs b/miden-crypto/src/merkle/mod.rs similarity index 100% rename from src/merkle/mod.rs rename to miden-crypto/src/merkle/mod.rs diff --git a/src/merkle/node.rs b/miden-crypto/src/merkle/node.rs similarity index 100% rename from src/merkle/node.rs rename to miden-crypto/src/merkle/node.rs diff --git a/src/merkle/partial_mt/mod.rs b/miden-crypto/src/merkle/partial_mt/mod.rs similarity index 100% rename from src/merkle/partial_mt/mod.rs rename to miden-crypto/src/merkle/partial_mt/mod.rs diff --git a/src/merkle/partial_mt/tests.rs b/miden-crypto/src/merkle/partial_mt/tests.rs similarity index 100% rename from src/merkle/partial_mt/tests.rs rename to miden-crypto/src/merkle/partial_mt/tests.rs diff --git a/src/merkle/path.rs b/miden-crypto/src/merkle/path.rs similarity index 100% rename from src/merkle/path.rs rename to miden-crypto/src/merkle/path.rs diff --git a/src/merkle/smt/full/concurrent/mod.rs b/miden-crypto/src/merkle/smt/full/concurrent/mod.rs similarity index 100% rename from src/merkle/smt/full/concurrent/mod.rs rename to miden-crypto/src/merkle/smt/full/concurrent/mod.rs diff --git a/src/merkle/smt/full/concurrent/tests.rs b/miden-crypto/src/merkle/smt/full/concurrent/tests.rs similarity index 100% rename from src/merkle/smt/full/concurrent/tests.rs rename to miden-crypto/src/merkle/smt/full/concurrent/tests.rs diff --git a/src/merkle/smt/full/error.rs b/miden-crypto/src/merkle/smt/full/error.rs similarity index 100% rename from src/merkle/smt/full/error.rs rename to miden-crypto/src/merkle/smt/full/error.rs diff --git a/src/merkle/smt/full/leaf.rs b/miden-crypto/src/merkle/smt/full/leaf.rs similarity index 100% rename from src/merkle/smt/full/leaf.rs rename to miden-crypto/src/merkle/smt/full/leaf.rs diff --git a/src/merkle/smt/full/mod.rs b/miden-crypto/src/merkle/smt/full/mod.rs similarity index 100% rename from src/merkle/smt/full/mod.rs rename to miden-crypto/src/merkle/smt/full/mod.rs diff --git a/src/merkle/smt/full/proof.rs b/miden-crypto/src/merkle/smt/full/proof.rs similarity index 100% rename from src/merkle/smt/full/proof.rs rename to miden-crypto/src/merkle/smt/full/proof.rs diff --git a/src/merkle/smt/full/tests.rs b/miden-crypto/src/merkle/smt/full/tests.rs similarity index 100% rename from src/merkle/smt/full/tests.rs rename to miden-crypto/src/merkle/smt/full/tests.rs diff --git a/src/merkle/smt/mod.rs b/miden-crypto/src/merkle/smt/mod.rs similarity index 100% rename from src/merkle/smt/mod.rs rename to miden-crypto/src/merkle/smt/mod.rs diff --git a/src/merkle/smt/partial.rs b/miden-crypto/src/merkle/smt/partial.rs similarity index 100% rename from src/merkle/smt/partial.rs rename to miden-crypto/src/merkle/smt/partial.rs diff --git a/src/merkle/smt/simple/mod.rs b/miden-crypto/src/merkle/smt/simple/mod.rs similarity index 100% rename from src/merkle/smt/simple/mod.rs rename to miden-crypto/src/merkle/smt/simple/mod.rs diff --git a/src/merkle/smt/simple/tests.rs b/miden-crypto/src/merkle/smt/simple/tests.rs similarity index 100% rename from src/merkle/smt/simple/tests.rs rename to miden-crypto/src/merkle/smt/simple/tests.rs diff --git a/src/merkle/store/mod.rs b/miden-crypto/src/merkle/store/mod.rs similarity index 100% rename from src/merkle/store/mod.rs rename to miden-crypto/src/merkle/store/mod.rs diff --git a/src/merkle/store/tests.rs b/miden-crypto/src/merkle/store/tests.rs similarity index 100% rename from src/merkle/store/tests.rs rename to miden-crypto/src/merkle/store/tests.rs diff --git a/src/rand/mod.rs b/miden-crypto/src/rand/mod.rs similarity index 100% rename from src/rand/mod.rs rename to miden-crypto/src/rand/mod.rs diff --git a/src/rand/rpo.rs b/miden-crypto/src/rand/rpo.rs similarity index 100% rename from src/rand/rpo.rs rename to miden-crypto/src/rand/rpo.rs diff --git a/src/rand/rpx.rs b/miden-crypto/src/rand/rpx.rs similarity index 100% rename from src/rand/rpx.rs rename to miden-crypto/src/rand/rpx.rs diff --git a/src/utils/kv_map.rs b/miden-crypto/src/utils/kv_map.rs similarity index 100% rename from src/utils/kv_map.rs rename to miden-crypto/src/utils/kv_map.rs diff --git a/src/utils/mod.rs b/miden-crypto/src/utils/mod.rs similarity index 100% rename from src/utils/mod.rs rename to miden-crypto/src/utils/mod.rs