From 15bd8cbd130944c3f59eef86568096496556b545 Mon Sep 17 00:00:00 2001 From: illuzen Date: Wed, 27 May 2026 17:12:35 +0900 Subject: [PATCH 01/10] remove unused hash_storage --- substrate/src/lib.rs | 69 +------------------------------------------- 1 file changed, 1 insertion(+), 68 deletions(-) diff --git a/substrate/src/lib.rs b/substrate/src/lib.rs index 5fbc373..3e5e14c 100644 --- a/substrate/src/lib.rs +++ b/substrate/src/lib.rs @@ -18,7 +18,7 @@ use core::{ use p3_field::PrimeCharacteristicRing; use p3_goldilocks::Goldilocks; use qp_poseidon_core::{ - hash_for_circuit, hash_to_bytes, + hash_for_circuit, serialization::{bytes_to_digest, u128_to_quantized_felt, u64_to_felts}, PROOF_NODE_MAX_SIZE_FELTS, }; @@ -173,18 +173,6 @@ impl PoseidonHasher { pub fn hash_for_circuit(x: &[u8]) -> [u8; 32] { hash_for_circuit::(x) } - - /// Hash storage key or value. - /// - /// Decodes the input bytes into `T` and converts to felts according to `ToFelts`. - /// This ensures the hash matches the circuit's expected preimage for type `T`. - pub fn hash_storage(x: &[u8]) -> [u8; 32] { - let t = T::decode(&mut &x[..]) - .expect("Input bytes length or format mismatch for the expected type"); - - let felts = t.to_felts(); - hash_to_bytes(&felts) - } } impl sp_runtime::traits::Hash for PoseidonHasher { @@ -382,61 +370,6 @@ mod tests { let _hash = hash_twice(&felts); } - #[test] - fn test_hash_storage() { - use sp_core::crypto::AccountId32; - - let asset_id = 42_u32; - let transfer_count = 7_u64; - let from_account = AccountId32::new([1u8; 32]); - let to_account = AccountId32::new([2u8; 32]); - let amount = 1_000_000_u128; - - let encoded = - (asset_id, transfer_count, from_account.clone(), to_account.clone(), amount).encode(); - - // The generic type T must match the structure of the encoded data - type TransferKey = (u32, u64, AccountId32, AccountId32, u128); - - let hash = PoseidonHasher::hash_storage::(&encoded); - assert_eq!(hash.len(), 32); - - // Should fail if the input length is incorrect - let invalid_encoded = &encoded[0..encoded.len() - 1]; - - let result = std::panic::catch_unwind(|| { - let _ = PoseidonHasher::hash_storage::(invalid_encoded); - }); - assert!(result.is_err(), "Expected panic due to invalid input length"); - } - - #[test] - fn test_hash_storage_generic() { - // Test with simple u64 - let val = 12345_u64; - let encoded = val.encode(); - let hash = PoseidonHasher::hash_storage::(&encoded); - assert_eq!(hash.len(), 32); - - // Test with tuple - let val_tuple = (1u32, 2u64); - let encoded_tuple = val_tuple.encode(); - let hash_tuple = PoseidonHasher::hash_storage::<(u32, u64)>(&encoded_tuple); - assert_eq!(hash_tuple.len(), 32); - - // Test with u32 - let val_u32 = 12345_u32; - let encoded_u32 = val_u32.encode(); - let hash_u32 = PoseidonHasher::hash_storage::(&encoded_u32); - assert_eq!(hash_u32.len(), 32); - - // Test with Vec - let val_vec = vec![1u32, 2u32, 3u32]; - let encoded_vec = val_vec.encode(); - let hash_vec = PoseidonHasher::hash_storage::>(&encoded_vec); - assert_eq!(hash_vec.len(), 32); - } - #[test] fn test_to_felts_uses_4_felts_for_accounts() { use sp_core::crypto::AccountId32; From 0fa9304e4d5e904fb30cf1446cdfa19fdee1a0ea Mon Sep 17 00:00:00 2001 From: illuzen Date: Wed, 27 May 2026 20:14:40 +0900 Subject: [PATCH 02/10] remove substrate package --- .github/workflows/create-release-proposal.yml | 7 +- .../create-release-tag-and-publish.yml | 10 - Cargo.lock | 4155 ++--------------- Cargo.toml | 19 +- core/Cargo.toml | 2 - core/benches/poseidon_benchmarks.rs | 10 +- substrate/Cargo.toml | 54 - substrate/README.md | 68 - substrate/src/lib.rs | 392 -- 9 files changed, 476 insertions(+), 4241 deletions(-) delete mode 100644 substrate/Cargo.toml delete mode 100644 substrate/README.md delete mode 100644 substrate/src/lib.rs diff --git a/.github/workflows/create-release-proposal.yml b/.github/workflows/create-release-proposal.yml index a3cffe3..ee53d45 100644 --- a/.github/workflows/create-release-proposal.yml +++ b/.github/workflows/create-release-proposal.yml @@ -162,11 +162,8 @@ jobs: # Replace only the version number, keeping everything else intact sed -i -E 's/(qp-poseidon-core = \{ version = ")[0-9]+\.[0-9]+\.[0-9]+(")/\1'"$new_cargo_version"'\2/' Cargo.toml - # Update Cargo.lock for all workspace packages - # The path dependency in workspace.dependencies ensures local resolution - cargo update \ - --package qp-poseidon-core \ - --package qp-poseidon + # Update Cargo.lock for the workspace package + cargo update --package qp-poseidon-core # Commit changes git config user.name "${{ github.actor }}" diff --git a/.github/workflows/create-release-tag-and-publish.yml b/.github/workflows/create-release-tag-and-publish.yml index 8fc419b..d3ecc19 100644 --- a/.github/workflows/create-release-tag-and-publish.yml +++ b/.github/workflows/create-release-tag-and-publish.yml @@ -166,13 +166,3 @@ jobs: run: cargo publish --package qp-poseidon-core --token ${{ secrets.CARGO_REGISTRY_TOKEN }} --allow-dirty env: CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} - - - name: Wait for qp-poseidon-core to be available - run: | - echo "Waiting for qp-poseidon-core to be available on crates.io..." - sleep 30 - - - name: Publish qp-poseidon to crates.io - run: cargo publish --package qp-poseidon --token ${{ secrets.CARGO_REGISTRY_TOKEN }} --allow-dirty - env: - CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} diff --git a/Cargo.lock b/Cargo.lock index 9b3f64d..34d8a14 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,54 +2,6 @@ # It is not intended for manual editing. version = 4 -[[package]] -name = "Inflector" -version = "0.11.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe438c63458706e03479442743baae6c88256498e6431708f6dfc520a26515d3" -dependencies = [ - "lazy_static", - "regex", -] - -[[package]] -name = "addr2line" -version = "0.24.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfbe277e56a376000877090da837660b4427aad530e3028d44e0bffe4f89a1c1" -dependencies = [ - "gimli", -] - -[[package]] -name = "adler2" -version = "2.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa" - -[[package]] -name = "aead" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d122413f284cf2d62fb1b7db97e02edb8cda96d769b16e443a4f6195e35662b0" -dependencies = [ - "crypto-common", - "generic-array", -] - -[[package]] -name = "ahash" -version = "0.8.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a15f179cd60c4584b8a8c596927aadc462e27f2ca70c04e0071964a73ba7a75" -dependencies = [ - "cfg-if", - "getrandom 0.3.3", - "once_cell", - "version_check", - "zerocopy", -] - [[package]] name = "aho-corasick" version = "1.1.3" @@ -59,12 +11,6 @@ dependencies = [ "memchr", ] -[[package]] -name = "allocator-api2" -version = "0.2.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" - [[package]] name = "anes" version = "0.1.6" @@ -80,21 +26,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "anstream" -version = "0.6.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ae563653d1938f79b1ab1b5e668c87c76a9930414574a6583a7b7e11a8e6192" -dependencies = [ - "anstyle", - "anstyle-parse", - "anstyle-query", - "anstyle-wincon", - "colorchoice", - "is_terminal_polyfill", - "utf8parse", -] - [[package]] name = "anstyle" version = "1.0.11" @@ -102,3642 +33,827 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "862ed96ca487e809f1c8e5a8447f6ee2cf102f846893800b20cebdf541fc6bbd" [[package]] -name = "anstyle-parse" -version = "0.2.7" +name = "atty" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e7644824f0aa2c7b9384579234ef10eb7efb6a0deb83f9630a49594dd9c15c2" +checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" dependencies = [ - "utf8parse", + "hermit-abi 0.1.19", + "libc", + "winapi", ] [[package]] -name = "anstyle-query" -version = "1.1.4" +name = "autocfg" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e231f6134f61b71076a3eab506c379d4f36122f2af15a9ff04415ea4c3339e2" -dependencies = [ - "windows-sys 0.60.2", -] +checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" [[package]] -name = "anstyle-wincon" -version = "3.0.10" +name = "bitflags" +version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e0633414522a32ffaac8ac6cc8f748e090c5717661fddeea04219e2344f5f2a" -dependencies = [ - "anstyle", - "once_cell_polyfill", - "windows-sys 0.60.2", -] +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] -name = "anyhow" -version = "1.0.100" +name = "bitflags" +version = "2.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a23eb6b1614318a8071c9b2521f36b424b2c83db5eb3a0fead4a6c0809af6e61" +checksum = "2261d10cca569e4643e526d8dc2e62e433cc8aba21ab764233731f8d369bf394" [[package]] -name = "ark-bls12-377" -version = "0.4.0" +name = "block2" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb00293ba84f51ce3bd026bd0de55899c4e68f0a39a5728cebae3a73ffdc0a4f" +checksum = "cdeb9d870516001442e364c5220d3574d2da8dc765554b4a617230d33fa58ef5" dependencies = [ - "ark-ec 0.4.2", - "ark-ff 0.4.2", - "ark-std 0.4.0", + "objc2", ] [[package]] -name = "ark-bls12-381" -version = "0.4.0" +name = "bumpalo" +version = "3.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c775f0d12169cba7aae4caeb547bb6a50781c7449a8aa53793827c9ec4abf488" -dependencies = [ - "ark-ec 0.4.2", - "ark-ff 0.4.2", - "ark-serialize 0.4.2", - "ark-std 0.4.0", -] +checksum = "46c5e41b57b8bba42a04676d81cb89e9ee8e859a1a66f80a5a72e1cb76b34d43" [[package]] -name = "ark-bls12-381" -version = "0.5.0" +name = "cast" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3df4dcc01ff89867cd86b0da835f23c3f02738353aaee7dde7495af71363b8d5" -dependencies = [ - "ark-ec 0.5.0", - "ark-ff 0.5.0", - "ark-serialize 0.5.0", - "ark-std 0.5.0", -] +checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" [[package]] -name = "ark-ec" -version = "0.4.2" +name = "cfg-if" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "defd9a439d56ac24968cca0571f598a61bc8c55f71d50a89cda591cb750670ba" -dependencies = [ - "ark-ff 0.4.2", - "ark-poly 0.4.2", - "ark-serialize 0.4.2", - "ark-std 0.4.0", - "derivative", - "hashbrown 0.13.2", - "itertools 0.10.5", - "num-traits", - "zeroize", -] +checksum = "2fd1289c04a9ea8cb22300a459a72a385d7c73d3259e2ed7dcb2af674838cfa9" [[package]] -name = "ark-ec" -version = "0.5.0" +name = "cfg_aliases" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43d68f2d516162846c1238e755a7c4d131b892b70cc70c471a8e3ca3ed818fce" -dependencies = [ - "ahash", - "ark-ff 0.5.0", - "ark-poly 0.5.0", - "ark-serialize 0.5.0", - "ark-std 0.5.0", - "educe", - "fnv", - "hashbrown 0.15.5", - "itertools 0.13.0", - "num-bigint", - "num-integer", - "num-traits", - "zeroize", -] +checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" [[package]] -name = "ark-ed-on-bls12-381-bandersnatch" -version = "0.5.0" +name = "ciborium" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1786b2e3832f6f0f7c8d62d5d5a282f6952a1ab99981c54cd52b6ac1d8f02df5" +checksum = "42e69ffd6f0917f5c029256a24d0161db17cea3997d185db0d35926308770f0e" dependencies = [ - "ark-bls12-381 0.5.0", - "ark-ec 0.5.0", - "ark-ff 0.5.0", - "ark-std 0.5.0", + "ciborium-io", + "ciborium-ll", + "serde", ] [[package]] -name = "ark-ff" -version = "0.4.2" +name = "ciborium-io" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05afea1e0a06c9be33d539b876f1ce3692f4afea2cb41f740e7743225ed1c757" + +[[package]] +name = "ciborium-ll" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec847af850f44ad29048935519032c33da8aa03340876d351dfab5660d2966ba" +checksum = "57663b653d948a338bfb3eeba9bb2fd5fcfaecb9e199e87e1eda4d9e8b240fd9" dependencies = [ - "ark-ff-asm 0.4.2", - "ark-ff-macros 0.4.2", - "ark-serialize 0.4.2", - "ark-std 0.4.0", - "derivative", - "digest 0.10.7", - "itertools 0.10.5", - "num-bigint", - "num-traits", - "paste", - "rustc_version", - "zeroize", + "ciborium-io", + "half", ] [[package]] -name = "ark-ff" -version = "0.5.0" +name = "clap" +version = "2.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a177aba0ed1e0fbb62aa9f6d0502e9b46dad8c2eab04c14258a1212d2557ea70" +checksum = "a0610544180c38b88101fecf2dd634b174a62eef6946f84dfc6a7127512b381c" dependencies = [ - "ark-ff-asm 0.5.0", - "ark-ff-macros 0.5.0", - "ark-serialize 0.5.0", - "ark-std 0.5.0", - "arrayvec", - "digest 0.10.7", - "educe", - "itertools 0.13.0", - "num-bigint", - "num-traits", - "paste", - "zeroize", + "ansi_term", + "atty", + "bitflags 1.3.2", + "strsim", + "textwrap", + "unicode-width", + "vec_map", ] [[package]] -name = "ark-ff-asm" -version = "0.4.2" +name = "clap" +version = "4.5.48" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ed4aa4fe255d0bc6d79373f7e31d2ea147bcf486cba1be5ba7ea85abdb92348" +checksum = "e2134bb3ea021b78629caa971416385309e0131b351b25e01dc16fb54e1b5fae" dependencies = [ - "quote", - "syn 1.0.109", + "clap_builder", ] [[package]] -name = "ark-ff-asm" -version = "0.5.0" +name = "clap_builder" +version = "4.5.48" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62945a2f7e6de02a31fe400aa489f0e0f5b2502e69f95f853adb82a96c7a6b60" +checksum = "c2ba64afa3c0a6df7fa517765e31314e983f51dda798ffba27b988194fb65dc9" dependencies = [ - "quote", - "syn 2.0.106", + "anstyle", + "clap_lex", ] [[package]] -name = "ark-ff-macros" -version = "0.4.2" +name = "clap_lex" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b94f61472cee1439c0b966b47e3aca9ae07e45d070759512cd390ea2bebc6675" + +[[package]] +name = "criterion" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7abe79b0e4288889c4574159ab790824d0033b9fdcb2a112a3182fac2e514565" +checksum = "f2b12d017a929603d80db1831cd3a24082f8137ce19c69e6447f54f5fc8d692f" dependencies = [ - "num-bigint", + "anes", + "cast", + "ciborium", + "clap 4.5.48", + "criterion-plot", + "is-terminal", + "itertools 0.10.5", "num-traits", - "proc-macro2", - "quote", - "syn 1.0.109", + "once_cell", + "oorandom", + "plotters", + "rayon", + "regex", + "serde", + "serde_derive", + "serde_json", + "tinytemplate", + "walkdir", ] [[package]] -name = "ark-ff-macros" +name = "criterion-plot" version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09be120733ee33f7693ceaa202ca41accd5653b779563608f1234f78ae07c4b3" +checksum = "6b50826342786a51a89e2da3a28f1c32b06e387201bc2d19791f622c673706b1" dependencies = [ - "num-bigint", - "num-traits", - "proc-macro2", - "quote", - "syn 2.0.106", + "cast", + "itertools 0.10.5", ] [[package]] -name = "ark-poly" -version = "0.4.2" +name = "crossbeam-deque" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d320bfc44ee185d899ccbadfa8bc31aab923ce1558716e1997a1e74057fe86bf" +checksum = "9dd111b7b7f7d55b72c0a6ae361660ee5853c9af73f70c3c2ef6858b950e2e51" dependencies = [ - "ark-ff 0.4.2", - "ark-serialize 0.4.2", - "ark-std 0.4.0", - "derivative", - "hashbrown 0.13.2", + "crossbeam-epoch", + "crossbeam-utils", ] [[package]] -name = "ark-poly" -version = "0.5.0" +name = "crossbeam-epoch" +version = "0.9.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "579305839da207f02b89cd1679e50e67b4331e2f9294a57693e5051b7703fe27" +checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" dependencies = [ - "ahash", - "ark-ff 0.5.0", - "ark-serialize 0.5.0", - "ark-std 0.5.0", - "educe", - "fnv", - "hashbrown 0.15.5", + "crossbeam-utils", ] [[package]] -name = "ark-serialize" -version = "0.4.2" +name = "crossbeam-utils" +version = "0.8.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adb7b85a02b83d2f22f89bd5cac66c9c89474240cb6207cb1efc16d098e822a5" -dependencies = [ - "ark-serialize-derive 0.4.2", - "ark-std 0.4.0", - "digest 0.10.7", - "num-bigint", -] +checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" [[package]] -name = "ark-serialize" -version = "0.5.0" +name = "crunchy" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f4d068aaf107ebcd7dfb52bc748f8030e0fc930ac8e360146ca54c1203088f7" -dependencies = [ - "ark-serialize-derive 0.5.0", - "ark-std 0.5.0", - "arrayvec", - "digest 0.10.7", - "num-bigint", -] +checksum = "460fbee9c2c2f33933d720630a6a0bac33ba7053db5344fac858d4b8952d77d5" [[package]] -name = "ark-serialize-derive" -version = "0.4.2" +name = "ctrlc" +version = "3.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae3281bc6d0fd7e549af32b52511e1302185bd688fd3359fa36423346ff682ea" +checksum = "73736a89c4aff73035ba2ed2e565061954da00d4970fc9ac25dcc85a2a20d790" dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", + "dispatch2", + "nix", + "windows-sys 0.61.0", ] [[package]] -name = "ark-serialize-derive" -version = "0.5.0" +name = "dispatch2" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "213888f660fddcca0d257e88e54ac05bca01885f258ccdf695bafd77031bb69d" +checksum = "1e0e367e4e7da84520dedcac1901e4da967309406d1e51017ae1abfb97adbd38" dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.106", + "bitflags 2.9.4", + "block2", + "libc", + "objc2", ] [[package]] -name = "ark-std" -version = "0.4.0" +name = "dudect-bencher" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94893f1e0c6eeab764ade8dc4c0db24caf4fe7cbbaafc0eba0a9030f447b5185" +checksum = "b5d065e1eac4fe9b4313fe81f692c7f589ce7b431719296a3392b85af4b73d38" dependencies = [ - "num-traits", + "clap 2.34.0", + "ctrlc", "rand 0.8.5", + "rand_chacha 0.3.1", ] [[package]] -name = "ark-std" -version = "0.5.0" +name = "either" +version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "246a225cc6131e9ee4f24619af0f19d67761fff15d7ccc22e42b80846e69449a" -dependencies = [ - "num-traits", - "rand 0.8.5", -] +checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" [[package]] -name = "ark-transcript" -version = "0.0.3" +name = "getrandom" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47c1c928edb9d8ff24cb5dcb7651d3a98494fff3099eee95c2404cd813a9139f" +checksum = "ff2abc00be7fca6ebc474524697ae276ad847ad0a6b3faa4bcb027e9a4614ad0" dependencies = [ - "ark-ff 0.5.0", - "ark-serialize 0.5.0", - "ark-std 0.5.0", - "digest 0.10.7", - "rand_core 0.6.4", - "sha3", + "cfg-if", + "libc", + "wasi", ] [[package]] -name = "ark-vrf" -version = "0.1.0" +name = "half" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9501da18569b2afe0eb934fb7afd5a247d238b94116155af4dd068f319adfe6d" +checksum = "459196ed295495a68f7d7fe1d84f6c4b7ff0e21fe3017b2f283c6fac3ad803c9" dependencies = [ - "ark-bls12-381 0.5.0", - "ark-ec 0.5.0", - "ark-ed-on-bls12-381-bandersnatch", - "ark-ff 0.5.0", - "ark-serialize 0.5.0", - "ark-std 0.5.0", - "digest 0.10.7", - "rand_chacha 0.3.1", - "sha2 0.10.9", - "w3f-ring-proof", - "zeroize", + "cfg-if", + "crunchy", ] [[package]] -name = "array-bytes" -version = "6.2.3" +name = "hermit-abi" +version = "0.1.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d5dde061bd34119e902bbb2d9b90c5692635cf59fb91d582c2b68043f1b8293" +checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" +dependencies = [ + "libc", +] [[package]] -name = "arrayref" -version = "0.3.9" +name = "hermit-abi" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76a2e8124351fda1ef8aaaa3bbd7ebbcb486bbcd4225aca0aa0d84bb2db8fecb" +checksum = "fc0fef456e4baa96da950455cd02c081ca953b141298e41db3fc7e36b1da849c" [[package]] -name = "arrayvec" -version = "0.7.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" - -[[package]] -name = "atomic-waker" -version = "1.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" - -[[package]] -name = "atty" -version = "0.2.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" -dependencies = [ - "hermit-abi 0.1.19", - "libc", - "winapi", -] - -[[package]] -name = "autocfg" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" - -[[package]] -name = "backtrace" -version = "0.3.75" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6806a6321ec58106fea15becdad98371e28d92ccbc7c8f1b3b6dd724fe8f1002" -dependencies = [ - "addr2line", - "cfg-if", - "libc", - "miniz_oxide", - "object", - "rustc-demangle", - "windows-targets 0.52.6", -] - -[[package]] -name = "base16ct" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" - -[[package]] -name = "base64" -version = "0.22.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" - -[[package]] -name = "base64ct" -version = "1.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55248b47b0caf0546f7988906588779981c43bb1bc9d0c44087278f80cdb44ba" - -[[package]] -name = "binary-merkle-tree" -version = "16.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95c9f6900c9fd344d53fbdfb36e1343429079d73f4168c8ef48884bf15616dbd" -dependencies = [ - "hash-db", - "log", - "parity-scale-codec", -] - -[[package]] -name = "bip39" -version = "2.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90dbd31c98227229239363921e60fcf5e558e43ec69094d46fc4996f08d1d5bc" -dependencies = [ - "bitcoin_hashes", - "rand 0.8.5", - "rand_core 0.6.4", - "serde", - "unicode-normalization", -] - -[[package]] -name = "bitcoin_hashes" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb18c03d0db0247e147a21a6faafd5a7eb851c743db062de72018b6b7e8e4d16" -dependencies = [ - "hex-conservative", -] - -[[package]] -name = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - -[[package]] -name = "bitflags" -version = "2.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2261d10cca569e4643e526d8dc2e62e433cc8aba21ab764233731f8d369bf394" - -[[package]] -name = "bitvec" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bc2832c24239b0141d5674bb9174f9d68a8b5b3f2753311927c172ca46f7e9c" -dependencies = [ - "funty", - "radium", - "tap", - "wyz", -] - -[[package]] -name = "blake2" -version = "0.10.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46502ad458c9a52b69d4d4d32775c788b7a1b85e8bc9d482d92250fc0e3f8efe" -dependencies = [ - "digest 0.10.7", -] - -[[package]] -name = "blake2b_simd" -version = "1.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06e903a20b159e944f91ec8499fe1e55651480c541ea0a584f5d967c49ad9d99" -dependencies = [ - "arrayref", - "arrayvec", - "constant_time_eq", -] - -[[package]] -name = "block-buffer" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" -dependencies = [ - "generic-array", -] - -[[package]] -name = "block-buffer" -version = "0.10.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" -dependencies = [ - "generic-array", -] - -[[package]] -name = "block2" -version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdeb9d870516001442e364c5220d3574d2da8dc765554b4a617230d33fa58ef5" -dependencies = [ - "objc2", -] - -[[package]] -name = "bounded-collections" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dee8eddd066a8825ec5570528e6880471210fd5d88cb6abbe1cfdd51ca249c33" -dependencies = [ - "jam-codec", - "log", - "parity-scale-codec", - "scale-info", - "serde", -] - -[[package]] -name = "bs58" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf88ba1141d185c399bee5288d850d63b8369520c1eafc32a0430b5b6c287bf4" -dependencies = [ - "tinyvec", -] - -[[package]] -name = "bumpalo" -version = "3.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46c5e41b57b8bba42a04676d81cb89e9ee8e859a1a66f80a5a72e1cb76b34d43" - -[[package]] -name = "byte-slice-cast" -version = "1.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7575182f7272186991736b70173b0ea045398f984bf5ebbb3804736ce1330c9d" - -[[package]] -name = "byteorder" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" - -[[package]] -name = "bytes" -version = "1.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d71b6127be86fdcfddb610f7182ac57211d4b18a3e9c82eb2d17662f2227ad6a" - -[[package]] -name = "cast" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" - -[[package]] -name = "cc" -version = "1.2.38" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80f41ae168f955c12fb8960b057d70d0ca153fb83182b57d86380443527be7e9" -dependencies = [ - "find-msvc-tools", - "shlex", -] - -[[package]] -name = "cfg-if" -version = "1.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fd1289c04a9ea8cb22300a459a72a385d7c73d3259e2ed7dcb2af674838cfa9" - -[[package]] -name = "cfg_aliases" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" - -[[package]] -name = "ciborium" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42e69ffd6f0917f5c029256a24d0161db17cea3997d185db0d35926308770f0e" -dependencies = [ - "ciborium-io", - "ciborium-ll", - "serde", -] - -[[package]] -name = "ciborium-io" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05afea1e0a06c9be33d539b876f1ce3692f4afea2cb41f740e7743225ed1c757" - -[[package]] -name = "ciborium-ll" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57663b653d948a338bfb3eeba9bb2fd5fcfaecb9e199e87e1eda4d9e8b240fd9" -dependencies = [ - "ciborium-io", - "half", -] - -[[package]] -name = "clap" -version = "2.34.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0610544180c38b88101fecf2dd634b174a62eef6946f84dfc6a7127512b381c" -dependencies = [ - "ansi_term", - "atty", - "bitflags 1.3.2", - "strsim", - "textwrap", - "unicode-width", - "vec_map", -] - -[[package]] -name = "clap" -version = "4.5.48" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2134bb3ea021b78629caa971416385309e0131b351b25e01dc16fb54e1b5fae" -dependencies = [ - "clap_builder", -] - -[[package]] -name = "clap_builder" -version = "4.5.48" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2ba64afa3c0a6df7fa517765e31314e983f51dda798ffba27b988194fb65dc9" -dependencies = [ - "anstyle", - "clap_lex", -] - -[[package]] -name = "clap_lex" -version = "0.7.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b94f61472cee1439c0b966b47e3aca9ae07e45d070759512cd390ea2bebc6675" - -[[package]] -name = "colorchoice" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b05b61dc5112cbb17e4b6cd61790d9845d13888356391624cbe7e41efeac1e75" - -[[package]] -name = "common-path" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2382f75942f4b3be3690fe4f86365e9c853c1587d6ee58212cebf6e2a9ccd101" - -[[package]] -name = "const-oid" -version = "0.9.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" - -[[package]] -name = "const_format" -version = "0.2.34" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "126f97965c8ad46d6d9163268ff28432e8f6a1196a55578867832e3049df63dd" -dependencies = [ - "const_format_proc_macros", -] - -[[package]] -name = "const_format_proc_macros" -version = "0.2.34" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d57c2eccfb16dbac1f4e61e206105db5820c9d26c3c472bc17c774259ef7744" -dependencies = [ - "proc-macro2", - "quote", - "unicode-xid", -] - -[[package]] -name = "constant_time_eq" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c74b8349d32d297c9134b8c88677813a227df8f779daa29bfc29c183fe3dca6" - -[[package]] -name = "cpufeatures" -version = "0.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" -dependencies = [ - "libc", -] - -[[package]] -name = "criterion" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2b12d017a929603d80db1831cd3a24082f8137ce19c69e6447f54f5fc8d692f" -dependencies = [ - "anes", - "cast", - "ciborium", - "clap 4.5.48", - "criterion-plot", - "is-terminal", - "itertools 0.10.5", - "num-traits", - "once_cell", - "oorandom", - "plotters", - "rayon", - "regex", - "serde", - "serde_derive", - "serde_json", - "tinytemplate", - "walkdir", -] - -[[package]] -name = "criterion-plot" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b50826342786a51a89e2da3a28f1c32b06e387201bc2d19791f622c673706b1" -dependencies = [ - "cast", - "itertools 0.10.5", -] - -[[package]] -name = "crossbeam-deque" -version = "0.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9dd111b7b7f7d55b72c0a6ae361660ee5853c9af73f70c3c2ef6858b950e2e51" -dependencies = [ - "crossbeam-epoch", - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-epoch" -version = "0.9.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" -dependencies = [ - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-utils" -version = "0.8.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" - -[[package]] -name = "crunchy" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "460fbee9c2c2f33933d720630a6a0bac33ba7053db5344fac858d4b8952d77d5" - -[[package]] -name = "crypto-bigint" -version = "0.5.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" -dependencies = [ - "generic-array", - "rand_core 0.6.4", - "subtle", - "zeroize", -] - -[[package]] -name = "crypto-common" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" -dependencies = [ - "generic-array", - "rand_core 0.6.4", - "typenum", -] - -[[package]] -name = "ctor" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67773048316103656a637612c4a62477603b777d91d9c62ff2290f9cde178fdb" -dependencies = [ - "ctor-proc-macro", - "dtor", -] - -[[package]] -name = "ctor-proc-macro" -version = "0.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2931af7e13dc045d8e9d26afccc6fa115d64e115c9c84b1166288b46f6782c2" - -[[package]] -name = "ctrlc" -version = "3.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73736a89c4aff73035ba2ed2e565061954da00d4970fc9ac25dcc85a2a20d790" -dependencies = [ - "dispatch2", - "nix", - "windows-sys 0.61.0", -] - -[[package]] -name = "curve25519-dalek" -version = "4.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97fb8b7c4503de7d6ae7b42ab72a5a59857b4c937ec27a3d4539dba95b5ab2be" -dependencies = [ - "cfg-if", - "cpufeatures", - "curve25519-dalek-derive", - "digest 0.10.7", - "fiat-crypto", - "rustc_version", - "subtle", - "zeroize", -] - -[[package]] -name = "curve25519-dalek-derive" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.106", -] - -[[package]] -name = "der" -version = "0.7.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7c1832837b905bbfb5101e07cc24c8deddf52f93225eee6ead5f4d63d53ddcb" -dependencies = [ - "const-oid", - "pem-rfc7468", - "zeroize", -] - -[[package]] -name = "deranged" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d630bccd429a5bb5a64b5e94f693bfc48c9f8566418fda4c494cc94f911f87cc" -dependencies = [ - "powerfmt", -] - -[[package]] -name = "derivative" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "derive-syn-parse" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d65d7ce8132b7c0e54497a4d9a55a1c2a0912a0d786cf894472ba818fba45762" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.106", -] - -[[package]] -name = "derive_more" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a9b99b9cbbe49445b21764dc0625032a89b145a2642e67603e1c936f5458d05" -dependencies = [ - "derive_more-impl", -] - -[[package]] -name = "derive_more-impl" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb7330aeadfbe296029522e6c40f315320aba36fc43a5b3632f3795348f3bd22" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.106", -] - -[[package]] -name = "digest" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" -dependencies = [ - "generic-array", -] - -[[package]] -name = "digest" -version = "0.10.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" -dependencies = [ - "block-buffer 0.10.4", - "const-oid", - "crypto-common", - "subtle", -] - -[[package]] -name = "dispatch2" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e0e367e4e7da84520dedcac1901e4da967309406d1e51017ae1abfb97adbd38" -dependencies = [ - "bitflags 2.9.4", - "block2", - "libc", - "objc2", -] - -[[package]] -name = "docify" -version = "0.2.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a772b62b1837c8f060432ddcc10b17aae1453ef17617a99bc07789252d2a5896" -dependencies = [ - "docify_macros", -] - -[[package]] -name = "docify_macros" -version = "0.2.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60e6be249b0a462a14784a99b19bf35a667bb5e09de611738bb7362fa4c95ff7" -dependencies = [ - "common-path", - "derive-syn-parse", - "once_cell", - "proc-macro2", - "quote", - "regex", - "syn 2.0.106", - "termcolor", - "toml", - "walkdir", -] - -[[package]] -name = "dtor" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "404d02eeb088a82cfd873006cb713fe411306c7d182c344905e101fb1167d301" -dependencies = [ - "dtor-proc-macro", -] - -[[package]] -name = "dtor-proc-macro" -version = "0.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f678cf4a922c215c63e0de95eb1ff08a958a81d47e485cf9da1e27bf6305cfa5" - -[[package]] -name = "dudect-bencher" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5d065e1eac4fe9b4313fe81f692c7f589ce7b431719296a3392b85af4b73d38" -dependencies = [ - "clap 2.34.0", - "ctrlc", - "rand 0.8.5", - "rand_chacha 0.3.1", -] - -[[package]] -name = "dyn-clone" -version = "1.0.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0881ea181b1df73ff77ffaaf9c7544ecc11e82fba9b5f27b262a3c73a332555" - -[[package]] -name = "ecdsa" -version = "0.16.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee27f32b5c5292967d2d4a9d7f1e0b0aed2c15daded5a60300e4abb9d8020bca" -dependencies = [ - "der", - "digest 0.10.7", - "elliptic-curve", - "rfc6979", - "serdect", - "signature", - "spki", -] - -[[package]] -name = "ed25519" -version = "2.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "115531babc129696a58c64a4fef0a8bf9e9698629fb97e9e40767d235cfbcd53" -dependencies = [ - "pkcs8", - "signature", -] - -[[package]] -name = "ed25519-dalek" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70e796c081cee67dc755e1a36a0a172b897fab85fc3f6bc48307991f64e4eca9" -dependencies = [ - "curve25519-dalek", - "ed25519", - "serde", - "sha2 0.10.9", - "subtle", - "zeroize", -] - -[[package]] -name = "ed25519-zebra" -version = "4.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0017d969298eec91e3db7a2985a8cab4df6341d86e6f3a6f5878b13fb7846bc9" -dependencies = [ - "curve25519-dalek", - "ed25519", - "hashbrown 0.15.5", - "pkcs8", - "rand_core 0.6.4", - "sha2 0.10.9", - "subtle", - "zeroize", -] - -[[package]] -name = "educe" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d7bc049e1bd8cdeb31b68bbd586a9464ecf9f3944af3958a7a9d0f8b9799417" -dependencies = [ - "enum-ordinalize", - "proc-macro2", - "quote", - "syn 2.0.106", -] - -[[package]] -name = "either" -version = "1.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" - -[[package]] -name = "elliptic-curve" -version = "0.13.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5e6043086bf7973472e0c7dff2142ea0b680d30e18d9cc40f267efbf222bd47" -dependencies = [ - "base16ct", - "crypto-bigint", - "digest 0.10.7", - "ff", - "generic-array", - "group", - "pkcs8", - "rand_core 0.6.4", - "sec1", - "serdect", - "subtle", - "zeroize", -] - -[[package]] -name = "enum-ordinalize" -version = "4.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fea0dcfa4e54eeb516fe454635a95753ddd39acda650ce703031c6973e315dd5" -dependencies = [ - "enum-ordinalize-derive", -] - -[[package]] -name = "enum-ordinalize-derive" -version = "4.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d28318a75d4aead5c4db25382e8ef717932d0346600cacae6357eb5941bc5ff" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.106", -] - -[[package]] -name = "env_filter" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "186e05a59d4c50738528153b83b0b0194d3a29507dfec16eccd4b342903397d0" -dependencies = [ - "log", - "regex", -] - -[[package]] -name = "env_logger" -version = "0.11.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13c863f0904021b108aa8b2f55046443e6b1ebde8fd4a15c399893aae4fa069f" -dependencies = [ - "anstream", - "anstyle", - "env_filter", - "jiff", - "log", -] - -[[package]] -name = "environmental" -version = "1.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e48c92028aaa870e83d51c64e5d4e0b6981b360c522198c23959f219a4e1b15b" - -[[package]] -name = "equivalent" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" - -[[package]] -name = "expander" -version = "2.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2c470c71d91ecbd179935b24170459e926382eaaa86b590b78814e180d8a8e2" -dependencies = [ - "blake2", - "file-guard", - "fs-err", - "prettyplease", - "proc-macro2", - "quote", - "syn 2.0.106", -] - -[[package]] -name = "ff" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0b50bfb653653f9ca9095b427bed08ab8d75a137839d9ad64eb11810d5b6393" -dependencies = [ - "rand_core 0.6.4", - "subtle", -] - -[[package]] -name = "fiat-crypto" -version = "0.2.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28dea519a9695b9977216879a3ebfddf92f1c08c05d984f8996aecd6ecdc811d" - -[[package]] -name = "file-guard" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21ef72acf95ec3d7dbf61275be556299490a245f017cf084bd23b4f68cf9407c" -dependencies = [ - "libc", - "winapi", -] - -[[package]] -name = "find-msvc-tools" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ced73b1dacfc750a6db6c0a0c3a3853c8b41997e2e2c563dc90804ae6867959" - -[[package]] -name = "fixed-hash" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "835c052cb0c08c1acf6ffd71c022172e18723949c8282f2b9f27efbc51e64534" -dependencies = [ - "byteorder", - "rand 0.8.5", - "rustc-hex", - "static_assertions", -] - -[[package]] -name = "fnv" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" - -[[package]] -name = "foldhash" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2" - -[[package]] -name = "fs-err" -version = "2.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88a41f105fe1d5b6b34b2055e3dc59bb79b46b48b2040b9e6c7b4b5de097aa41" -dependencies = [ - "autocfg", -] - -[[package]] -name = "funty" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" - -[[package]] -name = "futures" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65bc07b1a8bc7c85c5f2e110c476c7389b4554ba72af57d8445ea63a576b0876" -dependencies = [ - "futures-channel", - "futures-core", - "futures-executor", - "futures-io", - "futures-sink", - "futures-task", - "futures-util", -] - -[[package]] -name = "futures-channel" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10" -dependencies = [ - "futures-core", - "futures-sink", -] - -[[package]] -name = "futures-core" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" - -[[package]] -name = "futures-executor" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e28d1d997f585e54aebc3f97d39e72338912123a67330d723fdbb564d646c9f" -dependencies = [ - "futures-core", - "futures-task", - "futures-util", - "num_cpus", -] - -[[package]] -name = "futures-io" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6" - -[[package]] -name = "futures-macro" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.106", -] - -[[package]] -name = "futures-sink" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7" - -[[package]] -name = "futures-task" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" - -[[package]] -name = "futures-util" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" -dependencies = [ - "futures-channel", - "futures-core", - "futures-io", - "futures-macro", - "futures-sink", - "futures-task", - "memchr", - "pin-project-lite", - "pin-utils", - "slab", -] - -[[package]] -name = "generic-array" -version = "0.14.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" -dependencies = [ - "typenum", - "version_check", - "zeroize", -] - -[[package]] -name = "getrandom" -version = "0.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff2abc00be7fca6ebc474524697ae276ad847ad0a6b3faa4bcb027e9a4614ad0" -dependencies = [ - "cfg-if", - "libc", - "wasi 0.11.1+wasi-snapshot-preview1", -] - -[[package]] -name = "getrandom" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26145e563e54f2cadc477553f1ec5ee650b00862f0a58bcd12cbdc5f0ea2d2f4" -dependencies = [ - "cfg-if", - "libc", - "r-efi", - "wasi 0.14.7+wasi-0.2.4", -] - -[[package]] -name = "getrandom_or_panic" -version = "0.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ea1015b5a70616b688dc230cfe50c8af89d972cb132d5a622814d29773b10b9" -dependencies = [ - "rand 0.8.5", - "rand_core 0.6.4", -] - -[[package]] -name = "gimli" -version = "0.31.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" - -[[package]] -name = "group" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" -dependencies = [ - "ff", - "rand_core 0.6.4", - "subtle", -] - -[[package]] -name = "h2" -version = "0.4.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3c0b69cfcb4e1b9f1bf2f53f95f766e4661169728ec61cd3fe5a0166f2d1386" -dependencies = [ - "atomic-waker", - "bytes", - "fnv", - "futures-core", - "futures-sink", - "http", - "indexmap", - "slab", - "tokio", - "tokio-util", - "tracing", -] - -[[package]] -name = "half" -version = "2.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "459196ed295495a68f7d7fe1d84f6c4b7ff0e21fe3017b2f283c6fac3ad803c9" -dependencies = [ - "cfg-if", - "crunchy", -] - -[[package]] -name = "hash-db" -version = "0.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e7d7786361d7425ae2fe4f9e407eb0efaa0840f5212d109cc018c40c35c6ab4" - -[[package]] -name = "hash256-std-hasher" -version = "0.15.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92c171d55b98633f4ed3860808f004099b36c1cc29c42cfc53aa8591b21efcf2" -dependencies = [ - "crunchy", -] - -[[package]] -name = "hashbrown" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" -dependencies = [ - "ahash", -] - -[[package]] -name = "hashbrown" -version = "0.15.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9229cfe53dfd69f0609a49f65461bd93001ea1ef889cd5529dd176593f5338a1" -dependencies = [ - "allocator-api2", - "equivalent", - "foldhash", -] - -[[package]] -name = "heck" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" - -[[package]] -name = "hermit-abi" -version = "0.1.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" -dependencies = [ - "libc", -] - -[[package]] -name = "hermit-abi" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc0fef456e4baa96da950455cd02c081ca953b141298e41db3fc7e36b1da849c" - -[[package]] -name = "hex" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" - -[[package]] -name = "hex-conservative" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5313b072ce3c597065a808dbf612c4c8e8590bdbf8b579508bf7a762c5eae6cd" -dependencies = [ - "arrayvec", -] - -[[package]] -name = "hmac" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" -dependencies = [ - "digest 0.10.7", -] - -[[package]] -name = "http" -version = "1.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4a85d31aea989eead29a3aaf9e1115a180df8282431156e533de47660892565" -dependencies = [ - "bytes", - "fnv", - "itoa", -] - -[[package]] -name = "http-body" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" -dependencies = [ - "bytes", - "http", -] - -[[package]] -name = "http-body-util" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b021d93e26becf5dc7e1b75b1bed1fd93124b374ceb73f43d4d4eafec896a64a" -dependencies = [ - "bytes", - "futures-core", - "http", - "http-body", - "pin-project-lite", -] - -[[package]] -name = "httparse" -version = "1.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6dbf3de79e51f3d586ab4cb9d5c3e2c14aa28ed23d180cf89b4df0454a69cc87" - -[[package]] -name = "httpdate" -version = "1.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" - -[[package]] -name = "hyper" -version = "1.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb3aa54a13a0dfe7fbe3a59e0c76093041720fdc77b110cc0fc260fafb4dc51e" -dependencies = [ - "atomic-waker", - "bytes", - "futures-channel", - "futures-core", - "h2", - "http", - "http-body", - "httparse", - "httpdate", - "itoa", - "pin-project-lite", - "pin-utils", - "smallvec", - "tokio", -] - -[[package]] -name = "hyper-util" -version = "0.1.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c6995591a8f1380fcb4ba966a252a4b29188d51d2b89e3a252f5305be65aea8" -dependencies = [ - "bytes", - "futures-core", - "http", - "http-body", - "hyper", - "pin-project-lite", - "tokio", -] - -[[package]] -name = "impl-codec" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d40b9d5e17727407e55028eafc22b2dc68781786e6d7eb8a21103f5058e3a14" -dependencies = [ - "parity-scale-codec", -] - -[[package]] -name = "impl-num-traits" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "803d15461ab0dcc56706adf266158acbc44ccf719bf7d0af30705f58b90a4b8c" -dependencies = [ - "integer-sqrt", - "num-traits", - "uint", -] - -[[package]] -name = "impl-serde" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a143eada6a1ec4aefa5049037a26a6d597bfd64f8c026d07b77133e02b7dd0b" -dependencies = [ - "serde", -] - -[[package]] -name = "impl-trait-for-tuples" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0eb5a3343abf848c0984fe4604b2b105da9539376e24fc0a3b0007411ae4fd9" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.106", -] - -[[package]] -name = "indexmap" -version = "2.11.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b0f83760fb341a774ed326568e19f5a863af4a952def8c39f9ab92fd95b88e5" -dependencies = [ - "equivalent", - "hashbrown 0.15.5", -] - -[[package]] -name = "integer-sqrt" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "276ec31bcb4a9ee45f58bec6f9ec700ae4cf4f4f8f2fa7e06cb406bd5ffdd770" -dependencies = [ - "num-traits", -] - -[[package]] -name = "io-uring" -version = "0.7.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "046fa2d4d00aea763528b4950358d0ead425372445dc8ff86312b3c69ff7727b" -dependencies = [ - "bitflags 2.9.4", - "cfg-if", - "libc", -] - -[[package]] -name = "is-terminal" -version = "0.4.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e04d7f318608d35d4b61ddd75cbdaee86b023ebe2bd5a66ee0915f0bf93095a9" -dependencies = [ - "hermit-abi 0.5.2", - "libc", - "windows-sys 0.59.0", -] - -[[package]] -name = "is_terminal_polyfill" -version = "1.70.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" - -[[package]] -name = "itertools" -version = "0.10.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" -dependencies = [ - "either", -] - -[[package]] -name = "itertools" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1c173a5686ce8bfa551b3563d0c2170bf24ca44da99c7ca4bfdab5418c3fe57" -dependencies = [ - "either", -] - -[[package]] -name = "itertools" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" -dependencies = [ - "either", -] - -[[package]] -name = "itertools" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b192c782037fadd9cfa75548310488aabdbf3d2da73885b31bd0abd03351285" -dependencies = [ - "either", -] - -[[package]] -name = "itoa" -version = "1.0.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" - -[[package]] -name = "jam-codec" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb948eace373d99de60501a02fb17125d30ac632570de20dccc74370cdd611b9" -dependencies = [ - "arrayvec", - "bitvec", - "byte-slice-cast", - "const_format", - "impl-trait-for-tuples", - "jam-codec-derive", - "rustversion", - "serde", -] - -[[package]] -name = "jam-codec-derive" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "319af585c4c8a6b5552a52b7787a1ab3e4d59df7614190b1f85b9b842488789d" -dependencies = [ - "proc-macro-crate", - "proc-macro2", - "quote", - "syn 2.0.106", -] - -[[package]] -name = "jiff" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be1f93b8b1eb69c77f24bbb0afdf66f54b632ee39af40ca21c4365a1d7347e49" -dependencies = [ - "jiff-static", - "log", - "portable-atomic", - "portable-atomic-util", - "serde", -] - -[[package]] -name = "jiff-static" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03343451ff899767262ec32146f6d559dd759fdadf42ff0e227c7c48f72594b4" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.106", -] - -[[package]] -name = "js-sys" -version = "0.3.80" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "852f13bec5eba4ba9afbeb93fd7c13fe56147f055939ae21c43a29a0ecb2702e" -dependencies = [ - "once_cell", - "wasm-bindgen", -] - -[[package]] -name = "k256" -version = "0.13.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6e3919bbaa2945715f0bb6d3934a173d1e9a59ac23767fbaaef277265a7411b" -dependencies = [ - "cfg-if", - "ecdsa", - "elliptic-curve", - "once_cell", - "serdect", - "sha2 0.10.9", -] - -[[package]] -name = "keccak" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecc2af9a1119c51f12a14607e783cb977bde58bc069ff0c3da1095e635d70654" -dependencies = [ - "cpufeatures", -] - -[[package]] -name = "lazy_static" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" - -[[package]] -name = "libc" -version = "0.2.175" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a82ae493e598baaea5209805c49bbf2ea7de956d50d7da0da1164f9c6d28543" - -[[package]] -name = "libsecp256k1" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e79019718125edc905a079a70cfa5f3820bc76139fc91d6f9abc27ea2a887139" -dependencies = [ - "arrayref", - "base64", - "digest 0.9.0", - "libsecp256k1-core", - "libsecp256k1-gen-ecmult", - "libsecp256k1-gen-genmult", - "rand 0.8.5", - "serde", - "sha2 0.9.9", -] - -[[package]] -name = "libsecp256k1-core" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5be9b9bb642d8522a44d533eab56c16c738301965504753b03ad1de3425d5451" -dependencies = [ - "crunchy", - "digest 0.9.0", - "subtle", -] - -[[package]] -name = "libsecp256k1-gen-ecmult" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3038c808c55c87e8a172643a7d87187fc6c4174468159cb3090659d55bcb4809" -dependencies = [ - "libsecp256k1-core", -] - -[[package]] -name = "libsecp256k1-gen-genmult" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3db8d6ba2cec9eacc40e6e8ccc98931840301f1006e95647ceb2dd5c3aa06f7c" -dependencies = [ - "libsecp256k1-core", -] - -[[package]] -name = "lock_api" -version = "0.4.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96936507f153605bddfcda068dd804796c84324ed2510809e5b2a624c81da765" -dependencies = [ - "autocfg", - "scopeguard", -] - -[[package]] -name = "log" -version = "0.4.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34080505efa8e45a4b816c349525ebe327ceaa8559756f0356cba97ef3bf7432" - -[[package]] -name = "matchers" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558" -dependencies = [ - "regex-automata 0.1.10", -] - -[[package]] -name = "memchr" -version = "2.7.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32a282da65faaf38286cf3be983213fcf1d2e2a58700e808f83f4ea9a4804bc0" - -[[package]] -name = "memory-db" -version = "0.34.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e300c54e3239a86f9c61cc63ab0f03862eb40b1c6e065dc6fd6ceaeff6da93d" -dependencies = [ - "foldhash", - "hash-db", - "hashbrown 0.15.5", -] - -[[package]] -name = "merlin" -version = "3.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58c38e2799fc0978b65dfff8023ec7843e2330bb462f19198840b34b6582397d" -dependencies = [ - "byteorder", - "keccak", - "rand_core 0.6.4", - "zeroize", -] - -[[package]] -name = "miniz_oxide" -version = "0.8.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fa76a2c86f704bdb222d66965fb3d63269ce38518b83cb0575fca855ebb6316" -dependencies = [ - "adler2", -] - -[[package]] -name = "mio" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78bed444cc8a2160f01cbcf811ef18cac863ad68ae8ca62092e8db51d51c761c" -dependencies = [ - "libc", - "wasi 0.11.1+wasi-snapshot-preview1", - "windows-sys 0.59.0", -] - -[[package]] -name = "nix" -version = "0.30.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74523f3a35e05aba87a1d978330aef40f67b0304ac79c1c00b294c9830543db6" -dependencies = [ - "bitflags 2.9.4", - "cfg-if", - "cfg_aliases", - "libc", -] - -[[package]] -name = "nohash-hasher" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bf50223579dc7cdcfb3bfcacf7069ff68243f8c363f62ffa99cf000a6b9c451" - -[[package]] -name = "nu-ansi-term" -version = "0.46.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84" -dependencies = [ - "overload", - "winapi", -] - -[[package]] -name = "num-bigint" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9" -dependencies = [ - "num-integer", - "num-traits", -] - -[[package]] -name = "num-conv" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" - -[[package]] -name = "num-format" -version = "0.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a652d9771a63711fd3c3deb670acfbe5c30a4072e664d7a3bf5a9e1056ac72c3" -dependencies = [ - "arrayvec", - "itoa", -] - -[[package]] -name = "num-integer" -version = "0.1.46" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" -dependencies = [ - "num-traits", -] - -[[package]] -name = "num-traits" -version = "0.2.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" -dependencies = [ - "autocfg", -] - -[[package]] -name = "num_cpus" -version = "1.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91df4bbde75afed763b708b7eee1e8e7651e02d97f6d5dd763e89367e957b23b" -dependencies = [ - "hermit-abi 0.5.2", - "libc", -] - -[[package]] -name = "objc2" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a12a8ed07aefc768292f076dc3ac8c48f3781c8f2d5851dd3d98950e8c5a89f" -dependencies = [ - "objc2-encode", -] - -[[package]] -name = "objc2-encode" -version = "4.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef25abbcd74fb2609453eb695bd2f860d389e457f67dc17cafc8b8cbc89d0c33" - -[[package]] -name = "object" -version = "0.36.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62948e14d923ea95ea2c7c86c71013138b66525b86bdc08d2dcc262bdb497b87" -dependencies = [ - "memchr", -] - -[[package]] -name = "once_cell" -version = "1.21.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" - -[[package]] -name = "once_cell_polyfill" -version = "1.70.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4895175b425cb1f87721b59f0f286c2092bd4af812243672510e1ac53e2e0ad" - -[[package]] -name = "oorandom" -version = "11.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6790f58c7ff633d8771f42965289203411a5e5c68388703c06e14f24770b41e" - -[[package]] -name = "opaque-debug" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c08d65885ee38876c4f86fa503fb49d7b507c2b62552df7c70b2fce627e06381" - -[[package]] -name = "overload" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" - -[[package]] -name = "p3-dft" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3b2764a3982d22d62aa933c8de6f9d71d8a474c9110b69e675dea1887bdeffc" -dependencies = [ - "itertools 0.14.0", - "p3-field", - "p3-matrix", - "p3-maybe-rayon", - "p3-util", - "tracing", -] - -[[package]] -name = "p3-field" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc13a73509fe09c67b339951ca8d4cc6e61c9bf08c130dbc90dda52452918cc2" -dependencies = [ - "itertools 0.14.0", - "num-bigint", - "p3-maybe-rayon", - "p3-util", - "paste", - "rand 0.9.2", - "serde", - "tracing", -] - -[[package]] -name = "p3-goldilocks" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "552849f6309ffde34af0d31aa9a2d0a549cb0ec138d9792bfbf4a17800742362" -dependencies = [ - "num-bigint", - "p3-dft", - "p3-field", - "p3-mds", - "p3-poseidon2", - "p3-symmetric", - "p3-util", - "paste", - "rand 0.9.2", - "serde", -] - -[[package]] -name = "p3-matrix" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8e1e9f69c2fe15768b3ceb2915edb88c47398aa22c485d8163deab2a47fe194" -dependencies = [ - "itertools 0.14.0", - "p3-field", - "p3-maybe-rayon", - "p3-util", - "rand 0.9.2", - "serde", - "tracing", - "transpose", -] - -[[package]] -name = "p3-maybe-rayon" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33f765046b763d046728b3246b690f81dfa7ccd7523b7a1582c74f616fbce6a0" - -[[package]] -name = "p3-mds" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c90541c6056712daf2ee69ec328db8b5605ae8dbafe60226c8eb75eaac0e1f9" -dependencies = [ - "p3-dft", - "p3-field", - "p3-symmetric", - "p3-util", - "rand 0.9.2", -] - -[[package]] -name = "p3-poseidon2" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88e9f053f120a78ad27e9c1991a0ea547777328ca24025c42364d6ee2667d59a" -dependencies = [ - "p3-field", - "p3-mds", - "p3-symmetric", - "p3-util", - "rand 0.9.2", -] - -[[package]] -name = "p3-symmetric" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72d5db8f05a26d706dfd8aaf7aa4272ca4f3e7a075db897ec7108f24fad78759" -dependencies = [ - "itertools 0.14.0", - "p3-field", - "serde", -] - -[[package]] -name = "p3-util" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6dfee67245d9ce78a15176728da2280032f0a84b5819a39a953e7ec03cfd9bd7" -dependencies = [ - "serde", -] - -[[package]] -name = "parity-scale-codec" -version = "3.7.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "799781ae679d79a948e13d4824a40970bfa500058d245760dd857301059810fa" -dependencies = [ - "arrayvec", - "bitvec", - "byte-slice-cast", - "bytes", - "const_format", - "impl-trait-for-tuples", - "parity-scale-codec-derive", - "rustversion", - "serde", -] - -[[package]] -name = "parity-scale-codec-derive" -version = "3.7.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34b4653168b563151153c9e4c08ebed57fb8262bebfa79711552fa983c623e7a" -dependencies = [ - "proc-macro-crate", - "proc-macro2", - "quote", - "syn 2.0.106", -] - -[[package]] -name = "parking_lot" -version = "0.12.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70d58bf43669b5795d1576d0641cfb6fbb2057bf629506267a92807158584a13" -dependencies = [ - "lock_api", - "parking_lot_core", -] - -[[package]] -name = "parking_lot_core" -version = "0.9.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc838d2a56b5b1a6c25f55575dfc605fabb63bb2365f6c2353ef9159aa69e4a5" -dependencies = [ - "cfg-if", - "libc", - "redox_syscall", - "smallvec", - "windows-targets 0.52.6", -] - -[[package]] -name = "password-hash" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "346f04948ba92c43e8469c1ee6736c7563d71012b17d40745260fe106aac2166" -dependencies = [ - "base64ct", - "rand_core 0.6.4", - "subtle", -] - -[[package]] -name = "paste" -version = "1.0.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" - -[[package]] -name = "pbkdf2" -version = "0.12.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8ed6a7761f76e3b9f92dfb0a60a6a6477c61024b775147ff0973a02653abaf2" -dependencies = [ - "digest 0.10.7", - "password-hash", -] - -[[package]] -name = "pem-rfc7468" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88b39c9bfcfc231068454382784bb460aae594343fb030d46e9f50a645418412" -dependencies = [ - "base64ct", -] - -[[package]] -name = "pin-project-lite" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b" - -[[package]] -name = "pin-utils" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" - -[[package]] -name = "pkcs8" -version = "0.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" -dependencies = [ - "der", - "spki", -] - -[[package]] -name = "plotters" -version = "0.3.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5aeb6f403d7a4911efb1e33402027fc44f29b5bf6def3effcc22d7bb75f2b747" -dependencies = [ - "num-traits", - "plotters-backend", - "plotters-svg", - "wasm-bindgen", - "web-sys", -] - -[[package]] -name = "plotters-backend" -version = "0.3.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df42e13c12958a16b3f7f4386b9ab1f3e7933914ecea48da7139435263a4172a" - -[[package]] -name = "plotters-svg" -version = "0.3.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51bae2ac328883f7acdfea3d66a7c35751187f870bc81f94563733a154d7a670" -dependencies = [ - "plotters-backend", -] - -[[package]] -name = "polkavm-common" -version = "0.26.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49a5794b695626ba70d29e66e3f4f4835767452a6723f3a0bc20884b07088fe8" - -[[package]] -name = "polkavm-derive" -version = "0.26.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95282a203ae1f6828a04ff334145c3f6dc718bba6d3959805d273358b45eab93" -dependencies = [ - "polkavm-derive-impl-macro", -] - -[[package]] -name = "polkavm-derive-impl" -version = "0.26.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6069dc7995cde6e612b868a02ce48b54397c6d2582bd1b97b63aabbe962cd779" -dependencies = [ - "polkavm-common", - "proc-macro2", - "quote", - "syn 2.0.106", -] - -[[package]] -name = "polkavm-derive-impl-macro" -version = "0.26.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "581d34cafec741dc5ffafbb341933c205b6457f3d76257a9d99fb56687219c91" -dependencies = [ - "polkavm-derive-impl", - "syn 2.0.106", -] - -[[package]] -name = "portable-atomic" -version = "1.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f84267b20a16ea918e43c6a88433c2d54fa145c92a811b5b047ccbe153674483" - -[[package]] -name = "portable-atomic-util" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8a2f0d8d040d7848a709caf78912debcc3f33ee4b3cac47d73d1e1069e83507" -dependencies = [ - "portable-atomic", -] - -[[package]] -name = "powerfmt" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" - -[[package]] -name = "ppv-lite86" -version = "0.2.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" -dependencies = [ - "zerocopy", -] - -[[package]] -name = "prettyplease" -version = "0.2.37" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "479ca8adacdd7ce8f1fb39ce9ecccbfe93a3f1344b3d0d97f20bc0196208f62b" -dependencies = [ - "proc-macro2", - "syn 2.0.106", -] - -[[package]] -name = "primitive-types" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d15600a7d856470b7d278b3fe0e311fe28c2526348549f8ef2ff7db3299c87f5" -dependencies = [ - "fixed-hash", - "impl-codec", - "impl-num-traits", - "impl-serde", - "scale-info", - "uint", -] - -[[package]] -name = "proc-macro-crate" -version = "3.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "219cb19e96be00ab2e37d6e299658a0cfa83e52429179969b0f0121b4ac46983" -dependencies = [ - "toml_edit 0.23.6", -] - -[[package]] -name = "proc-macro2" -version = "1.0.101" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89ae43fd86e4158d6db51ad8e2b80f313af9cc74f5c0e03ccb87de09998732de" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "prometheus" -version = "0.13.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d33c28a30771f7f96db69893f78b857f7450d7e0237e9c8fc6427a81bae7ed1" -dependencies = [ - "cfg-if", - "fnv", - "lazy_static", - "memchr", - "parking_lot", - "thiserror", -] - -[[package]] -name = "qp-poseidon" -version = "1.5.0" -dependencies = [ - "ctor", - "env_logger", - "hex", - "log", - "p3-field", - "p3-goldilocks", - "parity-scale-codec", - "qp-poseidon-constants", - "qp-poseidon-core", - "scale-info", - "serde", - "sp-core", - "sp-runtime", - "sp-storage", - "sp-trie", -] - -[[package]] -name = "qp-poseidon-constants" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "300d8b01e4a492b202e739ab5f73215b261905911020cc0f74a22109365e3bd7" -dependencies = [ - "p3-field", - "p3-goldilocks", - "p3-poseidon2", - "rand 0.9.2", - "rand_chacha 0.9.0", -] - -[[package]] -name = "qp-poseidon-core" -version = "1.5.0" -dependencies = [ - "criterion", - "dudect-bencher", - "hex", - "p3-field", - "p3-goldilocks", - "p3-poseidon2", - "p3-symmetric", - "qp-poseidon-constants", - "rand_chacha 0.9.0", -] - -[[package]] -name = "quote" -version = "1.0.40" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "r-efi" -version = "5.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" - -[[package]] -name = "radium" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" - -[[package]] -name = "rand" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" -dependencies = [ - "libc", - "rand_chacha 0.3.1", - "rand_core 0.6.4", -] - -[[package]] -name = "rand" -version = "0.9.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6db2770f06117d490610c7488547d543617b21bfa07796d7a12f6f1bd53850d1" -dependencies = [ - "rand_core 0.9.3", -] - -[[package]] -name = "rand_chacha" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" -dependencies = [ - "ppv-lite86", - "rand_core 0.6.4", -] - -[[package]] -name = "rand_chacha" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3022b5f1df60f26e1ffddd6c66e8aa15de382ae63b3a0c1bfc0e4d3e3f325cb" -dependencies = [ - "ppv-lite86", - "rand_core 0.9.3", -] - -[[package]] -name = "rand_core" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" -dependencies = [ - "getrandom 0.2.17", -] - -[[package]] -name = "rand_core" -version = "0.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99d9a13982dcf210057a8a78572b2217b667c3beacbf3a0d8b454f6f82837d38" - -[[package]] -name = "rayon" -version = "1.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "368f01d005bf8fd9b1206fb6fa653e6c4a81ceb1466406b81792d87c5677a58f" -dependencies = [ - "either", - "rayon-core", -] - -[[package]] -name = "rayon-core" -version = "1.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22e18b0f0062d30d4230b2e85ff77fdfe4326feb054b9783a3460d8435c8ab91" -dependencies = [ - "crossbeam-deque", - "crossbeam-utils", -] - -[[package]] -name = "redox_syscall" -version = "0.5.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5407465600fb0548f1442edf71dd20683c6ed326200ace4b1ef0763521bb3b77" -dependencies = [ - "bitflags 2.9.4", -] - -[[package]] -name = "ref-cast" -version = "1.0.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a0ae411dbe946a674d89546582cea4ba2bb8defac896622d6496f14c23ba5cf" -dependencies = [ - "ref-cast-impl", -] - -[[package]] -name = "ref-cast-impl" -version = "1.0.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1165225c21bff1f3bbce98f5a1f889949bc902d3575308cc7b0de30b4f6d27c7" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.106", -] - -[[package]] -name = "regex" -version = "1.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23d7fd106d8c02486a8d64e778353d1cffe08ce79ac2e82f540c86d0facf6912" -dependencies = [ - "aho-corasick", - "memchr", - "regex-automata 0.4.10", - "regex-syntax 0.8.6", -] - -[[package]] -name = "regex-automata" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" -dependencies = [ - "regex-syntax 0.6.29", -] - -[[package]] -name = "regex-automata" -version = "0.4.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b9458fa0bfeeac22b5ca447c63aaf45f28439a709ccd244698632f9aa6394d6" -dependencies = [ - "aho-corasick", - "memchr", - "regex-syntax 0.8.6", -] - -[[package]] -name = "regex-syntax" -version = "0.6.29" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" - -[[package]] -name = "regex-syntax" -version = "0.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "caf4aa5b0f434c91fe5c7f1ecb6a5ece2130b02ad2a590589dda5146df959001" - -[[package]] -name = "rfc6979" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8dd2a808d456c4a54e300a23e9f5a67e122c3024119acbfd73e3bf664491cb2" -dependencies = [ - "hmac", - "subtle", -] - -[[package]] -name = "rustc-demangle" -version = "0.1.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56f7d92ca342cea22a06f2121d944b4fd82af56988c270852495420f961d4ace" - -[[package]] -name = "rustc-hex" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e75f6a532d0fd9f7f13144f392b6ad56a32696bfcd9c78f797f16bbb6f072d6" - -[[package]] -name = "rustc_version" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" -dependencies = [ - "semver", -] - -[[package]] -name = "rustversion" -version = "1.0.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d" - -[[package]] -name = "same-file" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" -dependencies = [ - "winapi-util", -] - -[[package]] -name = "scale-info" -version = "2.11.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "346a3b32eba2640d17a9cb5927056b08f3de90f65b72fe09402c2ad07d684d0b" -dependencies = [ - "bitvec", - "cfg-if", - "derive_more", - "parity-scale-codec", - "scale-info-derive", - "serde", -] - -[[package]] -name = "scale-info-derive" -version = "2.11.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6630024bf739e2179b91fb424b28898baf819414262c5d376677dbff1fe7ebf" -dependencies = [ - "proc-macro-crate", - "proc-macro2", - "quote", - "syn 2.0.106", -] - -[[package]] -name = "schnellru" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "356285bbf17bea63d9e52e96bd18f039672ac92b55b8cb997d6162a2a37d1649" -dependencies = [ - "ahash", - "cfg-if", - "hashbrown 0.13.2", -] - -[[package]] -name = "schnorrkel" -version = "0.11.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e9fcb6c2e176e86ec703e22560d99d65a5ee9056ae45a08e13e84ebf796296f" -dependencies = [ - "aead", - "arrayref", - "arrayvec", - "curve25519-dalek", - "getrandom_or_panic", - "merlin", - "rand_core 0.6.4", - "serde_bytes", - "sha2 0.10.9", - "subtle", - "zeroize", -] - -[[package]] -name = "scopeguard" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" - -[[package]] -name = "sec1" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" -dependencies = [ - "base16ct", - "der", - "generic-array", - "pkcs8", - "serdect", - "subtle", - "zeroize", -] - -[[package]] -name = "secp256k1" -version = "0.28.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d24b59d129cdadea20aea4fb2352fa053712e5d713eee47d700cd4b2bc002f10" -dependencies = [ - "secp256k1-sys", -] - -[[package]] -name = "secp256k1-sys" -version = "0.9.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5d1746aae42c19d583c3c1a8c646bfad910498e2051c551a7f2e3c0c9fbb7eb" -dependencies = [ - "cc", -] - -[[package]] -name = "secrecy" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9bd1c54ea06cfd2f6b63219704de0b9b4f72dcc2b8fdef820be6cd799780e91e" -dependencies = [ - "zeroize", -] - -[[package]] -name = "semver" -version = "1.0.27" +name = "hex" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d767eb0aabc880b29956c35734170f26ed551a859dbd361d140cdbeca61ab1e2" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" [[package]] -name = "serde" -version = "1.0.228" +name = "is-terminal" +version = "0.4.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e" +checksum = "e04d7f318608d35d4b61ddd75cbdaee86b023ebe2bd5a66ee0915f0bf93095a9" dependencies = [ - "serde_core", - "serde_derive", + "hermit-abi 0.5.2", + "libc", + "windows-sys 0.59.0", ] [[package]] -name = "serde_bytes" -version = "0.11.19" +name = "itertools" +version = "0.10.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5d440709e79d88e51ac01c4b72fc6cb7314017bb7da9eeff678aa94c10e3ea8" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" dependencies = [ - "serde", - "serde_core", + "either", ] [[package]] -name = "serde_core" -version = "1.0.228" +name = "itertools" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad" +checksum = "2b192c782037fadd9cfa75548310488aabdbf3d2da73885b31bd0abd03351285" dependencies = [ - "serde_derive", + "either", ] [[package]] -name = "serde_derive" -version = "1.0.228" +name = "itoa" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.106", -] +checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" [[package]] -name = "serde_json" -version = "1.0.149" +name = "js-sys" +version = "0.3.80" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83fc039473c5595ace860d8c4fafa220ff474b3fc6bfdb4293327f1a37e94d86" +checksum = "852f13bec5eba4ba9afbeb93fd7c13fe56147f055939ae21c43a29a0ecb2702e" dependencies = [ - "itoa", - "memchr", - "serde", - "serde_core", - "zmij", + "once_cell", + "wasm-bindgen", ] [[package]] -name = "serde_spanned" -version = "0.6.9" +name = "libc" +version = "0.2.175" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf41e0cfaf7226dca15e8197172c295a782857fcb97fad1808a166870dee75a3" -dependencies = [ - "serde", -] +checksum = "6a82ae493e598baaea5209805c49bbf2ea7de956d50d7da0da1164f9c6d28543" [[package]] -name = "serdect" -version = "0.2.0" +name = "log" +version = "0.4.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a84f14a19e9a014bb9f4512488d9829a68e04ecabffb0f9904cd1ace94598177" -dependencies = [ - "base16ct", - "serde", -] +checksum = "34080505efa8e45a4b816c349525ebe327ceaa8559756f0356cba97ef3bf7432" [[package]] -name = "sha2" -version = "0.9.9" +name = "memchr" +version = "2.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d58a1e1bf39749807d89cf2d98ac2dfa0ff1cb3faa38fbb64dd88ac8013d800" -dependencies = [ - "block-buffer 0.9.0", - "cfg-if", - "cpufeatures", - "digest 0.9.0", - "opaque-debug", -] +checksum = "32a282da65faaf38286cf3be983213fcf1d2e2a58700e808f83f4ea9a4804bc0" [[package]] -name = "sha2" -version = "0.10.9" +name = "nix" +version = "0.30.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7507d819769d01a365ab707794a4084392c824f54a7a6a7862f8c3d0892b283" +checksum = "74523f3a35e05aba87a1d978330aef40f67b0304ac79c1c00b294c9830543db6" dependencies = [ + "bitflags 2.9.4", "cfg-if", - "cpufeatures", - "digest 0.10.7", -] - -[[package]] -name = "sha3" -version = "0.10.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75872d278a8f37ef87fa0ddbda7802605cb18344497949862c0d4dcb291eba60" -dependencies = [ - "digest 0.10.7", - "keccak", -] - -[[package]] -name = "sharded-slab" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" -dependencies = [ - "lazy_static", -] - -[[package]] -name = "shlex" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" - -[[package]] -name = "signature" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" -dependencies = [ - "digest 0.10.7", - "rand_core 0.6.4", -] - -[[package]] -name = "simple-mermaid" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "620a1d43d70e142b1d46a929af51d44f383db9c7a2ec122de2cd992ccfcf3c18" - -[[package]] -name = "slab" -version = "0.4.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a2ae44ef20feb57a68b23d846850f861394c2e02dc425a50098ae8c90267589" - -[[package]] -name = "smallvec" -version = "1.15.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" - -[[package]] -name = "socket2" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "233504af464074f9d066d7b5416c5f9b894a5862a6506e306f7b816cdd6f1807" -dependencies = [ + "cfg_aliases", "libc", - "windows-sys 0.59.0", -] - -[[package]] -name = "sp-application-crypto" -version = "44.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c33baebe847fc50edccd36d0e0e86df21d4db93876b5d74aadae9d8e96ca35e2" -dependencies = [ - "parity-scale-codec", - "scale-info", - "serde", - "sp-core", - "sp-io", ] [[package]] -name = "sp-arithmetic" -version = "28.0.0" +name = "num-bigint" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5f4755af7cc57f4a2a830e134b403fc832caa5d93dacb970ffc7ac717f38c40" +checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9" dependencies = [ - "docify", - "integer-sqrt", + "num-integer", "num-traits", - "parity-scale-codec", - "scale-info", - "serde", - "static_assertions", -] - -[[package]] -name = "sp-core" -version = "39.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0f32d2a9af72fe90bec51076d0e109ef3c25aa1d2a1eef15cf3588acd4a23da" -dependencies = [ - "ark-vrf", - "array-bytes", - "bip39", - "bitflags 1.3.2", - "blake2", - "bounded-collections", - "bs58", - "dyn-clone", - "ed25519-zebra", - "futures", - "hash-db", - "hash256-std-hasher", - "impl-serde", - "itertools 0.11.0", - "k256", - "libsecp256k1", - "log", - "merlin", - "parity-scale-codec", - "parking_lot", - "paste", - "primitive-types", - "rand 0.8.5", - "scale-info", - "schnorrkel", - "secp256k1", - "secrecy", - "serde", - "sha2 0.10.9", - "sp-crypto-hashing", - "sp-debug-derive", - "sp-externalities", - "sp-std", - "sp-storage", - "ss58-registry", - "substrate-bip39", - "thiserror", - "tracing", - "w3f-bls", - "zeroize", -] - -[[package]] -name = "sp-crypto-hashing" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc9927a7f81334ed5b8a98a4a978c81324d12bd9713ec76b5c68fd410174c5eb" -dependencies = [ - "blake2b_simd", - "byteorder", - "digest 0.10.7", - "sha2 0.10.9", - "sha3", - "twox-hash", -] - -[[package]] -name = "sp-debug-derive" -version = "14.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48d09fa0a5f7299fb81ee25ae3853d26200f7a348148aed6de76be905c007dbe" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.106", ] [[package]] -name = "sp-externalities" -version = "0.31.0" +name = "num-integer" +version = "0.1.46" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76b67582d8eb400e730d4abaa9f8841898fa36782a2c6b7f61676e5dd6f8166c" +checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" dependencies = [ - "environmental", - "parity-scale-codec", - "sp-storage", + "num-traits", ] [[package]] -name = "sp-io" -version = "44.0.0" +name = "num-traits" +version = "0.2.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84c3b7db2a4f180e3362e374754983e3ddc844b7a1cd2c2e5b71ab0bd3673dfe" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" dependencies = [ - "bytes", - "docify", - "ed25519-dalek", - "libsecp256k1", - "log", - "parity-scale-codec", - "polkavm-derive", - "rustversion", - "secp256k1", - "sp-core", - "sp-crypto-hashing", - "sp-externalities", - "sp-keystore", - "sp-runtime-interface", - "sp-state-machine", - "sp-tracing", - "sp-trie", - "tracing", - "tracing-core", + "autocfg", ] [[package]] -name = "sp-keystore" -version = "0.45.0" +name = "objc2" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc62157d26f8c6847e2827168f71edea83f9f2c3cc12b8fb694dbe58aefe5972" +checksum = "3a12a8ed07aefc768292f076dc3ac8c48f3781c8f2d5851dd3d98950e8c5a89f" dependencies = [ - "parity-scale-codec", - "parking_lot", - "sp-core", - "sp-externalities", + "objc2-encode", ] [[package]] -name = "sp-panic-handler" -version = "13.0.2" +name = "objc2-encode" +version = "4.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8b52e69a577cbfdea62bfaf16f59eb884422ce98f78b5cd8d9bf668776bced1" -dependencies = [ - "backtrace", - "regex", -] +checksum = "ef25abbcd74fb2609453eb695bd2f860d389e457f67dc17cafc8b8cbc89d0c33" [[package]] -name = "sp-runtime" -version = "45.0.0" +name = "once_cell" +version = "1.21.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f799c308ab442aa1c80b193db8c76f36dcc5a911408bf8861511987f4e4f2ee" -dependencies = [ - "binary-merkle-tree", - "bytes", - "docify", - "either", - "hash256-std-hasher", - "impl-trait-for-tuples", - "log", - "num-traits", - "parity-scale-codec", - "paste", - "rand 0.8.5", - "scale-info", - "serde", - "simple-mermaid", - "sp-application-crypto", - "sp-arithmetic", - "sp-core", - "sp-io", - "sp-std", - "sp-trie", - "sp-weights", - "strum", - "tracing", - "tuplex", -] +checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" [[package]] -name = "sp-runtime-interface" -version = "33.0.0" +name = "oorandom" +version = "11.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22644a2fabb5c246911ecde30fdb7f0801c90f5e611b1147140055ad7b6dabab" -dependencies = [ - "bytes", - "impl-trait-for-tuples", - "parity-scale-codec", - "polkavm-derive", - "sp-externalities", - "sp-runtime-interface-proc-macro", - "sp-std", - "sp-storage", - "sp-tracing", - "sp-wasm-interface", - "static_assertions", -] +checksum = "d6790f58c7ff633d8771f42965289203411a5e5c68388703c06e14f24770b41e" [[package]] -name = "sp-runtime-interface-proc-macro" -version = "20.0.0" +name = "p3-dft" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04178084ae654b3924934a56943ee73e3562db4d277e948393561b08c3b5b5fe" +checksum = "e3b2764a3982d22d62aa933c8de6f9d71d8a474c9110b69e675dea1887bdeffc" dependencies = [ - "Inflector", - "expander", - "proc-macro-crate", - "proc-macro2", - "quote", - "syn 2.0.106", + "itertools 0.14.0", + "p3-field", + "p3-matrix", + "p3-maybe-rayon", + "p3-util", + "tracing", ] [[package]] -name = "sp-state-machine" -version = "0.49.0" +name = "p3-field" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b5bfda052a2fe9be497139e0c5d0a51946873f3cd7c2ff81bdbcb8b446caa37" +checksum = "fc13a73509fe09c67b339951ca8d4cc6e61c9bf08c130dbc90dda52452918cc2" dependencies = [ - "hash-db", - "log", - "parity-scale-codec", - "parking_lot", - "rand 0.8.5", - "smallvec", - "sp-core", - "sp-externalities", - "sp-panic-handler", - "sp-trie", - "thiserror", + "itertools 0.14.0", + "num-bigint", + "p3-maybe-rayon", + "p3-util", + "paste", + "rand 0.9.2", + "serde", "tracing", - "trie-db", ] [[package]] -name = "sp-std" -version = "14.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12f8ee986414b0a9ad741776762f4083cd3a5128449b982a3919c4df36874834" - -[[package]] -name = "sp-storage" -version = "22.0.0" +name = "p3-goldilocks" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee3b70ca340e41cde9d2e069d354508a6e37a6573d66f7cc38f11549002f64ec" +checksum = "552849f6309ffde34af0d31aa9a2d0a549cb0ec138d9792bfbf4a17800742362" dependencies = [ - "impl-serde", - "parity-scale-codec", - "ref-cast", + "num-bigint", + "p3-dft", + "p3-field", + "p3-mds", + "p3-poseidon2", + "p3-symmetric", + "p3-util", + "paste", + "rand 0.9.2", "serde", - "sp-debug-derive", ] [[package]] -name = "sp-tracing" -version = "19.0.0" +name = "p3-matrix" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2c7372456c39cc81e15befe54d0caab8378f2b30fd34d1bcb5f0f56631c6b6e" +checksum = "c8e1e9f69c2fe15768b3ceb2915edb88c47398aa22c485d8163deab2a47fe194" dependencies = [ - "parity-scale-codec", - "regex", + "itertools 0.14.0", + "p3-field", + "p3-maybe-rayon", + "p3-util", + "rand 0.9.2", + "serde", "tracing", - "tracing-core", - "tracing-subscriber", + "transpose", ] [[package]] -name = "sp-trie" -version = "42.0.1" +name = "p3-maybe-rayon" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6beed4d77d66f085443eac37171d88b2dbf6f7358d9d3451c11479ddfce60d6e" -dependencies = [ - "ahash", - "foldhash", - "hash-db", - "hashbrown 0.15.5", - "memory-db", - "nohash-hasher", - "parity-scale-codec", - "parking_lot", - "rand 0.8.5", - "scale-info", - "schnellru", - "sp-core", - "sp-externalities", - "substrate-prometheus-endpoint", - "thiserror", - "tracing", - "trie-db", - "trie-root", -] +checksum = "33f765046b763d046728b3246b690f81dfa7ccd7523b7a1582c74f616fbce6a0" [[package]] -name = "sp-wasm-interface" -version = "24.0.0" +name = "p3-mds" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd177d0658f3df0492f28bd39d665133a7868db5aa66c8642c949b6265430719" +checksum = "6c90541c6056712daf2ee69ec328db8b5605ae8dbafe60226c8eb75eaac0e1f9" dependencies = [ - "anyhow", - "impl-trait-for-tuples", - "log", - "parity-scale-codec", + "p3-dft", + "p3-field", + "p3-symmetric", + "p3-util", + "rand 0.9.2", ] [[package]] -name = "sp-weights" -version = "33.2.0" +name = "p3-poseidon2" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4c34d353fdc6469da8fae9248ffc1f34faaf04bec8cabc43fd77681dcbc8517" +checksum = "88e9f053f120a78ad27e9c1991a0ea547777328ca24025c42364d6ee2667d59a" dependencies = [ - "bounded-collections", - "parity-scale-codec", - "scale-info", - "serde", - "smallvec", - "sp-arithmetic", - "sp-debug-derive", + "p3-field", + "p3-mds", + "p3-symmetric", + "p3-util", + "rand 0.9.2", ] [[package]] -name = "spki" -version = "0.7.3" +name = "p3-symmetric" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d91ed6c858b01f942cd56b37a94b3e0a1798290327d1236e4d9cf4eaca44d29d" +checksum = "72d5db8f05a26d706dfd8aaf7aa4272ca4f3e7a075db897ec7108f24fad78759" dependencies = [ - "base64ct", - "der", + "itertools 0.14.0", + "p3-field", + "serde", ] [[package]] -name = "ss58-registry" -version = "1.51.0" +name = "p3-util" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19409f13998e55816d1c728395af0b52ec066206341d939e22e7766df9b494b8" +checksum = "6dfee67245d9ce78a15176728da2280032f0a84b5819a39a953e7ec03cfd9bd7" dependencies = [ - "Inflector", - "num-format", - "proc-macro2", - "quote", "serde", - "serde_json", - "unicode-xid", ] [[package]] -name = "static_assertions" -version = "1.1.0" +name = "paste" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" +checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" [[package]] -name = "strength_reduce" -version = "0.2.4" +name = "pin-project-lite" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe895eb47f22e2ddd4dabc02bce419d2e643c8e3b585c78158b349195bc24d82" +checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b" [[package]] -name = "strsim" -version = "0.8.0" +name = "plotters" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a" +checksum = "5aeb6f403d7a4911efb1e33402027fc44f29b5bf6def3effcc22d7bb75f2b747" +dependencies = [ + "num-traits", + "plotters-backend", + "plotters-svg", + "wasm-bindgen", + "web-sys", +] [[package]] -name = "strum" -version = "0.26.3" +name = "plotters-backend" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fec0f0aef304996cf250b31b5a10dee7980c85da9d759361292b8bca5a18f06" -dependencies = [ - "strum_macros", -] +checksum = "df42e13c12958a16b3f7f4386b9ab1f3e7933914ecea48da7139435263a4172a" [[package]] -name = "strum_macros" -version = "0.26.4" +name = "plotters-svg" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c6bee85a5a24955dc440386795aa378cd9cf82acd5f764469152d2270e581be" +checksum = "51bae2ac328883f7acdfea3d66a7c35751187f870bc81f94563733a154d7a670" dependencies = [ - "heck", - "proc-macro2", - "quote", - "rustversion", - "syn 2.0.106", + "plotters-backend", ] [[package]] -name = "substrate-bip39" -version = "0.6.0" +name = "ppv-lite86" +version = "0.2.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca58ffd742f693dc13d69bdbb2e642ae239e0053f6aab3b104252892f856700a" +checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" dependencies = [ - "hmac", - "pbkdf2", - "schnorrkel", - "sha2 0.10.9", - "zeroize", + "zerocopy", ] [[package]] -name = "substrate-prometheus-endpoint" -version = "0.17.7" +name = "proc-macro2" +version = "1.0.101" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d23e4bc8e910a312820d589047ab683928b761242dbe31dee081fbdb37cbe0be" +checksum = "89ae43fd86e4158d6db51ad8e2b80f313af9cc74f5c0e03ccb87de09998732de" dependencies = [ - "http-body-util", - "hyper", - "hyper-util", - "log", - "prometheus", - "thiserror", - "tokio", + "unicode-ident", ] [[package]] -name = "subtle" -version = "2.6.1" +name = "qp-poseidon-constants" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" +checksum = "300d8b01e4a492b202e739ab5f73215b261905911020cc0f74a22109365e3bd7" +dependencies = [ + "p3-field", + "p3-goldilocks", + "p3-poseidon2", + "rand 0.9.2", + "rand_chacha 0.9.0", +] [[package]] -name = "syn" -version = "1.0.109" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +name = "qp-poseidon-core" +version = "1.5.0" dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", + "criterion", + "dudect-bencher", + "hex", + "p3-field", + "p3-goldilocks", + "p3-poseidon2", + "p3-symmetric", + "qp-poseidon-constants", ] [[package]] -name = "syn" -version = "2.0.106" +name = "quote" +version = "1.0.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ede7c438028d4436d71104916910f5bb611972c5cfd7f89b8300a8186e6fada6" +checksum = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d" dependencies = [ "proc-macro2", - "quote", - "unicode-ident", ] [[package]] -name = "tap" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" - -[[package]] -name = "termcolor" -version = "1.4.1" +name = "rand" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" dependencies = [ - "winapi-util", + "libc", + "rand_chacha 0.3.1", + "rand_core 0.6.4", ] [[package]] -name = "textwrap" -version = "0.11.0" +name = "rand" +version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060" +checksum = "6db2770f06117d490610c7488547d543617b21bfa07796d7a12f6f1bd53850d1" dependencies = [ - "unicode-width", + "rand_core 0.9.3", ] [[package]] -name = "thiserror" -version = "1.0.69" +name = "rand_chacha" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" dependencies = [ - "thiserror-impl", + "ppv-lite86", + "rand_core 0.6.4", ] [[package]] -name = "thiserror-impl" -version = "1.0.69" +name = "rand_chacha" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" +checksum = "d3022b5f1df60f26e1ffddd6c66e8aa15de382ae63b3a0c1bfc0e4d3e3f325cb" dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.106", + "ppv-lite86", + "rand_core 0.9.3", ] [[package]] -name = "thread_local" -version = "1.1.9" +name = "rand_core" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f60246a4944f24f6e018aa17cdeffb7818b76356965d03b07d6a9886e8962185" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" dependencies = [ - "cfg-if", + "getrandom", ] [[package]] -name = "time" -version = "0.3.44" +name = "rand_core" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91e7d9e3bb61134e77bde20dd4825b97c010155709965fedf0f49bb138e52a9d" -dependencies = [ - "deranged", - "itoa", - "num-conv", - "powerfmt", - "serde", - "time-core", - "time-macros", -] +checksum = "99d9a13982dcf210057a8a78572b2217b667c3beacbf3a0d8b454f6f82837d38" [[package]] -name = "time-core" -version = "0.1.6" +name = "rayon" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40868e7c1d2f0b8d73e4a8c7f0ff63af4f6d19be117e90bd73eb1d62cf831c6b" +checksum = "368f01d005bf8fd9b1206fb6fa653e6c4a81ceb1466406b81792d87c5677a58f" +dependencies = [ + "either", + "rayon-core", +] [[package]] -name = "time-macros" -version = "0.2.24" +name = "rayon-core" +version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30cfb0125f12d9c277f35663a0a33f8c30190f4e4574868a330595412d34ebf3" +checksum = "22e18b0f0062d30d4230b2e85ff77fdfe4326feb054b9783a3460d8435c8ab91" dependencies = [ - "num-conv", - "time-core", + "crossbeam-deque", + "crossbeam-utils", ] [[package]] -name = "tinytemplate" -version = "1.2.1" +name = "regex" +version = "1.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be4d6b5f19ff7664e8c98d03e2139cb510db9b0a60b55f8e8709b689d939b6bc" +checksum = "23d7fd106d8c02486a8d64e778353d1cffe08ce79ac2e82f540c86d0facf6912" dependencies = [ - "serde", - "serde_json", + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", ] [[package]] -name = "tinyvec" -version = "1.10.0" +name = "regex-automata" +version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa5fdc3bce6191a1dbc8c02d5c8bffcf557bafa17c124c5264a458f1b0613fa" +checksum = "6b9458fa0bfeeac22b5ca447c63aaf45f28439a709ccd244698632f9aa6394d6" dependencies = [ - "tinyvec_macros", + "aho-corasick", + "memchr", + "regex-syntax", ] [[package]] -name = "tinyvec_macros" -version = "0.1.1" +name = "regex-syntax" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" +checksum = "caf4aa5b0f434c91fe5c7f1ecb6a5ece2130b02ad2a590589dda5146df959001" [[package]] -name = "tokio" -version = "1.47.1" +name = "rustversion" +version = "1.0.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89e49afdadebb872d3145a5638b59eb0691ea23e46ca484037cfab3b76b95038" -dependencies = [ - "backtrace", - "bytes", - "io-uring", - "libc", - "mio", - "parking_lot", - "pin-project-lite", - "slab", - "socket2", - "windows-sys 0.59.0", -] +checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d" [[package]] -name = "tokio-util" -version = "0.7.16" +name = "same-file" +version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14307c986784f72ef81c89db7d9e28d6ac26d16213b109ea501696195e6e3ce5" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" dependencies = [ - "bytes", - "futures-core", - "futures-sink", - "pin-project-lite", - "tokio", + "winapi-util", ] [[package]] -name = "toml" -version = "0.8.23" +name = "serde" +version = "1.0.228" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc1beb996b9d83529a9e75c17a1686767d148d70663143c7854d8b4a09ced362" +checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e" dependencies = [ - "serde", - "serde_spanned", - "toml_datetime 0.6.11", - "toml_edit 0.22.27", + "serde_core", + "serde_derive", ] [[package]] -name = "toml_datetime" -version = "0.6.11" +name = "serde_core" +version = "1.0.228" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22cddaf88f4fbc13c51aebbf5f8eceb5c7c5a9da2ac40a13519eb5b0a0e8f11c" +checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad" dependencies = [ - "serde", + "serde_derive", ] [[package]] -name = "toml_datetime" -version = "0.7.2" +name = "serde_derive" +version = "1.0.228" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32f1085dec27c2b6632b04c80b3bb1b4300d6495d1e129693bdda7d91e72eec1" +checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" dependencies = [ - "serde_core", + "proc-macro2", + "quote", + "syn", ] [[package]] -name = "toml_edit" -version = "0.22.27" +name = "serde_json" +version = "1.0.149" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41fe8c660ae4257887cf66394862d21dbca4a6ddd26f04a3560410406a2f819a" +checksum = "83fc039473c5595ace860d8c4fafa220ff474b3fc6bfdb4293327f1a37e94d86" dependencies = [ - "indexmap", + "itoa", + "memchr", "serde", - "serde_spanned", - "toml_datetime 0.6.11", - "toml_write", - "winnow", + "serde_core", + "zmij", ] [[package]] -name = "toml_edit" -version = "0.23.6" +name = "strength_reduce" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe895eb47f22e2ddd4dabc02bce419d2e643c8e3b585c78158b349195bc24d82" + +[[package]] +name = "strsim" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a" + +[[package]] +name = "syn" +version = "2.0.106" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3effe7c0e86fdff4f69cdd2ccc1b96f933e24811c5441d44904e8683e27184b" +checksum = "ede7c438028d4436d71104916910f5bb611972c5cfd7f89b8300a8186e6fada6" dependencies = [ - "indexmap", - "toml_datetime 0.7.2", - "toml_parser", - "winnow", + "proc-macro2", + "quote", + "unicode-ident", ] [[package]] -name = "toml_parser" -version = "1.0.3" +name = "textwrap" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4cf893c33be71572e0e9aa6dd15e6677937abd686b066eac3f8cd3531688a627" +checksum = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060" dependencies = [ - "winnow", + "unicode-width", ] [[package]] -name = "toml_write" -version = "0.1.2" +name = "tinytemplate" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d99f8c9a7727884afe522e9bd5edbfc91a3312b36a77b5fb8926e4c31a41801" +checksum = "be4d6b5f19ff7664e8c98d03e2139cb510db9b0a60b55f8e8709b689d939b6bc" +dependencies = [ + "serde", + "serde_json", +] [[package]] name = "tracing" @@ -3745,7 +861,6 @@ version = "0.1.41" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "784e0ac535deb450455cbfa28a6f0df145ea1bb7ae51b821cf5e7927fdcfbdd0" dependencies = [ - "log", "pin-project-lite", "tracing-attributes", "tracing-core", @@ -3759,7 +874,7 @@ checksum = "81383ab64e72a7a8b8e13130c49e3dab29def6d0c7d76a03087b3cf71c5c6903" dependencies = [ "proc-macro2", "quote", - "syn 2.0.106", + "syn", ] [[package]] @@ -3767,40 +882,6 @@ name = "tracing-core" version = "0.1.34" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b9d12581f227e93f094d3af2ae690a574abb8a2b9b7a96e7cfe9647b2b617678" -dependencies = [ - "once_cell", - "valuable", -] - -[[package]] -name = "tracing-log" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" -dependencies = [ - "log", - "once_cell", - "tracing-core", -] - -[[package]] -name = "tracing-subscriber" -version = "0.3.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8189decb5ac0fa7bc8b96b7cb9b2701d60d48805aca84a238004d665fcc4008" -dependencies = [ - "matchers", - "nu-ansi-term", - "once_cell", - "regex", - "sharded-slab", - "smallvec", - "thread_local", - "time", - "tracing", - "tracing-core", - "tracing-log", -] [[package]] name = "transpose" @@ -3812,182 +893,24 @@ dependencies = [ "strength_reduce", ] -[[package]] -name = "trie-db" -version = "0.30.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c0670ab45a6b7002c7df369fee950a27cf29ae0474343fd3a15aa15f691e7a6" -dependencies = [ - "hash-db", - "log", - "rustc-hex", - "smallvec", -] - -[[package]] -name = "trie-root" -version = "0.18.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4ed310ef5ab98f5fa467900ed906cb9232dd5376597e00fd4cba2a449d06c0b" -dependencies = [ - "hash-db", -] - -[[package]] -name = "tuplex" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "676ac81d5454c4dcf37955d34fa8626ede3490f744b86ca14a7b90168d2a08aa" - -[[package]] -name = "twox-hash" -version = "1.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97fee6b57c6a41524a810daee9286c02d7752c4253064d0b05472833a438f675" -dependencies = [ - "cfg-if", - "digest 0.10.7", - "rand 0.8.5", - "static_assertions", -] - -[[package]] -name = "typenum" -version = "1.18.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1dccffe3ce07af9386bfd29e80c0ab1a8205a2fc34e4bcd40364df902cfa8f3f" - -[[package]] -name = "uint" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "909988d098b2f738727b161a106cfc7cab00c539c2687a8836f8e565976fb53e" -dependencies = [ - "byteorder", - "crunchy", - "hex", - "static_assertions", -] - [[package]] name = "unicode-ident" version = "1.0.19" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f63a545481291138910575129486daeaf8ac54aee4387fe7906919f7830c7d9d" -[[package]] -name = "unicode-normalization" -version = "0.1.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" -dependencies = [ - "tinyvec", -] - [[package]] name = "unicode-width" version = "0.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af" -[[package]] -name = "unicode-xid" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" - -[[package]] -name = "utf8parse" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" - -[[package]] -name = "valuable" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba73ea9cf16a25df0c8caa16c51acb937d5712a8429db78a3ee29d5dcacd3a65" - [[package]] name = "vec_map" version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191" -[[package]] -name = "version_check" -version = "0.9.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" - -[[package]] -name = "w3f-bls" -version = "0.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6bfb937b3d12077654a9e43e32a4e9c20177dd9fea0f3aba673e7840bb54f32" -dependencies = [ - "ark-bls12-377", - "ark-bls12-381 0.4.0", - "ark-ec 0.4.2", - "ark-ff 0.4.2", - "ark-serialize 0.4.2", - "ark-serialize-derive 0.4.2", - "arrayref", - "digest 0.10.7", - "rand 0.8.5", - "rand_chacha 0.3.1", - "rand_core 0.6.4", - "sha2 0.10.9", - "sha3", - "zeroize", -] - -[[package]] -name = "w3f-pcs" -version = "0.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbe7a8d5c914b69392ab3b267f679a2e546fe29afaddce47981772ac71bd02e1" -dependencies = [ - "ark-ec 0.5.0", - "ark-ff 0.5.0", - "ark-poly 0.5.0", - "ark-serialize 0.5.0", - "ark-std 0.5.0", - "merlin", -] - -[[package]] -name = "w3f-plonk-common" -version = "0.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1aca389e494fe08c5c108b512e2328309036ee1c0bc7bdfdb743fef54d448c8c" -dependencies = [ - "ark-ec 0.5.0", - "ark-ff 0.5.0", - "ark-poly 0.5.0", - "ark-serialize 0.5.0", - "ark-std 0.5.0", - "getrandom_or_panic", - "rand_core 0.6.4", - "w3f-pcs", -] - -[[package]] -name = "w3f-ring-proof" -version = "0.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a639379402ad51504575dbd258740383291ac8147d3b15859bdf1ea48c677de" -dependencies = [ - "ark-ec 0.5.0", - "ark-ff 0.5.0", - "ark-poly 0.5.0", - "ark-serialize 0.5.0", - "ark-std 0.5.0", - "ark-transcript", - "w3f-pcs", - "w3f-plonk-common", -] - [[package]] name = "walkdir" version = "2.5.0" @@ -4004,24 +927,6 @@ version = "0.11.1+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" -[[package]] -name = "wasi" -version = "0.14.7+wasi-0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "883478de20367e224c0090af9cf5f9fa85bed63a95c1abf3afc5c083ebc06e8c" -dependencies = [ - "wasip2", -] - -[[package]] -name = "wasip2" -version = "1.0.1+wasi-0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0562428422c63773dad2c345a1882263bbf4d65cf3f42e90921f787ef5ad58e7" -dependencies = [ - "wit-bindgen", -] - [[package]] name = "wasm-bindgen" version = "0.2.103" @@ -4045,7 +950,7 @@ dependencies = [ "log", "proc-macro2", "quote", - "syn 2.0.106", + "syn", "wasm-bindgen-shared", ] @@ -4067,7 +972,7 @@ checksum = "ffc003a991398a8ee604a401e194b6b3a39677b3173d6e74495eb51b82e99a32" dependencies = [ "proc-macro2", "quote", - "syn 2.0.106", + "syn", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -4122,12 +1027,6 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" -[[package]] -name = "windows-link" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e6ad25900d524eaabdbbb96d20b4311e1e7ae1699af4fb28c17ae66c80d798a" - [[package]] name = "windows-link" version = "0.2.0" @@ -4140,16 +1039,7 @@ version = "0.59.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" dependencies = [ - "windows-targets 0.52.6", -] - -[[package]] -name = "windows-sys" -version = "0.60.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb" -dependencies = [ - "windows-targets 0.53.3", + "windows-targets", ] [[package]] @@ -4158,7 +1048,7 @@ version = "0.61.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e201184e40b2ede64bc2ea34968b28e33622acdbbf37104f0e4a33f7abe657aa" dependencies = [ - "windows-link 0.2.0", + "windows-link", ] [[package]] @@ -4167,31 +1057,14 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" dependencies = [ - "windows_aarch64_gnullvm 0.52.6", - "windows_aarch64_msvc 0.52.6", - "windows_i686_gnu 0.52.6", - "windows_i686_gnullvm 0.52.6", - "windows_i686_msvc 0.52.6", - "windows_x86_64_gnu 0.52.6", - "windows_x86_64_gnullvm 0.52.6", - "windows_x86_64_msvc 0.52.6", -] - -[[package]] -name = "windows-targets" -version = "0.53.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5fe6031c4041849d7c496a8ded650796e7b6ecc19df1a431c1a363342e5dc91" -dependencies = [ - "windows-link 0.1.3", - "windows_aarch64_gnullvm 0.53.0", - "windows_aarch64_msvc 0.53.0", - "windows_i686_gnu 0.53.0", - "windows_i686_gnullvm 0.53.0", - "windows_i686_msvc 0.53.0", - "windows_x86_64_gnu 0.53.0", - "windows_x86_64_gnullvm 0.53.0", - "windows_x86_64_msvc 0.53.0", + "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]] @@ -4200,120 +1073,48 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.53.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86b8d5f90ddd19cb4a147a5fa63ca848db3df085e25fee3cc10b39b6eebae764" - [[package]] name = "windows_aarch64_msvc" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" -[[package]] -name = "windows_aarch64_msvc" -version = "0.53.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7651a1f62a11b8cbd5e0d42526e55f2c99886c77e007179efff86c2b137e66c" - [[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_gnu" -version = "0.53.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1dc67659d35f387f5f6c479dc4e28f1d4bb90ddd1a5d3da2e5d97b42d6272c3" - [[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_gnullvm" -version = "0.53.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ce6ccbdedbf6d6354471319e781c0dfef054c81fbc7cf83f338a4296c0cae11" - [[package]] name = "windows_i686_msvc" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" -[[package]] -name = "windows_i686_msvc" -version = "0.53.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "581fee95406bb13382d2f65cd4a908ca7b1e4c2f1917f143ba16efe98a589b5d" - [[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_gnu" -version = "0.53.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e55b5ac9ea33f2fc1716d1742db15574fd6fc8dadc51caab1c16a3d3b4190ba" - [[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_gnullvm" -version = "0.53.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a6e035dd0599267ce1ee132e51c27dd29437f63325753051e71dd9e42406c57" - [[package]] name = "windows_x86_64_msvc" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" -[[package]] -name = "windows_x86_64_msvc" -version = "0.53.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "271414315aff87387382ec3d271b52d7ae78726f5d44ac98b4f4030c91880486" - -[[package]] -name = "winnow" -version = "0.7.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21a0236b59786fed61e2a80582dd500fe61f18b5dca67a4a067d0bc9039339cf" -dependencies = [ - "memchr", -] - -[[package]] -name = "wit-bindgen" -version = "0.46.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f17a85883d4e6d00e8a97c586de764dabcc06133f7f1d55dce5cdc070ad7fe59" - -[[package]] -name = "wyz" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05f360fc0b24296329c78fda852a1e9ae82de9cf7b27dae4b7f62f118f77b9ed" -dependencies = [ - "tap", -] - [[package]] name = "zerocopy" version = "0.8.27" @@ -4331,27 +1132,7 @@ checksum = "88d2b8d9c68ad2b9e4340d7832716a4d21a22a1154777ad56ea55c51a9cf3831" dependencies = [ "proc-macro2", "quote", - "syn 2.0.106", -] - -[[package]] -name = "zeroize" -version = "1.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b97154e67e32c85465826e8bcc1c59429aaaf107c1e4a9e53c8d8ccd5eff88d0" -dependencies = [ - "zeroize_derive", -] - -[[package]] -name = "zeroize_derive" -version = "1.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.106", + "syn", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 43d9cea..5ddd535 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,9 +1,6 @@ [workspace] resolver = "2" -members = [ - "core", - "substrate", -] +members = ["core"] [workspace.package] version = "1.5.0" @@ -14,24 +11,10 @@ license = "MIT-0" edition = "2021" [workspace.dependencies] -codec = { version = "3.7.5", default-features = false, package = "parity-scale-codec" } criterion = { version = "0.5", features = ["html_reports"] } -ctor = "0.5.0" -env_logger = "0.11.8" hex = "0.4.3" -log = { version = "0.4.22", default-features = false } p3-field = { version = "0.3.0", default-features = false } p3-goldilocks = { version = "0.3.0", default-features = false } p3-poseidon2 = { version = "0.3.0", default-features = false } p3-symmetric = { version = "0.3.0", default-features = false } -# Git dep until new constants (SPONGE_WIDTH, SPONGE_RATE, POSEIDON2_OUTPUT) are published qp-poseidon-constants = { version = "1.1.0", default-features = false } -qp-poseidon-core = { version = "1.5.0", path = "./core", default-features = false } -rand = { version = "0.9", default-features = false, features = ["small_rng"] } -rand_chacha = { version = "0.9", default-features = false } -scale-info = { version = "2.11.1", default-features = false, features = ["derive"] } -serde = { version = "1.0.217", default-features = false } -sp-core = { version = "39.0.0", default-features = false } -sp-runtime = { version = "45.0.0", default-features = false } -sp-storage = { version = "22.0.0", default-features = false } -sp-trie = { version = "42.0.1", default-features = false } diff --git a/core/Cargo.toml b/core/Cargo.toml index bed928c..22e42d8 100644 --- a/core/Cargo.toml +++ b/core/Cargo.toml @@ -17,8 +17,6 @@ keywords = [ categories = ["cryptography", "no-std"] [dependencies] -# Common (no_std-friendly; we seed ChaCha from a fixed value) -rand_chacha.workspace = true qp-poseidon-constants.workspace = true # Plonky3 stack diff --git a/core/benches/poseidon_benchmarks.rs b/core/benches/poseidon_benchmarks.rs index b049ea5..a2dc1bc 100644 --- a/core/benches/poseidon_benchmarks.rs +++ b/core/benches/poseidon_benchmarks.rs @@ -3,7 +3,7 @@ use p3_field::integers::QuotientMap; use p3_goldilocks::Goldilocks; use qp_poseidon_constants::create_poseidon; use qp_poseidon_core::{ - hash_bytes, hash_for_circuit, hash_squeeze_twice, hash_to_bytes, serialization::bytes_to_felts, + hash_bytes, hash_compact, hash_squeeze_twice, hash_to_bytes, serialization::bytes_to_felts, }; /// Generate test data of varying sizes for benchmarking @@ -29,9 +29,9 @@ fn bench_hash_only(c: &mut Criterion) { let data = generate_test_data(size); group.throughput(Throughput::Bytes(size as u64)); - group.bench_with_input(BenchmarkId::new("hash_for_circuit", size), &data, |b, data| { + group.bench_with_input(BenchmarkId::new("hash_compact", size), &data, |b, data| { b.iter(|| { - let result = hash_for_circuit::<189>(black_box(data)); + let result = hash_compact(black_box(data)); black_box(result) }) }); @@ -77,11 +77,11 @@ fn bench_create_and_hash(c: &mut Criterion) { group.throughput(Throughput::Bytes(size as u64)); group.bench_with_input( - BenchmarkId::new("new_and_hash_for_circuit", size), + BenchmarkId::new("new_and_hash_compact", size), &data, |b, data| { b.iter(|| { - let result = hash_for_circuit::<189>(black_box(data)); + let result = hash_compact(black_box(data)); black_box(result) }) }, diff --git a/substrate/Cargo.toml b/substrate/Cargo.toml deleted file mode 100644 index 674f6ad..0000000 --- a/substrate/Cargo.toml +++ /dev/null @@ -1,54 +0,0 @@ -[package] -name = "qp-poseidon" -version.workspace = true -authors.workspace = true -homepage.workspace = true -repository.workspace = true -license.workspace = true -edition.workspace = true -description = "Poseidon hash implementation for Substrate/Polkadot ecosystem using plonky3 field arithmetic" -keywords = [ - "cryptography", - "hash-functions", - "poseidon", - "quantus-network", - "substrate", -] -categories = ["cryptography"] - -[dependencies] -qp-poseidon-core.workspace = true -qp-poseidon-constants.workspace = true -p3-goldilocks.workspace = true -p3-field.workspace = true -log.workspace = true -scale-info.workspace = true -sp-core.workspace = true -sp-runtime.workspace = true -sp-storage.workspace = true -sp-trie.workspace = true -codec.workspace = true -serde = { workspace = true, optional = true } - -[dev-dependencies] -hex.workspace = true -env_logger.workspace = true -ctor.workspace = true - -[features] -default = ["std"] -std = [ - "codec/std", - "log/std", - "qp-poseidon-core/std", - "scale-info/std", - "serde/std", - "sp-core/std", - "sp-runtime/std", - "sp-storage/std", -] -serde = [ - "codec/serde", - "dep:serde", - "scale-info/serde", -] diff --git a/substrate/README.md b/substrate/README.md deleted file mode 100644 index 85a9360..0000000 --- a/substrate/README.md +++ /dev/null @@ -1,68 +0,0 @@ -# qp-poseidon - -Substrate-compatible Poseidon hash implementation for the Polkadot ecosystem. This crate wraps `qp-poseidon-core` and adds Substrate-specific functionality including codec traits and specialized storage operations. - -## Features - -- **Substrate integration**: Implements required traits for use in Substrate/Polkadot projects -- **Codec support**: Implements `Encode`, `Decode`, and `TypeInfo` traits from `parity-scale-codec` -- **Serde support**: Optional serialization support via the `serde` feature -- **Storage hashing**: Specialized functions for Quantus Network storage operations -- **Circuit compatibility**: Maintains compatibility with zero-knowledge circuit implementations -- **No-std support**: Works in constrained environments - -## Usage - -Add this to your `Cargo.toml`: - -```toml -[dependencies] -qp-poseidon = { path = "path/to/qp-poseidon/crates/substrate" } -``` - -### Basic Hashing - -```rust -use qp_poseidon::PoseidonHasher; - -// Hash bytes with circuit-compatible padding -let data = b"hello world"; -let hash = PoseidonHasher::hash_padded(data); -println!("Hash: {:?}", hash); -``` - -## Performance - -- Optimized for Substrate's encoding/decoding patterns -- Maintains deterministic behavior across different platforms -- Memory efficient for blockchain storage operations -- Circuit-compatible padding ensures consistency with ZK proofs - -## Security - -- Built on `qp-poseidon-core`'s security guarantees -- Uses standard Substrate codec patterns -- Specialized storage hashing prevents collision attacks - -## Integration - -```rust -use qp_poseidon::PoseidonHasher; -use frame_support::pallet_prelude::*; - -#[pallet::config] -pub trait Config: frame_system::Config { - type Hasher: sp_runtime::traits::Hash; -} - -// Use PoseidonHasher as the pallet's hasher -impl pallet::Config for Runtime { - type Hasher = PoseidonHasher; -} -``` - -## Related Crates - -- [`qp-poseidon-core`](../core) - The underlying pure cryptographic implementation -- [`parity-scale-codec`](https://github.com/paritytech/parity-scale-codec) - Substrate's encoding library -- [`plonky3`](https://github.com/0xPolygonZero/plonky3) - The underlying field arithmetic library diff --git a/substrate/src/lib.rs b/substrate/src/lib.rs deleted file mode 100644 index 3e5e14c..0000000 --- a/substrate/src/lib.rs +++ /dev/null @@ -1,392 +0,0 @@ -#![cfg_attr(not(feature = "std"), no_std)] - -extern crate alloc; - -use alloc::vec::Vec; - -use codec::{Decode, Encode}; -use core::{ - clone::Clone, - cmp::{Eq, PartialEq}, - convert::TryInto, - default::Default, - fmt::Debug, - iter::Extend, - prelude::rust_2024::derive, -}; - -use p3_field::PrimeCharacteristicRing; -use p3_goldilocks::Goldilocks; -use qp_poseidon_core::{ - hash_for_circuit, - serialization::{bytes_to_digest, u128_to_quantized_felt, u64_to_felts}, - PROOF_NODE_MAX_SIZE_FELTS, -}; -use scale_info::TypeInfo; -use sp_core::{Hasher, H256}; -use sp_storage::StateVersion; -use sp_trie::{LayoutV0, LayoutV1, TrieConfiguration}; - -/// Converts types to Goldilocks field elements for Poseidon hashing. -/// -/// Implementations must align with the circuit's expected layout for the given type. -/// All byte array types (digests, accounts) use 4 bytes per field element for -/// collision-resistant encoding. -pub trait ToFelts { - /// Append felts to the buffer to minimize allocations - fn write_felts(&self, dest: &mut Vec); - - /// Convenience method to convert to a vector of felts - fn to_felts(&self) -> Vec { - let mut vec = Vec::new(); - self.write_felts(&mut vec); - vec - } -} - -// Specific implementations for primitives and types used in the system. -// We use specific implementations instead of a blanket `MaxEncodedLen` impl to allow -// for structural composition of tuples via macros, which is required for correct circuit alignment. - -impl ToFelts for u32 { - fn write_felts(&self, dest: &mut Vec) { - dest.push(Goldilocks::from_u32(*self)); - } -} - -impl ToFelts for u64 { - fn write_felts(&self, dest: &mut Vec) { - dest.extend(u64_to_felts(*self)); - } -} - -/// Here we quantize the u128 balance type to a u64 (constrained to 32-bit range) and then to a -/// single felt. -impl ToFelts for u128 { - fn write_felts(&self, dest: &mut Vec) { - dest.push(u128_to_quantized_felt(*self)); - } -} - -/// 32-byte arrays are encoded as 4 field elements (8 bytes per felt). -/// This encoding is used for hash outputs and account IDs in storage. -/// The values in the leaf are constrained by the storage proof, so -/// collision resistance is provided by the merkle proof verification. -impl ToFelts for [u8; 32] { - fn write_felts(&self, dest: &mut Vec) { - dest.extend(bytes_to_digest::(self)); - } -} - -/// Account IDs are encoded as 4 field elements (8 bytes per felt). -/// The values are constrained by the storage proof, so collision resistance -/// is provided by the merkle proof verification rather than the encoding. -impl ToFelts for sp_core::crypto::AccountId32 { - fn write_felts(&self, dest: &mut Vec) { - let bytes: &[u8; 32] = self.as_ref(); - dest.extend(bytes_to_digest::(bytes)); - } -} - -impl ToFelts for Option { - fn write_felts(&self, dest: &mut Vec) { - match self { - Some(v) => { - dest.push(Goldilocks::ONE); - v.write_felts(dest); - }, - None => { - dest.push(Goldilocks::ZERO); - }, - } - } -} - -impl ToFelts for Vec { - fn write_felts(&self, dest: &mut Vec) { - // Length prefix + items - dest.push(Goldilocks::from_u32(self.len() as u32)); - for item in self { - item.write_felts(dest); - } - } -} - -// Macro to implement ToFelts for tuples -macro_rules! impl_to_felts_tuple { - ($($name:ident)+) => { - impl<$($name: ToFelts),+> ToFelts for ($($name,)+) { - fn write_felts(&self, dest: &mut Vec) { - #[allow(non_snake_case)] - let ($($name,)+) = self; - $($name.write_felts(dest);)+ - } - } - } -} - -impl_to_felts_tuple!(A); -impl_to_felts_tuple!(A B); -impl_to_felts_tuple!(A B C); -impl_to_felts_tuple!(A B C D); -impl_to_felts_tuple!(A B C D E); -impl_to_felts_tuple!(A B C D E F); - -#[cfg(feature = "serde")] -use serde::{Deserialize, Serialize}; - -/// A standard library hasher implementation using Poseidon -#[derive(Default)] -pub struct PoseidonStdHasher(Vec); - -impl core::hash::Hasher for PoseidonStdHasher { - fn finish(&self) -> u64 { - let hash = PoseidonHasher::hash_for_circuit(self.0.as_slice()); - u64::from_le_bytes(hash[0..8].try_into().unwrap()) - } - - fn write(&mut self, bytes: &[u8]) { - self.0.extend_from_slice(bytes) - } -} - -/// Substrate-compatible Poseidon hasher with codec traits -#[derive(PartialEq, Eq, Clone, Debug, Encode, Decode, TypeInfo)] -#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] -pub struct PoseidonHasher; - -impl Hasher for PoseidonHasher { - type Out = H256; - type StdHasher = PoseidonStdHasher; - const LENGTH: usize = 32; - - fn hash(x: &[u8]) -> H256 { - H256::from_slice(&Self::hash_for_circuit(x)) - } -} - -impl PoseidonHasher { - /// Hash bytes for circuit compatibility (used by Substrate's Hasher trait). - /// - /// Converts bytes to field elements (4 bytes per felt with terminator), - /// pads to a fixed number of elements, then hashes. - pub fn hash_for_circuit(x: &[u8]) -> [u8; 32] { - hash_for_circuit::(x) - } -} - -impl sp_runtime::traits::Hash for PoseidonHasher { - type Output = H256; - - fn hash(s: &[u8]) -> Self::Output { - H256::from_slice(&Self::hash_for_circuit(s)) - } - - /// Produce the hash of some codec-encodable value. - fn hash_of(s: &S) -> Self::Output { - Encode::using_encoded(s, ::hash) - } - - fn ordered_trie_root(input: Vec>, state_version: StateVersion) -> Self::Output { - log::debug!(target: "poseidon", - "PoseidonHasher::ordered_trie_root input={input:?} version={state_version:?}", - ); - let res = match state_version { - StateVersion::V0 => LayoutV0::::ordered_trie_root(input), - StateVersion::V1 => LayoutV1::::ordered_trie_root(input), - }; - log::debug!(target: "poseidon", "PoseidonHasher::ordered_trie_root res={res:?}"); - res - } - - fn trie_root(input: Vec<(Vec, Vec)>, version: StateVersion) -> Self::Output { - log::debug!(target: "poseidon", - "PoseidonHasher::trie_root input={input:?} version={version:?}" - ); - let res = match version { - StateVersion::V0 => LayoutV0::::trie_root(input), - StateVersion::V1 => LayoutV1::::trie_root(input), - }; - log::debug!(target: "poseidon", "PoseidonHasher::trie_root res={res:?}"); - res - } -} - -#[cfg(test)] -mod tests { - use super::*; - use qp_poseidon_constants::POSEIDON2_OUTPUT; - use qp_poseidon_core::serialization::bytes_to_felts; - use scale_info::prelude::vec; - - #[cfg(all(feature = "std", test))] - #[ctor::ctor] - fn init_logger_global() { - let _ = env_logger::builder().is_test(true).try_init(); - } - - #[test] - fn test_substrate_wrapper_compatibility() { - let input = b"test data"; - let core_hash = hash_for_circuit::(input); - let wrapper_hash = PoseidonHasher::hash_for_circuit(input); - assert_eq!(core_hash, wrapper_hash); - } - - #[test] - fn test_empty_input() { - let result = PoseidonHasher::hash_for_circuit(&[]); - assert_eq!(result.len(), 32); - } - - #[test] - fn test_single_byte() { - let input = vec![42u8]; - let result = PoseidonHasher::hash_for_circuit(&input); - assert_eq!(result.len(), 32); - } - - #[test] - fn test_exactly_32_bytes() { - let input = [1u8; 32]; - let result = PoseidonHasher::hash_for_circuit(&input); - assert_eq!(result.len(), 32); - } - - #[test] - fn test_multiple_chunks() { - let input = [2u8; 64]; - let result = PoseidonHasher::hash_for_circuit(&input); - assert_eq!(result.len(), 32); - } - - #[test] - fn test_partial_chunk() { - let input = [3u8; 40]; - let result = PoseidonHasher::hash_for_circuit(&input); - assert_eq!(result.len(), 32); - } - - #[test] - fn test_consistency() { - let input = [4u8; 50]; - let iterations = 100; - let current_hash = PoseidonHasher::hash_for_circuit(&input); - - for _ in 0..iterations { - let hash1 = PoseidonHasher::hash_for_circuit(current_hash.as_ref()); - let current_hash = PoseidonHasher::hash_for_circuit(current_hash.as_ref()); - assert_eq!(hash1, current_hash, "Hash function should be deterministic"); - } - } - - #[test] - fn test_different_inputs() { - let input1 = [5u8; 32]; - let input2 = [6u8; 32]; - let hash1 = PoseidonHasher::hash_for_circuit(&input1); - let hash2 = PoseidonHasher::hash_for_circuit(&input2); - assert_ne!(hash1, hash2, "Different inputs should produce different hashes"); - } - - #[test] - fn test_poseidon_hash_input_sizes() { - for size in 1..=128 { - let input: Vec = (0..size).map(|i| (i * i % 256) as u8).collect(); - let hash = PoseidonHasher::hash_for_circuit(&input); - assert_eq!( - hash.as_slice().len(), - 32, - "Input size {} should produce 32-byte hash", - size - ); - } - } - - #[test] - fn test_big_preimage() { - for overflow in 1..=200 { - let preimage = (18446744069414584321u64 + overflow).to_le_bytes(); - let _hash = PoseidonHasher::hash_for_circuit(&preimage); - } - } - - #[test] - fn test_circuit_preimage() { - let preimage = - hex::decode("afd8e7530b95ee5ebab950c9a0c62fae1e80463687b3982233028e914f8ec7cc"); - let hash = PoseidonHasher::hash_for_circuit(&preimage.unwrap()); - let _hash = PoseidonHasher::hash_for_circuit(hash.as_slice()); - } - - #[test] - fn test_random_inputs() { - let hex_strings = [ - "a3f8", - "1b7e9d", - "4c2a6f81", - "e5d30b9a", - "1a4f7c2e9b0d8356", - "3e8d2a7f5c1b09e4d6f7a2c8", - "7b3e9a1f4c8d2e6b0a5f9d3c", - "1a4f7c2e9b0d83561a4f7c2e9b0d83561a4f7c2e9b0d83561a4f7c2e9b0d8356", - "e5d30b9a4c2a6f81e5d30b9a4c2a6f81e5d30b9a4c2a6f81e5d30b9a4c2a6f81", - ]; - - for hex_string in hex_strings.iter() { - let preimage = hex::decode(hex_string).unwrap(); - let hash = PoseidonHasher::hash_for_circuit(&preimage); - let _hash2 = PoseidonHasher::hash_for_circuit(hash.as_slice()); - } - } - - #[test] - fn test_substrate_hash_512() { - use qp_poseidon_core::{hash_bytes, hash_squeeze_twice}; - - let input = b"test substrate 512-bit"; - let hash512 = hash_squeeze_twice(input); - - // Should be exactly 64 bytes - assert_eq!(hash512.len(), 64); - - // Should be deterministic - let hash512_2 = hash_squeeze_twice(input); - assert_eq!(hash512, hash512_2); - - // First 32 bytes should match regular hash - let regular_hash = hash_bytes(input); - assert_eq!(&hash512[0..32], ®ular_hash); - } - - #[test] - fn test_hash_twice() { - use qp_poseidon_core::hash_twice; - - let preimage = - hex::decode("afd8e7530b95ee5ebab950c9a0c62fae1e80463687b3982233028e914f8ec7cc") - .unwrap(); - let felts = bytes_to_felts(&preimage); - let _hash = hash_twice(&felts); - } - - #[test] - fn test_to_felts_uses_4_felts_for_accounts() { - use sp_core::crypto::AccountId32; - - let account = AccountId32::new([42u8; 32]); - let felts = account.to_felts(); - - // Should produce 4 felts (8 bytes per felt for 32 bytes) - assert_eq!(felts.len(), POSEIDON2_OUTPUT); - } - - #[test] - fn test_to_felts_uses_4_felts_for_byte_arrays() { - let bytes = [42u8; 32]; - let felts = bytes.to_felts(); - - // Should produce 4 felts (8 bytes per felt for 32 bytes) - assert_eq!(felts.len(), POSEIDON2_OUTPUT); - } -} From a309b88267249ab64b22960605a0763cd522afd1 Mon Sep 17 00:00:00 2001 From: illuzen Date: Wed, 27 May 2026 20:47:10 +0900 Subject: [PATCH 03/10] remove unused hash_for_circuit --- core/src/bin/ct_bench.rs | 16 ++- core/src/lib.rs | 221 ++++++++++++++------------------------- 2 files changed, 85 insertions(+), 152 deletions(-) diff --git a/core/src/bin/ct_bench.rs b/core/src/bin/ct_bench.rs index 1d95ee0..3001b9a 100644 --- a/core/src/bin/ct_bench.rs +++ b/core/src/bin/ct_bench.rs @@ -26,8 +26,6 @@ use p3_goldilocks::Goldilocks; use p3_symmetric::Permutation; use qp_poseidon_core::{serialization::bytes_to_felts, *}; -const FIELD_ELEMENT_PREIMAGE_PADDING_LEN: usize = 160; - // Test sizes in bytes const SMALL_INPUT_SIZE: usize = 32; const MEDIUM_INPUT_SIZE: usize = 256; @@ -117,7 +115,7 @@ fn test_hash_padded_bytes_small_ct(runner: &mut CtRunner, rng: &mut BenchRng) { disrupt_cache(rng); runner.run_one(class, || { - let _result = hash_for_circuit::(&input); + let _result = hash_compact(&input); }); } } @@ -139,7 +137,7 @@ fn test_hash_padded_bytes_medium_ct(runner: &mut CtRunner, rng: &mut BenchRng) { disrupt_cache(rng); runner.run_one(class, || { - let _result = hash_for_circuit::(&input); + let _result = hash_compact(&input); }); } } @@ -161,7 +159,7 @@ fn test_hash_padded_bytes_large_ct(runner: &mut CtRunner, rng: &mut BenchRng) { disrupt_cache(rng); runner.run_one(class, || { - let _result = hash_for_circuit::(&input); + let _result = hash_compact(&input); }); } } @@ -183,7 +181,7 @@ fn test_hash_padded_bytes_xlarge_ct(runner: &mut CtRunner, rng: &mut BenchRng) { disrupt_cache(rng); runner.run_one(class, || { - let _result = hash_for_circuit::(&input); + let _result = hash_compact(&input); }); } } @@ -572,7 +570,7 @@ fn test_single_byte_edge_cases_ct(runner: &mut CtRunner, rng: &mut BenchRng) { disrupt_cache(rng); runner.run_one(class, || { - let _result = hash_for_circuit::(&input); + let _result = hash_compact(&input); }); } } @@ -595,7 +593,7 @@ fn test_integrated_operations_ct(runner: &mut CtRunner, rng: &mut BenchRng) { runner.run_one(class, || { // Test a sequence of operations that might be used together - let _hash_padded = hash_for_circuit::(&input); + let _hash_padded = hash_compact(&input); let _hash_variable = hash_bytes(&input); let _squeeze = hash_squeeze_twice(&input); }); @@ -636,7 +634,7 @@ mod tests { fn test_ct_functions_compile() { // This test just ensures the hash functions compile and work let input = vec![0u8; 32]; - let _result = hash_for_circuit::(&input); + let _result = hash_compact(&input); let _result2 = hash_bytes(&input); let _result3 = hash_squeeze_twice(&input); diff --git a/core/src/lib.rs b/core/src/lib.rs index b3b9931..c978e1d 100644 --- a/core/src/lib.rs +++ b/core/src/lib.rs @@ -7,32 +7,13 @@ use qp_poseidon_constants as constants; pub mod serialization; use crate::serialization::{bytes_to_felts, bytes_to_felts_compact}; -use alloc::vec::Vec; use p3_field::PrimeCharacteristicRing; use p3_goldilocks::{Goldilocks, Poseidon2Goldilocks}; use p3_symmetric::Permutation; use qp_poseidon_constants::{POSEIDON2_OUTPUT, SPONGE_RATE, SPONGE_WIDTH}; -use rand_chacha::{rand_core::SeedableRng, ChaCha20Rng}; - -// ============================================================================ -// Compact Encoding Parameters (for storage trie hashing) -// ============================================================================ - -/// Bytes per field element in compact encoding. -/// Uses the full 8-byte capacity of Goldilocks field elements. -pub const COMPACT_BYTES_PER_FELT: usize = 8; - -/// Maximum size of a storage proof node in bytes. -/// Worst-case branch node: 8 (header) + 32 (partial key) + 8 (bitmap) + 512 (16 children) + 40 -/// (value) = 600 bytes. We use 640 bytes to provide some margin. -pub const PROOF_NODE_MAX_SIZE_BYTES: usize = 640; - -/// Maximum storage proof node size in field elements using compact encoding (8 bytes/felt). -/// This is the single source of truth for circuit witness sizing. -pub const PROOF_NODE_MAX_SIZE_FELTS: usize = PROOF_NODE_MAX_SIZE_BYTES / COMPACT_BYTES_PER_FELT; // = 80 // Internal state for Poseidon2 hashing -pub struct Poseidon2State { +struct Poseidon2State { poseidon2: Poseidon2Goldilocks, state: [Goldilocks; SPONGE_WIDTH], buf: [Goldilocks; SPONGE_RATE], @@ -118,25 +99,6 @@ impl Poseidon2State { } } -pub fn poseidon2_from_seed(seed: u64) -> Poseidon2State { - let mut rng = ChaCha20Rng::seed_from_u64(seed); - let poseidon2 = Poseidon2Goldilocks::::new_from_rng_128(&mut rng); - Poseidon2State { - poseidon2, - state: [Goldilocks::ZERO; SPONGE_WIDTH], - buf: [Goldilocks::ZERO; SPONGE_RATE], - buf_len: 0, - } -} - -fn pad_and_hash(mut x: Vec) -> [Goldilocks; POSEIDON2_OUTPUT] { - let len = x.len(); - if len < C { - x.resize(C, Goldilocks::ZERO); - } - hash_to_felts(&x) -} - // ============================================================================ // Public hash functions // ============================================================================ @@ -171,35 +133,35 @@ pub fn hash_bytes(x: &[u8]) -> [u8; 32] { st.finalize_to_bytes() } -/// Hash bytes for circuit compatibility using compact encoding (8 bytes/felt). +// ============================================================================ +// Compact encoding hash functions +// ============================================================================ + +/// Hash a Dilithium ML-DSA-87 public key (2592 bytes) using compact encoding. /// -/// Converts bytes to field elements using compact encoding, then hashes. If the -/// resulting field element count is less than C, the input is zero-padded to -/// exactly C elements before hashing. +/// Uses compact encoding (8 bytes/felt) for circuit compatibility. +/// This is the recommended way to derive an account ID from a Dilithium public key. /// -/// Use this when the hash must match an in-circuit computation with fixed input size. -/// The compact encoding uses 8 bytes per felt (vs 4 bytes/felt in injective encoding), -/// resulting in ~50% fewer constraints in ZK circuits. -pub fn hash_for_circuit(x: &[u8]) -> [u8; 32] { - hash_felts_for_circuit::(bytes_to_felts_compact(x)) +/// # Safety +/// This function uses compact encoding which is only collision-resistant for fixed-size +/// inputs. The fixed array size ensures callers provide exactly 2592 bytes. +pub fn hash_pubkey(pubkey: &[u8; 2592]) -> [u8; 32] { + hash_compact(pubkey) } -/// Hash field elements for circuit compatibility. +/// Hash bytes using compact encoding (8 bytes/felt). /// -/// If the input has fewer than C elements, it is zero-padded to exactly C elements -/// before hashing. Use this when the hash must match an in-circuit computation with -/// fixed input size. -pub fn hash_felts_for_circuit(x: Vec) -> [u8; 32] { - serialization::digest_to_bytes(&pad_and_hash::(x)) -} - -/// Double hash: hash(hash(input)), returning 4 field elements. +/// Converts bytes to field elements using compact encoding, then hashes. /// -/// The inner hash output (4 felts) is re-hashed directly as field elements. -/// Used for wormhole address derivation. -pub fn hash_twice_to_felts(x: &[Goldilocks]) -> [Goldilocks; POSEIDON2_OUTPUT] { - let inner = hash_to_felts(x); - hash_to_felts(&inner) +/// # Warning +/// This function is NOT collision-resistant for variable-length inputs because: +/// 1. Compact encoding doesn't include a length marker (trailing zeros collide) +/// 2. Values >= Goldilocks prime are reduced (field element collisions) +/// +/// Only use this with fixed-size inputs where the size is known and enforced. +/// Prefer the type-safe wrappers like `hash_pubkey` for public APIs. +pub(crate) fn hash_compact(x: &[u8]) -> [u8; 32] { + hash_to_bytes(&bytes_to_felts_compact(x)) } /// Double hash: hash(hash(input)), returning bytes. @@ -207,7 +169,8 @@ pub fn hash_twice_to_felts(x: &[Goldilocks]) -> [Goldilocks; POSEIDON2_OUTPUT] { /// The inner hash output (4 felts) is re-hashed directly as field elements. /// Used for wormhole address derivation. pub fn hash_twice(x: &[Goldilocks]) -> [u8; 32] { - serialization::digest_to_bytes(&hash_twice_to_felts(x)) + let inner = hash_to_felts(x); + hash_to_bytes(&inner) } /// Re-hash a 32-byte digest to produce a new 32-byte digest. @@ -233,42 +196,40 @@ pub fn hash_squeeze_twice(x: &[u8]) -> [u8; 64] { mod tests { use super::*; use crate::alloc::string::ToString; - use alloc::{format, vec}; + use alloc::{format, vec, vec::Vec}; use p3_field::PrimeField64; - const C: usize = PROOF_NODE_MAX_SIZE_FELTS; - #[test] fn test_empty_input() { - let result = hash_for_circuit::(&[]); + let result = hash_compact(&[]); assert_eq!(result.len(), 32); } #[test] fn test_single_byte() { let input = vec![42u8]; - let result = hash_for_circuit::(&input); + let result = hash_compact(&input); assert_eq!(result.len(), 32); } #[test] fn test_exactly_32_bytes() { let input = [1u8; 32]; - let result = hash_for_circuit::(&input); + let result = hash_compact(&input); assert_eq!(result.len(), 32); } #[test] fn test_multiple_chunks() { let input = [2u8; 64]; - let result = hash_for_circuit::(&input); + let result = hash_compact(&input); assert_eq!(result.len(), 32); } #[test] fn test_partial_chunk() { let input = [3u8; 40]; - let result = hash_for_circuit::(&input); + let result = hash_compact(&input); assert_eq!(result.len(), 32); } @@ -276,11 +237,11 @@ mod tests { fn test_consistency() { let input = [4u8; 50]; let iterations = 10; - let current_hash = hash_for_circuit::(&input); + let current_hash = hash_compact(&input); for _ in 0..iterations { - let hash1 = hash_for_circuit::(¤t_hash); - let hash2 = hash_for_circuit::(¤t_hash); + let hash1 = hash_compact(¤t_hash); + let hash2 = hash_compact(¤t_hash); assert_eq!(hash1, hash2, "Hash function should be deterministic"); } } @@ -289,8 +250,8 @@ mod tests { fn test_different_inputs() { let input1 = [5u8; 32]; let input2 = [6u8; 32]; - let hash1 = hash_for_circuit::(&input1); - let hash2 = hash_for_circuit::(&input2); + let hash1 = hash_compact(&input1); + let hash2 = hash_compact(&input2); assert_ne!(hash1, hash2, "Different inputs should produce different hashes"); } @@ -298,7 +259,7 @@ mod tests { fn test_poseidon2_hash_input_sizes() { for size in 1..=128 { let input: Vec = (0..size).map(|i| (i * i % 256) as u8).collect(); - let hash = hash_for_circuit::(&input); + let hash = hash_compact(&input); assert_eq!(hash.len(), 32, "Input size {} should produce 32-byte hash", size); } } @@ -308,7 +269,7 @@ mod tests { for overflow in 1..=10 { let preimage = (::ORDER_U64 + overflow).to_le_bytes(); - let _hash = hash_for_circuit::(&preimage); + let _hash = hash_compact(&preimage); } } @@ -316,8 +277,8 @@ mod tests { fn test_circuit_preimage() { let preimage = hex::decode("afd8e7530b95ee5ebab950c9a0c62fae1e80463687b3982233028e914f8ec7cc"); - let hash = hash_for_circuit::(&preimage.unwrap()); - let _hash = hash_for_circuit::(&hash); + let hash = hash_compact(&preimage.unwrap()); + let _hash = hash_compact(&hash); } #[test] @@ -336,21 +297,22 @@ mod tests { for hex_string in hex_strings.iter() { let preimage = hex::decode(hex_string).unwrap(); - let hash = hash_for_circuit::(&preimage); - let _hash2 = hash_for_circuit::(&hash); + let hash = hash_compact(&preimage); + let _hash2 = hash_compact(&hash); } } #[test] - fn test_hash_bytes_vs_circuit() { + fn test_hash_bytes_vs_compact() { let input = b"test"; - let circuit_hash = hash_for_circuit::(input); - let no_pad_hash = hash_bytes(input); - - // These should be different since one is padded and the other isn't - assert_ne!(circuit_hash, no_pad_hash); - assert_eq!(circuit_hash.len(), 32); - assert_eq!(no_pad_hash.len(), 32); + let compact_hash = hash_compact(input); + let injective_hash = hash_bytes(input); + + // These should be different since they use different encodings + // (compact: 8 bytes/felt vs injective: 4 bytes/felt with terminator) + assert_ne!(compact_hash, injective_hash); + assert_eq!(compact_hash.len(), 32); + assert_eq!(injective_hash.len(), 32); } #[test] @@ -379,14 +341,13 @@ mod tests { let first_hash_bytes = hash_to_bytes(&input_felts); let double_hash_bytes = hash_twice(&input_felts); - let double_hash_felts = hash_twice_to_felts(&input_felts); assert_ne!(first_hash_bytes, double_hash_bytes); - let manual_double = hash_to_felts(&first_hash_felts); - assert_eq!(double_hash_felts, manual_double); - - assert_eq!(serialization::digest_to_bytes(&double_hash_felts), double_hash_bytes); + // Verify hash_twice matches manual double hash + let manual_double_felts = hash_to_felts(&first_hash_felts); + let manual_double_bytes = serialization::digest_to_bytes(&manual_double_felts); + assert_eq!(double_hash_bytes, manual_double_bytes); let double_hash_again = hash_twice(&input_felts); assert_eq!(double_hash_bytes, double_hash_again); @@ -479,7 +440,7 @@ mod tests { println!("\n// Generated test vectors - copy into test_known_value_hashes:"); println!("let vectors: [(Vec, &str, &str); 18] = ["); for (i, input) in inputs.iter().enumerate() { - let circuit_hash = hash_for_circuit::(input); + let compact_hash = hash_compact(input); let bytes_hash = hash_bytes(input); let input_repr = match i { 0 => "vec![]".to_string(), @@ -500,7 +461,7 @@ mod tests { println!( "\t({}, \"{}\", \"{}\"),", input_repr, - hex::encode(circuit_hash), + hex::encode(compact_hash), hex::encode(bytes_hash) ); } @@ -509,112 +470,75 @@ mod tests { /// Known Answer Tests (KAT) for hash functions. /// These test vectors ensure hash outputs remain stable across versions. - /// Format: (input_bytes, hash_for_circuit_output, hash_bytes_output) + /// + /// hash_bytes uses injective encoding (4 bytes/felt with terminator). #[test] fn test_known_value_hashes() { - // Generated test vectors - copy into test_known_value_hashes: - let vectors: [(Vec, &str, &str); 18] = [ - ( - vec![], - "f65f4601aae1cec423d21750d4010f1653db3332655aae3e50cff3d08db9a1bb", - "4d8d22af81f6c27a005a07028590ef4ee480f6c4b93f813daf9de47a07c8ae86", - ), - ( - vec![0u8], - "f65f4601aae1cec423d21750d4010f1653db3332655aae3e50cff3d08db9a1bb", - "8f5b42e350ff5a12788210c86c2bcd49243b8f9350de818b3b0c56839a42ebad", - ), + // Test vectors for hash_bytes (injective encoding) + let vectors: [(Vec, &str); 18] = [ + (vec![], "4d8d22af81f6c27a005a07028590ef4ee480f6c4b93f813daf9de47a07c8ae86"), + (vec![0u8], "8f5b42e350ff5a12788210c86c2bcd49243b8f9350de818b3b0c56839a42ebad"), ( vec![0u8, 0u8], - "f65f4601aae1cec423d21750d4010f1653db3332655aae3e50cff3d08db9a1bb", "3e6ee24fb61a22f4d825b72fc8ebd359e3b3b9566e246c71c3e450ebe3262f9c", ), ( vec![0u8, 0u8, 0u8], - "f65f4601aae1cec423d21750d4010f1653db3332655aae3e50cff3d08db9a1bb", "34f4338a6f1b671062a3ac00b37ca05a47b43e16e589ccaa5b063416ba42356b", ), ( vec![0u8, 0u8, 0u8, 0u8], - "f65f4601aae1cec423d21750d4010f1653db3332655aae3e50cff3d08db9a1bb", "7bac8c6bc49b0b750f2ce0912b815a2cb4ae20c75ac430850257882d9d321afa", ), ( vec![0u8, 0u8, 0u8, 0u8, 0u8], - "f65f4601aae1cec423d21750d4010f1653db3332655aae3e50cff3d08db9a1bb", "c95cfddb573adf4070b3d7c8d2dfbbee48b4b973d80cbda2b458abe7bb6f0def", ), ( vec![0u8, 0u8, 0u8, 0u8, 0u8, 0u8], - "f65f4601aae1cec423d21750d4010f1653db3332655aae3e50cff3d08db9a1bb", "a4dc08d0a8c5ea44007462fe1fd8e45962d4ea85c420eab4140fbb30b5b5e111", ), ( vec![0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8], - "f65f4601aae1cec423d21750d4010f1653db3332655aae3e50cff3d08db9a1bb", "b01975012df91d9f9f040c34655f23f3ec1f6d1738d85679e9848143756637c9", ), ( vec![0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8], - "f65f4601aae1cec423d21750d4010f1653db3332655aae3e50cff3d08db9a1bb", "eacd9e48d2e968131e48c8e69f2a211cc06c7778db6c5467348b45418fc7f585", ), ( vec![0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8], - "f65f4601aae1cec423d21750d4010f1653db3332655aae3e50cff3d08db9a1bb", "00df670e8ec0751d3fb9b5f0281d0af9a7a82f62ad35a21247a9d6117daec151", ), - ( - vec![0u8; 14], - "f65f4601aae1cec423d21750d4010f1653db3332655aae3e50cff3d08db9a1bb", - "d6182896f274c5d9640972e2bf2a5e893e516a21adfdd8ebd39969128d619934", - ), - ( - vec![0u8; 15], - "f65f4601aae1cec423d21750d4010f1653db3332655aae3e50cff3d08db9a1bb", - "15fc2f3c3bc51c96797b889d4fecfcd3535b959f510c007598a87f099e356303", - ), + (vec![0u8; 14], "d6182896f274c5d9640972e2bf2a5e893e516a21adfdd8ebd39969128d619934"), + (vec![0u8; 15], "15fc2f3c3bc51c96797b889d4fecfcd3535b959f510c007598a87f099e356303"), ( vec![0u8, 0u8, 0u8, 1u8], - "e7fc4ca465774d1aa97377c9c11af0e374d02cbe925a3fe5fd8c031db28c9b03", "6ffff0c97262139567c426e916c1fd70c924010153c366bb2a8957ea89902942", ), ( vec![1u8, 2, 3, 4, 5, 6, 7, 8], - "1b34c6db4eae6950ad48a63d31f846a1e7d140e6ecccb50a712ce6a9d536e5da", "131020b2e74819343f8568258ae2e9717e9b2253d57baabab78a518bc7499a8b", ), ( vec![255u8; 32], - "4e6ec9a3d2beb1b978d38f6a5e0181d762a02e68a9647194a52b1db0cfa74985", "41260a4322e97dc3dda2b5f70b5ffb1b43071ad5510e101f34209721042c0987", ), ( b"hello world".to_vec(), - "6c2f70750bd9ceafc7802e8bfd7f2e12ae018d55ba76c56cf5e5e2ca66381635", "fd1f5d7d4701c25bbdd5dd6e3be6abb474fffbaa402f814dce95f8283abbf3e7", ), ( (0u8..32).collect::>(), - "9afdc770a4de1e6f6a5acdbce33c895608e0ef4e0df29c7dd3bb55166fc3aeb4", "36884f9093be80632397f5736dce2fece627a4182daf3cdbf8bf12c8e3e02668", ), ( (0u8..64).collect::>(), - "89fcde335d31dc115a79fa485352812f8d4ed3055ec9c1e297ac39bd93e9db3e", "dd0d06fbe4e7575d0eeac53706482cbbe592e269a35bcd5591a495814371724e", ), ]; - for (input, expected_circuit, expected_bytes) in vectors.iter() { - let circuit_hash = hash_for_circuit::(input); - assert_eq!( - hex::encode(circuit_hash), - *expected_circuit, - "hash_for_circuit mismatch for input: 0x{}", - hex::encode(input) - ); - + for (input, expected_bytes) in vectors.iter() { let bytes_hash = hash_bytes(input); assert_eq!( hex::encode(bytes_hash), @@ -623,5 +547,16 @@ mod tests { hex::encode(input) ); } + + // Test that hash_compact produces consistent results (not testing specific values + // since compact encoding without padding is only safe for fixed-size inputs) + let compact_hash1 = hash_compact(b"test"); + let compact_hash2 = hash_compact(b"test"); + assert_eq!(compact_hash1, compact_hash2, "hash_compact should be deterministic"); + + // Test that different inputs produce different hashes + let hash_a = hash_compact(b"a"); + let hash_b = hash_compact(b"b"); + assert_ne!(hash_a, hash_b, "Different inputs should produce different hashes"); } } From a4e4c99ab50edaa4a07764f76444afedd3701cc7 Mon Sep 17 00:00:00 2001 From: illuzen Date: Thu, 28 May 2026 11:50:00 +0900 Subject: [PATCH 04/10] add test vectors for hash_twice --- core/src/lib.rs | 68 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) diff --git a/core/src/lib.rs b/core/src/lib.rs index c978e1d..469e4e0 100644 --- a/core/src/lib.rs +++ b/core/src/lib.rs @@ -559,4 +559,72 @@ mod tests { let hash_b = hash_compact(b"b"); assert_ne!(hash_a, hash_b, "Different inputs should produce different hashes"); } + + /// Test vectors for hash_twice and rehash_to_bytes. + /// These ensure hash chaining operations remain stable across versions. + #[test] + fn test_hash_twice_vectors() { + use p3_field::PrimeCharacteristicRing; + + // hash_twice test vectors (input felts -> output bytes) + // Empty input + let empty: Vec = vec![]; + assert_eq!( + hex::encode(hash_twice(&empty)), + "b8a2f205ad2e2682ab8af6e49946a597920a24d916ca1139b6fce113c207365b" + ); + + // Single zero felt + let single_zero = vec![Goldilocks::ZERO]; + assert_eq!( + hex::encode(hash_twice(&single_zero)), + "6e962ae00104d1c8907142439156035ad71242caab590a74ba8c9850df03ff11" + ); + + // Single one felt + let single_one = vec![Goldilocks::ONE]; + assert_eq!( + hex::encode(hash_twice(&single_one)), + "50be997dba65a402610d93f8fe853b0974fc72e4605effd5603deb900667e497" + ); + + // Four felts (typical hash output size) + let four_felts: Vec = (1u64..=4).map(Goldilocks::from_u64).collect(); + assert_eq!( + hex::encode(hash_twice(&four_felts)), + "153624f84074a4503ea9139d64ad54da77849d83eb0e6a8e1f839bfe31c222b5" + ); + + // Eight felts + let eight_felts: Vec = (1u64..=8).map(Goldilocks::from_u64).collect(); + assert_eq!( + hex::encode(hash_twice(&eight_felts)), + "958293c7f14ec2ef872955b510eee16f041217f37f8db0c0287fbe182afde6af" + ); + } + + /// Test vectors for rehash_to_bytes (32-byte input -> 32-byte output). + #[test] + fn test_rehash_to_bytes_vectors() { + // All zeros + let zeros = [0u8; 32]; + assert_eq!( + hex::encode(rehash_to_bytes(&zeros)), + "ca0aefbd2e87c9ecc4716b7db8e83937a45dfb06ea10e1d62a4c2f2784002290" + ); + + // Sequential bytes 0..32 + let seq: [u8; 32] = core::array::from_fn(|i| i as u8); + assert_eq!( + hex::encode(rehash_to_bytes(&seq)), + "c0877470eb2fbfc7cc6f22ab70955509de54f3b89856d6a58399a7b7d9d26252" + ); + + // All 0xFF + let ones = [0xFFu8; 32]; + assert_eq!( + hex::encode(rehash_to_bytes(&ones)), + "242fcadf76ea91d398421eb1136b1dbf9f79bdadd79662a21689a0823cf46746" + ); + } } From 89163f384f9b73c61e23d088280da4ef82667b09 Mon Sep 17 00:00:00 2001 From: illuzen Date: Thu, 28 May 2026 11:50:40 +0900 Subject: [PATCH 05/10] fmt --- core/benches/poseidon_benchmarks.rs | 16 ++++++---------- core/src/lib.rs | 10 ++-------- 2 files changed, 8 insertions(+), 18 deletions(-) diff --git a/core/benches/poseidon_benchmarks.rs b/core/benches/poseidon_benchmarks.rs index a2dc1bc..9187151 100644 --- a/core/benches/poseidon_benchmarks.rs +++ b/core/benches/poseidon_benchmarks.rs @@ -76,16 +76,12 @@ fn bench_create_and_hash(c: &mut Criterion) { let data = generate_test_data(size); group.throughput(Throughput::Bytes(size as u64)); - group.bench_with_input( - BenchmarkId::new("new_and_hash_compact", size), - &data, - |b, data| { - b.iter(|| { - let result = hash_compact(black_box(data)); - black_box(result) - }) - }, - ); + group.bench_with_input(BenchmarkId::new("new_and_hash_compact", size), &data, |b, data| { + b.iter(|| { + let result = hash_compact(black_box(data)); + black_box(result) + }) + }); group.bench_with_input(BenchmarkId::new("new_and_hash_bytes", size), &data, |b, data| { b.iter(|| { diff --git a/core/src/lib.rs b/core/src/lib.rs index 469e4e0..47945e0 100644 --- a/core/src/lib.rs +++ b/core/src/lib.rs @@ -478,10 +478,7 @@ mod tests { let vectors: [(Vec, &str); 18] = [ (vec![], "4d8d22af81f6c27a005a07028590ef4ee480f6c4b93f813daf9de47a07c8ae86"), (vec![0u8], "8f5b42e350ff5a12788210c86c2bcd49243b8f9350de818b3b0c56839a42ebad"), - ( - vec![0u8, 0u8], - "3e6ee24fb61a22f4d825b72fc8ebd359e3b3b9566e246c71c3e450ebe3262f9c", - ), + (vec![0u8, 0u8], "3e6ee24fb61a22f4d825b72fc8ebd359e3b3b9566e246c71c3e450ebe3262f9c"), ( vec![0u8, 0u8, 0u8], "34f4338a6f1b671062a3ac00b37ca05a47b43e16e589ccaa5b063416ba42356b", @@ -520,10 +517,7 @@ mod tests { vec![1u8, 2, 3, 4, 5, 6, 7, 8], "131020b2e74819343f8568258ae2e9717e9b2253d57baabab78a518bc7499a8b", ), - ( - vec![255u8; 32], - "41260a4322e97dc3dda2b5f70b5ffb1b43071ad5510e101f34209721042c0987", - ), + (vec![255u8; 32], "41260a4322e97dc3dda2b5f70b5ffb1b43071ad5510e101f34209721042c0987"), ( b"hello world".to_vec(), "fd1f5d7d4701c25bbdd5dd6e3be6abb474fffbaa402f814dce95f8283abbf3e7", From 14e50f4ce4fb1111c96e7b7b1c84795e8b937632 Mon Sep 17 00:00:00 2001 From: illuzen Date: Thu, 28 May 2026 12:21:25 +0900 Subject: [PATCH 06/10] update benches, add clippy.sh --- clippy.sh | 5 ++++ core/benches/poseidon_benchmarks.rs | 14 +--------- core/src/bin/ct_bench.rs | 40 ++++++++++++++--------------- 3 files changed, 26 insertions(+), 33 deletions(-) create mode 100755 clippy.sh diff --git a/clippy.sh b/clippy.sh new file mode 100755 index 0000000..311d506 --- /dev/null +++ b/clippy.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env bash +# Run the same clippy command as CI (see .github/workflows/ci.yml) +set -euo pipefail + +cargo clippy --workspace --all-targets --all-features --locked -- -D warnings diff --git a/core/benches/poseidon_benchmarks.rs b/core/benches/poseidon_benchmarks.rs index 9187151..83eb776 100644 --- a/core/benches/poseidon_benchmarks.rs +++ b/core/benches/poseidon_benchmarks.rs @@ -3,7 +3,7 @@ use p3_field::integers::QuotientMap; use p3_goldilocks::Goldilocks; use qp_poseidon_constants::create_poseidon; use qp_poseidon_core::{ - hash_bytes, hash_compact, hash_squeeze_twice, hash_to_bytes, serialization::bytes_to_felts, + hash_bytes, hash_squeeze_twice, hash_to_bytes, serialization::bytes_to_felts, }; /// Generate test data of varying sizes for benchmarking @@ -29,12 +29,6 @@ fn bench_hash_only(c: &mut Criterion) { let data = generate_test_data(size); group.throughput(Throughput::Bytes(size as u64)); - group.bench_with_input(BenchmarkId::new("hash_compact", size), &data, |b, data| { - b.iter(|| { - let result = hash_compact(black_box(data)); - black_box(result) - }) - }); group.bench_with_input(BenchmarkId::new("hash_bytes", size), &data, |b, data| { b.iter(|| { @@ -76,12 +70,6 @@ fn bench_create_and_hash(c: &mut Criterion) { let data = generate_test_data(size); group.throughput(Throughput::Bytes(size as u64)); - group.bench_with_input(BenchmarkId::new("new_and_hash_compact", size), &data, |b, data| { - b.iter(|| { - let result = hash_compact(black_box(data)); - black_box(result) - }) - }); group.bench_with_input(BenchmarkId::new("new_and_hash_bytes", size), &data, |b, data| { b.iter(|| { diff --git a/core/src/bin/ct_bench.rs b/core/src/bin/ct_bench.rs index 3001b9a..cd91724 100644 --- a/core/src/bin/ct_bench.rs +++ b/core/src/bin/ct_bench.rs @@ -98,9 +98,9 @@ fn disrupt_cache(rng: &mut BenchRng) { std::hint::black_box(sum); } -/// Test hash_padded_bytes with small inputs (32 bytes) +/// Test hash_bytes with small inputs (32 bytes) #[cfg(feature = "dudect-bencher")] -fn test_hash_padded_bytes_small_ct(runner: &mut CtRunner, rng: &mut BenchRng) { +fn test_hash_bytes_small_ct(runner: &mut CtRunner, rng: &mut BenchRng) { // Generate the fixed input once for all Left class samples let fixed_input = generate_fixed_byte_input(SMALL_INPUT_SIZE, rng); @@ -115,14 +115,14 @@ fn test_hash_padded_bytes_small_ct(runner: &mut CtRunner, rng: &mut BenchRng) { disrupt_cache(rng); runner.run_one(class, || { - let _result = hash_compact(&input); + let _result = hash_bytes(&input); }); } } -/// Test hash_padded_bytes with medium inputs (256 bytes) +/// Test hash_bytes with medium inputs (256 bytes) #[cfg(feature = "dudect-bencher")] -fn test_hash_padded_bytes_medium_ct(runner: &mut CtRunner, rng: &mut BenchRng) { +fn test_hash_bytes_medium_ct(runner: &mut CtRunner, rng: &mut BenchRng) { // Generate the fixed input once for all Left class samples let fixed_input = generate_fixed_byte_input(MEDIUM_INPUT_SIZE, rng); @@ -137,14 +137,14 @@ fn test_hash_padded_bytes_medium_ct(runner: &mut CtRunner, rng: &mut BenchRng) { disrupt_cache(rng); runner.run_one(class, || { - let _result = hash_compact(&input); + let _result = hash_bytes(&input); }); } } -/// Test hash_padded_bytes with large inputs (1KB) +/// Test hash_bytes with large inputs (1KB) #[cfg(feature = "dudect-bencher")] -fn test_hash_padded_bytes_large_ct(runner: &mut CtRunner, rng: &mut BenchRng) { +fn test_hash_bytes_large_ct(runner: &mut CtRunner, rng: &mut BenchRng) { // Generate the fixed input once for all Left class samples let fixed_input = generate_fixed_byte_input(LARGE_INPUT_SIZE, rng); @@ -159,14 +159,14 @@ fn test_hash_padded_bytes_large_ct(runner: &mut CtRunner, rng: &mut BenchRng) { disrupt_cache(rng); runner.run_one(class, || { - let _result = hash_compact(&input); + let _result = hash_bytes(&input); }); } } -/// Test hash_padded_bytes with extra large inputs (4KB) +/// Test hash_bytes with extra large inputs (4KB) #[cfg(feature = "dudect-bencher")] -fn test_hash_padded_bytes_xlarge_ct(runner: &mut CtRunner, rng: &mut BenchRng) { +fn test_hash_bytes_xlarge_ct(runner: &mut CtRunner, rng: &mut BenchRng) { // Generate the fixed input once for all Left class samples let fixed_input = generate_fixed_byte_input(EXTRA_LARGE_INPUT_SIZE, rng); @@ -181,7 +181,7 @@ fn test_hash_padded_bytes_xlarge_ct(runner: &mut CtRunner, rng: &mut BenchRng) { disrupt_cache(rng); runner.run_one(class, || { - let _result = hash_compact(&input); + let _result = hash_bytes(&input); }); } } @@ -570,7 +570,7 @@ fn test_single_byte_edge_cases_ct(runner: &mut CtRunner, rng: &mut BenchRng) { disrupt_cache(rng); runner.run_one(class, || { - let _result = hash_compact(&input); + let _result = hash_bytes(&input); }); } } @@ -593,7 +593,7 @@ fn test_integrated_operations_ct(runner: &mut CtRunner, rng: &mut BenchRng) { runner.run_one(class, || { // Test a sequence of operations that might be used together - let _hash_padded = hash_compact(&input); + let _hash_padded = hash_bytes(&input); let _hash_variable = hash_bytes(&input); let _squeeze = hash_squeeze_twice(&input); }); @@ -634,7 +634,7 @@ mod tests { fn test_ct_functions_compile() { // This test just ensures the hash functions compile and work let input = vec![0u8; 32]; - let _result = hash_compact(&input); + let _result = hash_bytes(&input); let _result2 = hash_bytes(&input); let _result3 = hash_squeeze_twice(&input); @@ -648,11 +648,11 @@ mod tests { // This creates a main function when compiled as a binary #[cfg(all(not(test), feature = "dudect-bencher"))] dudect_bencher::ctbench_main!( - // hash_padded_bytes tests for different input sizes - test_hash_padded_bytes_small_ct, - test_hash_padded_bytes_medium_ct, - test_hash_padded_bytes_large_ct, - test_hash_padded_bytes_xlarge_ct, + // hash_bytes tests for different input sizes + test_hash_bytes_small_ct, + test_hash_bytes_medium_ct, + test_hash_bytes_large_ct, + test_hash_bytes_xlarge_ct, // hash_variable_length_bytes tests for different input sizes test_hash_variable_length_bytes_small_ct, test_hash_variable_length_bytes_medium_ct, From 0fb53cb0243d58aad2483d9538709a13fb5fea88 Mon Sep 17 00:00:00 2001 From: illuzen Date: Thu, 28 May 2026 12:50:22 +0900 Subject: [PATCH 07/10] dedupe in bench --- core/src/bin/ct_bench.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/core/src/bin/ct_bench.rs b/core/src/bin/ct_bench.rs index cd91724..e4b78a5 100644 --- a/core/src/bin/ct_bench.rs +++ b/core/src/bin/ct_bench.rs @@ -593,8 +593,9 @@ fn test_integrated_operations_ct(runner: &mut CtRunner, rng: &mut BenchRng) { runner.run_one(class, || { // Test a sequence of operations that might be used together - let _hash_padded = hash_bytes(&input); - let _hash_variable = hash_bytes(&input); + let hash = hash_bytes(&input); + // Chain with rehash (tests bytes -> felts -> hash path) + let _rehash = rehash_to_bytes(&hash); let _squeeze = hash_squeeze_twice(&input); }); } @@ -634,8 +635,8 @@ mod tests { fn test_ct_functions_compile() { // This test just ensures the hash functions compile and work let input = vec![0u8; 32]; - let _result = hash_bytes(&input); - let _result2 = hash_bytes(&input); + let hash = hash_bytes(&input); + let _rehash = rehash_to_bytes(&hash); let _result3 = hash_squeeze_twice(&input); // Test field operations From 682fec1f4be4cbc49b6c2b12100b9fee029d7faa Mon Sep 17 00:00:00 2001 From: illuzen Date: Thu, 28 May 2026 15:55:57 +0900 Subject: [PATCH 08/10] simplify further, remove unused --- core/src/lib.rs | 97 +++++++++++++------------------------------------ 1 file changed, 25 insertions(+), 72 deletions(-) diff --git a/core/src/lib.rs b/core/src/lib.rs index 47945e0..e7a64d4 100644 --- a/core/src/lib.rs +++ b/core/src/lib.rs @@ -6,7 +6,7 @@ use qp_poseidon_constants as constants; pub mod serialization; -use crate::serialization::{bytes_to_felts, bytes_to_felts_compact}; +use crate::serialization::bytes_to_felts; use p3_field::PrimeCharacteristicRing; use p3_goldilocks::{Goldilocks, Poseidon2Goldilocks}; use p3_symmetric::Permutation; @@ -137,33 +137,6 @@ pub fn hash_bytes(x: &[u8]) -> [u8; 32] { // Compact encoding hash functions // ============================================================================ -/// Hash a Dilithium ML-DSA-87 public key (2592 bytes) using compact encoding. -/// -/// Uses compact encoding (8 bytes/felt) for circuit compatibility. -/// This is the recommended way to derive an account ID from a Dilithium public key. -/// -/// # Safety -/// This function uses compact encoding which is only collision-resistant for fixed-size -/// inputs. The fixed array size ensures callers provide exactly 2592 bytes. -pub fn hash_pubkey(pubkey: &[u8; 2592]) -> [u8; 32] { - hash_compact(pubkey) -} - -/// Hash bytes using compact encoding (8 bytes/felt). -/// -/// Converts bytes to field elements using compact encoding, then hashes. -/// -/// # Warning -/// This function is NOT collision-resistant for variable-length inputs because: -/// 1. Compact encoding doesn't include a length marker (trailing zeros collide) -/// 2. Values >= Goldilocks prime are reduced (field element collisions) -/// -/// Only use this with fixed-size inputs where the size is known and enforced. -/// Prefer the type-safe wrappers like `hash_pubkey` for public APIs. -pub(crate) fn hash_compact(x: &[u8]) -> [u8; 32] { - hash_to_bytes(&bytes_to_felts_compact(x)) -} - /// Double hash: hash(hash(input)), returning bytes. /// /// The inner hash output (4 felts) is re-hashed directly as field elements. @@ -201,35 +174,35 @@ mod tests { #[test] fn test_empty_input() { - let result = hash_compact(&[]); + let result = hash_bytes(&[]); assert_eq!(result.len(), 32); } #[test] fn test_single_byte() { let input = vec![42u8]; - let result = hash_compact(&input); + let result = hash_bytes(&input); assert_eq!(result.len(), 32); } #[test] fn test_exactly_32_bytes() { let input = [1u8; 32]; - let result = hash_compact(&input); + let result = hash_bytes(&input); assert_eq!(result.len(), 32); } #[test] fn test_multiple_chunks() { let input = [2u8; 64]; - let result = hash_compact(&input); + let result = hash_bytes(&input); assert_eq!(result.len(), 32); } #[test] fn test_partial_chunk() { let input = [3u8; 40]; - let result = hash_compact(&input); + let result = hash_bytes(&input); assert_eq!(result.len(), 32); } @@ -237,11 +210,11 @@ mod tests { fn test_consistency() { let input = [4u8; 50]; let iterations = 10; - let current_hash = hash_compact(&input); + let current_hash = hash_bytes(&input); for _ in 0..iterations { - let hash1 = hash_compact(¤t_hash); - let hash2 = hash_compact(¤t_hash); + let hash1 = hash_bytes(¤t_hash); + let hash2 = hash_bytes(¤t_hash); assert_eq!(hash1, hash2, "Hash function should be deterministic"); } } @@ -250,8 +223,8 @@ mod tests { fn test_different_inputs() { let input1 = [5u8; 32]; let input2 = [6u8; 32]; - let hash1 = hash_compact(&input1); - let hash2 = hash_compact(&input2); + let hash1 = hash_bytes(&input1); + let hash2 = hash_bytes(&input2); assert_ne!(hash1, hash2, "Different inputs should produce different hashes"); } @@ -259,7 +232,7 @@ mod tests { fn test_poseidon2_hash_input_sizes() { for size in 1..=128 { let input: Vec = (0..size).map(|i| (i * i % 256) as u8).collect(); - let hash = hash_compact(&input); + let hash = hash_bytes(&input); assert_eq!(hash.len(), 32, "Input size {} should produce 32-byte hash", size); } } @@ -269,7 +242,7 @@ mod tests { for overflow in 1..=10 { let preimage = (::ORDER_U64 + overflow).to_le_bytes(); - let _hash = hash_compact(&preimage); + let _hash = hash_bytes(&preimage); } } @@ -277,8 +250,8 @@ mod tests { fn test_circuit_preimage() { let preimage = hex::decode("afd8e7530b95ee5ebab950c9a0c62fae1e80463687b3982233028e914f8ec7cc"); - let hash = hash_compact(&preimage.unwrap()); - let _hash = hash_compact(&hash); + let hash = hash_bytes(&preimage.unwrap()); + let _hash = hash_bytes(&hash); } #[test] @@ -297,24 +270,11 @@ mod tests { for hex_string in hex_strings.iter() { let preimage = hex::decode(hex_string).unwrap(); - let hash = hash_compact(&preimage); - let _hash2 = hash_compact(&hash); + let hash = hash_bytes(&preimage); + let _hash2 = hash_bytes(&hash); } } - #[test] - fn test_hash_bytes_vs_compact() { - let input = b"test"; - let compact_hash = hash_compact(input); - let injective_hash = hash_bytes(input); - - // These should be different since they use different encodings - // (compact: 8 bytes/felt vs injective: 4 bytes/felt with terminator) - assert_ne!(compact_hash, injective_hash); - assert_eq!(compact_hash.len(), 32); - assert_eq!(injective_hash.len(), 32); - } - #[test] fn test_hash_squeeze_twice() { let input = b"test 512-bit hash"; @@ -438,9 +398,8 @@ mod tests { ]; println!("\n// Generated test vectors - copy into test_known_value_hashes:"); - println!("let vectors: [(Vec, &str, &str); 18] = ["); + println!("let vectors: [(Vec, &str); 18] = ["); for (i, input) in inputs.iter().enumerate() { - let compact_hash = hash_compact(input); let bytes_hash = hash_bytes(input); let input_repr = match i { 0 => "vec![]".to_string(), @@ -458,12 +417,7 @@ mod tests { 17 => "(0u8..64).collect::>()".to_string(), _ => unreachable!(), }; - println!( - "\t({}, \"{}\", \"{}\"),", - input_repr, - hex::encode(compact_hash), - hex::encode(bytes_hash) - ); + println!("\t({}, \"{}\"),", input_repr, hex::encode(bytes_hash)); } println!("];"); } @@ -542,15 +496,14 @@ mod tests { ); } - // Test that hash_compact produces consistent results (not testing specific values - // since compact encoding without padding is only safe for fixed-size inputs) - let compact_hash1 = hash_compact(b"test"); - let compact_hash2 = hash_compact(b"test"); - assert_eq!(compact_hash1, compact_hash2, "hash_compact should be deterministic"); + // Test that hash_bytes produces consistent results + let hash1 = hash_bytes(b"test"); + let hash2 = hash_bytes(b"test"); + assert_eq!(hash1, hash2, "hash_bytes should be deterministic"); // Test that different inputs produce different hashes - let hash_a = hash_compact(b"a"); - let hash_b = hash_compact(b"b"); + let hash_a = hash_bytes(b"a"); + let hash_b = hash_bytes(b"b"); assert_ne!(hash_a, hash_b, "Different inputs should produce different hashes"); } From ff8952b01a54a6e26edec7d9b39c859fd218d902 Mon Sep 17 00:00:00 2001 From: Nikolaus Heger Date: Thu, 28 May 2026 15:16:09 +0800 Subject: [PATCH 09/10] delete bad comment --- core/src/lib.rs | 4 ---- 1 file changed, 4 deletions(-) diff --git a/core/src/lib.rs b/core/src/lib.rs index e7a64d4..2a59913 100644 --- a/core/src/lib.rs +++ b/core/src/lib.rs @@ -133,10 +133,6 @@ pub fn hash_bytes(x: &[u8]) -> [u8; 32] { st.finalize_to_bytes() } -// ============================================================================ -// Compact encoding hash functions -// ============================================================================ - /// Double hash: hash(hash(input)), returning bytes. /// /// The inner hash output (4 felts) is re-hashed directly as field elements. From 100647bc603b3ecec161e065c715b0324921952c Mon Sep 17 00:00:00 2001 From: illuzen Date: Thu, 28 May 2026 16:24:08 +0900 Subject: [PATCH 10/10] update READMEs --- README.md | 91 ++++++++++++++++++++++------------------- core/README.md | 107 +++++++++++++++++++++++++++---------------------- 2 files changed, 107 insertions(+), 91 deletions(-) diff --git a/README.md b/README.md index 0cdb303..9f27a2e 100644 --- a/README.md +++ b/README.md @@ -1,62 +1,69 @@ # qp-poseidon -A workspace containing Poseidon hash implementations for different use cases, built on top of plonky3 field arithmetic. +Poseidon2 hash implementation for the Quantus Network, built on plonky3 field arithmetic over the Goldilocks field. -## 📁 Workspace Structure +## Crate -This workspace contains two crates: +### `qp-poseidon-core` (`core/`) -### `qp-poseidon-core` (`crates/core`) -Pure Rust implementation of the Poseidon hash function without any external dependencies beyond plonky3 and plonky2. +Pure Rust implementation of Poseidon2 hashing with two encoding modes: -- **No-std compatible**: Works in embedded and constrained environments -- **Pure cryptography**: No blockchain or Substrate-specific dependencies -- **Circuit-compatible**: Padding behavior matches zero-knowledge circuit implementations -- **NOT CONSTANT TIME**: Poseidon2 implementation could reveal hash inputs via timing attacks +- **Injective encoding** (`hash_bytes`): Safe for variable-length inputs. Uses 4 bytes per field element with a terminator byte to ensure collision resistance. +- **Compact encoding** (`bytes_to_felts_compact`): Uses 8 bytes per field element. Only safe for fixed-size inputs where length is enforced externally. +Features: +- **No-std compatible**: Works in embedded and WASM environments +- **Circuit-compatible**: Matches ZK circuit implementations +- **Goldilocks field**: 64-bit prime field (p = 2^64 - 2^32 + 1) -### `qp-poseidon` (`crates/substrate`) -Substrate-compatible wrapper that adds codec traits and blockchain-specific functionality. +## Usage -- **Substrate integration**: Implements required traits for use in Substrate/Polkadot projects -- **Codec support**: Implements `Encode`, `Decode`, and `TypeInfo` traits -- **Serde support**: Optional serialization support -- **Storage hashing**: Specialized functions for Quantus storage operations +```rust +use qp_poseidon_core::{hash_bytes, hash_to_bytes, hash_twice, rehash_to_bytes}; -See respective [README.md](crates/core/README.md) and [README.md](crates/substrate/README.md) for more details. +// Hash arbitrary bytes (injective encoding - collision resistant) +let hash = hash_bytes(b"hello world"); -## 📊 Performance +// Hash field elements directly +use qp_poseidon_core::serialization::bytes_to_felts; +let felts = bytes_to_felts(b"data"); +let hash = hash_to_bytes(&felts); -The implementation is optimized for: -- Circuit compatibility (consistent padding) -- No-std environments -- Deterministic behavior across platforms -- Memory efficiency in constrained environments +// Double hash for address derivation +let address = hash_twice(&felts); -## 🔒 Security +// Re-hash a 32-byte digest +let chained = rehash_to_bytes(&hash); +``` -- Implements the standard Poseidon2 permutation -- Constants are verifiably random, based on pi and ChaCha20 -- Circuit-compatible padding -- Variable length padding consistent with original paper -- Code is roughly constant time, as indicated by dudect t-scores < 5. There are no branches in the processing of blocks, so we do not expect any side-channel attacks to reveal the contents of the preimage. There is a small amount of branching in the padding functions, but this should only depend on the length of the input, not the contents. +## Public API -## 📄 License +| Function | Description | +|----------|-------------| +| `hash_bytes(&[u8])` | Hash bytes using injective encoding (4 bytes/felt + terminator) | +| `hash_to_bytes(&[Goldilocks])` | Hash field elements, return 32 bytes | +| `hash_to_felts(&[Goldilocks])` | Hash field elements, return 4 field elements | +| `hash_twice(&[Goldilocks])` | Double hash: `hash(hash(input))` for wormhole addresses | +| `rehash_to_bytes(&[u8; 32])` | Re-hash a 32-byte digest | +| `hash_squeeze_twice(&[u8])` | 64-byte output (two squeezes) for mining PoW | -MIT-0 +### Serialization (`serialization` module) + +| Function | Description | +|----------|-------------| +| `bytes_to_felts(&[u8])` | Injective encoding: 4 bytes/felt + terminator | +| `bytes_to_felts_compact(&[u8])` | Compact encoding: 8 bytes/felt (fixed-size inputs only) | +| `bytes_to_digest(&[u8; 32])` | Decode 32 bytes as 4 field elements | +| `digest_to_bytes(&[Goldilocks; 4])` | Encode 4 field elements as 32 bytes | +| `string_to_felts(&str)` | Encode string as field elements | -## 🤝 Contributing +## Security -1. Fork the repository -2. Create a feature branch -3. Make your changes -4. Add tests -5. Ensure all tests pass -6. Submit a pull request +- **Injective encoding**: `hash_bytes` is collision-resistant for any input length +- **Compact encoding**: Only use `bytes_to_felts_compact` for fixed-size inputs (e.g., in ZK circuits where input size is constrained) +- **Constant-time**: Core hashing has no input-dependent branches; timing tests pass with dudect t-scores < 5 +- **No padding vulnerabilities**: Removed legacy padded hashing functions that had audit issues -## Related Crates +## License -- [`qp-poseidon-core`](../core) - The underlying pure cryptographic implementation -- [`parity-scale-codec`](https://github.com/paritytech/parity-scale-codec) - Substrate's encoding library -- [`qp-zk-circuits`](https://github.com/QuantusNetwork/qp-zk-circuits) - The underlying zero-knowledge circuit library -- [`plonky3`](https://github.com/0xPolygonZero/plonky3) - The underlying field arithmetic library +MIT-0 diff --git a/core/README.md b/core/README.md index e2531dc..791e00f 100644 --- a/core/README.md +++ b/core/README.md @@ -1,82 +1,91 @@ # qp-poseidon-core -A pure Rust implementation of the Poseidon hash function using plonky3 field arithmetic. This crate provides the core cryptographic functionality without any external dependencies beyond plonky3. +Pure Rust implementation of Poseidon2 hashing over the Goldilocks field (p = 2^64 - 2^32 + 1). ## Features -- **No-std compatible**: Works in embedded and constrained environments -- **Pure cryptography**: No blockchain or external dependencies -- **Circuit-compatible**: Padding behavior matches zero-knowledge circuit implementations -- **Field arithmetic**: Built on battle-tested plonky3 Goldilocks field +- **No-std compatible**: Works in embedded, WASM, and constrained environments +- **Circuit-compatible**: Encoding matches ZK circuit implementations +- **Collision-resistant**: Injective encoding prevents length-extension and padding attacks +- **Goldilocks field**: Built on plonky3's optimized 64-bit prime field arithmetic -### Basic Usage +## Usage -```rust -use qp_poseidon_core::PoseidonCore; +### Hash Arbitrary Bytes -// Hash some bytes with padding (recommended for circuit compatibility) -let data = b"hello world"; -let hash = PoseidonCore::hash_for_circuit(data); -println!("Hash: {:?}", hash); +```rust +use qp_poseidon_core::hash_bytes; -// Hash without padding -let hash_no_pad = PoseidonCore::hash_no_pad_bytes(data); +// Injective encoding - safe for any input length +let hash: [u8; 32] = hash_bytes(b"hello world"); ``` -### Working with Field Elements +### Hash Field Elements ```rust -use qp_poseidon_core::{PoseidonCore, injective_bytes_to_felts}; -use plonky3::field::goldilocks_field::GoldilocksField; +use qp_poseidon_core::{hash_to_bytes, hash_to_felts}; +use qp_poseidon_core::serialization::bytes_to_felts; -// Convert bytes to field elements -let data = b"test data"; -let felts = injective_bytes_to_felts(data); +let felts = bytes_to_felts(b"data"); -// Hash field elements directly -let hash = PoseidonCore::hash_padded_felts(felts); -``` +// Get 32-byte hash +let hash: [u8; 32] = hash_to_bytes(&felts); -### Utility Functions +// Get 4 field elements (for chaining) +let hash_felts = hash_to_felts(&felts); +``` -The crate provides several utility functions for converting between different data types and field elements: +### Double Hashing (Wormhole Addresses) ```rust -use qp_poseidon_core::{u64_to_felts, u128_to_felts, injective_string_to_felts}; +use qp_poseidon_core::{hash_twice, rehash_to_bytes}; +use qp_poseidon_core::serialization::bytes_to_felts; + +let felts = bytes_to_felts(b"secret"); -// Convert numbers to field elements -let num_felts = u64_to_felts(12345); -let large_num_felts = u128_to_felts(123456789012345); +// hash(hash(input)) - used for wormhole address derivation +let address: [u8; 32] = hash_twice(&felts); -// Convert strings to field elements (max 8 bytes) -let string_felts = injective_string_to_felts("hello"); +// Re-hash an existing 32-byte digest +let first_hash = hash_to_bytes(&felts); +let second_hash: [u8; 32] = rehash_to_bytes(&first_hash); ``` -### Constants +### Mining (64-byte Output) + +```rust +use qp_poseidon_core::hash_squeeze_twice; + +// Two sponge squeezes for 64-byte output +let hash_512: [u8; 64] = hash_squeeze_twice(b"block data"); +``` + +## Encoding Modes + +### Injective Encoding (Default) -- `FIELD_ELEMENT_PREIMAGE_PADDING_LEN: usize = 160` - Minimum field elements for circuit-compatible padding +Used by `hash_bytes` and `bytes_to_felts`. Safe for variable-length inputs. -### Padding Behavior +- 4 bytes per field element +- Terminator byte (0x01) marks end of input +- Guarantees different inputs produce different field element sequences -- **Padded functions**: Automatically pad input to `FIELD_ELEMENT_PREIMAGE_PADDING_LEN` field elements -- **Unpadded functions**: Hash input as-is without modification -- **Field element conversion**: Uses injective mapping to preserve input uniqueness +### Compact Encoding -## Performance +Used by `bytes_to_felts_compact`. Only safe for fixed-size inputs. -- Optimized for deterministic behavior across platforms -- Memory efficient for constrained environments -- Uses plonky3's optimized field arithmetic -- No heap allocations in core hashing (only in utility functions) +- 8 bytes per field element (full capacity) +- No length marker - trailing zeros collide +- Use only when input size is enforced externally (e.g., ZK circuits) -## Security +## Security Notes -- Built on battle-tested plonky3 field arithmetic -- Implements standard Poseidon permutation -- Circuit-compatible padding prevents length extension attacks -- Extensive test coverage with known test vectors +1. **Always use `hash_bytes` for arbitrary input** - it's collision-resistant +2. **Compact encoding is for circuits only** - where input size is constrained by the circuit +3. **No padding functions** - legacy padded hashing was removed due to audit findings +4. **Timing resistance** - core hashing has no input-dependent branches ## Related Crates -- [`qp-poseidon`](../substrate) - Substrate-compatible wrapper around this core implementation -- [`plonky3`](https://github.com/0xPolygonZero/plonky3) - The underlying field arithmetic and Poseidon implementation +- [`qp-poseidon-constants`](https://crates.io/crates/qp-poseidon-constants) - Round constants +- [`plonky3`](https://github.com/0xPolygonZero/plonky3) - Field arithmetic