diff --git a/.husky/pre-commit b/.husky/pre-commit index 36cb30128e..cb2c84d5c3 100644 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1,4 +1 @@ -pnpm lint -pnpm format:check -pnpm check:license -pnpm check:pnpm +pnpm lint-staged diff --git a/.husky/pre-push b/.husky/pre-push new file mode 100644 index 0000000000..a316c7f6a8 --- /dev/null +++ b/.husky/pre-push @@ -0,0 +1,3 @@ +pnpm lint +pnpm check:pnpm +pnpm check:license \ No newline at end of file diff --git a/Cargo.lock b/Cargo.lock index 7937229399..98d6252123 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -90,7 +90,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e01ed3140b2f8d422c68afa1ed2e85d996ea619c988ac834d255db32138655cb" dependencies = [ "quote", - "syn 2.0.111", + "syn 2.0.114", ] [[package]] @@ -207,7 +207,7 @@ dependencies = [ "actix-router", "proc-macro2", "quote", - "syn 2.0.111", + "syn 2.0.114", ] [[package]] @@ -218,7 +218,7 @@ checksum = "b6ac1e58cded18cb28ddc17143c4dea5345b3ad575e14f32f66e4054a56eb271" dependencies = [ "proc-macro2", "quote", - "syn 2.0.111", + "syn 2.0.114", ] [[package]] @@ -342,9 +342,9 @@ dependencies = [ [[package]] name = "alloy-chains" -version = "0.2.23" +version = "0.2.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35d744058a9daa51a8cf22a3009607498fcf82d3cf4c5444dd8056cdf651f471" +checksum = "ef3a72a2247c34a8545ee99e562b1b9b69168e5000567257ae51e91b4e6b1193" dependencies = [ "alloy-primitives", "num_enum", @@ -374,7 +374,7 @@ dependencies = [ "serde", "serde_json", "serde_with", - "thiserror 2.0.17", + "thiserror 2.0.18", ] [[package]] @@ -411,7 +411,7 @@ dependencies = [ "futures", "futures-util", "serde_json", - "thiserror 2.0.17", + "thiserror 2.0.18", ] [[package]] @@ -453,7 +453,7 @@ dependencies = [ "alloy-rlp", "crc", "serde", - "thiserror 2.0.17", + "thiserror 2.0.18", ] [[package]] @@ -477,7 +477,7 @@ dependencies = [ "alloy-rlp", "k256", "serde", - "thiserror 2.0.17", + "thiserror 2.0.18", ] [[package]] @@ -499,7 +499,7 @@ dependencies = [ "serde", "serde_with", "sha2", - "thiserror 2.0.17", + "thiserror 2.0.18", ] [[package]] @@ -552,7 +552,7 @@ dependencies = [ "http 1.4.0", "serde", "serde_json", - "thiserror 2.0.17", + "thiserror 2.0.18", "tracing", ] @@ -579,7 +579,7 @@ dependencies = [ "futures-utils-wasm", "serde", "serde_json", - "thiserror 2.0.17", + "thiserror 2.0.18", ] [[package]] @@ -611,7 +611,7 @@ dependencies = [ "rand 0.8.5", "serde_json", "tempfile", - "thiserror 2.0.17", + "thiserror 2.0.18", "tracing", "url", ] @@ -629,7 +629,7 @@ dependencies = [ "derive_more", "foldhash", "hashbrown 0.15.5", - "indexmap 2.12.1", + "indexmap 2.13.0", "itoa", "k256", "keccak-asm", @@ -683,7 +683,7 @@ dependencies = [ "reqwest", "serde", "serde_json", - "thiserror 2.0.17", + "thiserror 2.0.18", "tokio", "tracing", "url", @@ -707,7 +707,7 @@ dependencies = [ "serde_json", "tokio", "tokio-stream", - "tower 0.5.2", + "tower 0.5.3", "tracing", "wasmtimer", ] @@ -731,7 +731,7 @@ checksum = "64b728d511962dda67c1bc7ea7c03736ec275ed2cf4c35d9585298ac9ccf3b73" dependencies = [ "proc-macro2", "quote", - "syn 2.0.111", + "syn 2.0.114", ] [[package]] @@ -754,7 +754,7 @@ dependencies = [ "serde_json", "tokio", "tokio-stream", - "tower 0.5.2", + "tower 0.5.3", "tracing", "url", "wasmtimer", @@ -847,7 +847,7 @@ dependencies = [ "serde", "serde_json", "serde_with", - "thiserror 2.0.17", + "thiserror 2.0.18", ] [[package]] @@ -861,7 +861,7 @@ dependencies = [ "alloy-serde", "serde", "serde_json", - "thiserror 2.0.17", + "thiserror 2.0.18", ] [[package]] @@ -899,7 +899,7 @@ dependencies = [ "either", "elliptic-curve", "k256", - "thiserror 2.0.17", + "thiserror 2.0.18", ] [[package]] @@ -915,7 +915,7 @@ dependencies = [ "async-trait", "k256", "rand 0.8.5", - "thiserror 2.0.17", + "thiserror 2.0.18", ] [[package]] @@ -929,7 +929,7 @@ dependencies = [ "proc-macro-error2", "proc-macro2", "quote", - "syn 2.0.111", + "syn 2.0.114", ] [[package]] @@ -942,11 +942,11 @@ dependencies = [ "alloy-sol-macro-input", "const-hex", "heck", - "indexmap 2.12.1", + "indexmap 2.13.0", "proc-macro-error2", "proc-macro2", "quote", - "syn 2.0.111", + "syn 2.0.114", "syn-solidity", "tiny-keccak", ] @@ -965,15 +965,15 @@ dependencies = [ "proc-macro2", "quote", "serde_json", - "syn 2.0.111", + "syn 2.0.114", "syn-solidity", ] [[package]] name = "alloy-sol-type-parser" -version = "1.4.1" +version = "1.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "954d1b2533b9b2c7959652df3076954ecb1122a28cc740aa84e7b0a49f6ac0a9" +checksum = "af67a0b0dcebe14244fc92002cd8d96ecbf65db4639d479f5fcd5805755a4c27" dependencies = [ "serde", "winnow", @@ -1007,9 +1007,9 @@ dependencies = [ "parking_lot 0.12.5", "serde", "serde_json", - "thiserror 2.0.17", + "thiserror 2.0.18", "tokio", - "tower 0.5.2", + "tower 0.5.3", "tracing", "url", "wasmtimer", @@ -1025,7 +1025,7 @@ dependencies = [ "alloy-transport", "reqwest", "serde_json", - "tower 0.5.2", + "tower 0.5.3", "tracing", "url", ] @@ -1070,9 +1070,9 @@ dependencies = [ [[package]] name = "alloy-trie" -version = "0.9.1" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3412d52bb97c6c6cc27ccc28d4e6e8cf605469101193b50b0bd5813b1f990b5" +checksum = "428aa0f0e0658ff091f8f667c406e034b431cb10abd39de4f507520968acc499" dependencies = [ "alloy-primitives", "alloy-rlp", @@ -1093,7 +1093,7 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.111", + "syn 2.0.114", ] [[package]] @@ -1111,6 +1111,12 @@ dependencies = [ "libc", ] +[[package]] +name = "anes" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b46cbb362ab8752921c97e041f5e366ee6297bd428a31275b9fcf1e380f7299" + [[package]] name = "anstream" version = "0.6.21" @@ -1147,7 +1153,7 @@ version = "1.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "40c48f72fd53cd289104fc64099abca73db4166ad86ea0b4341abe65af83dadc" dependencies = [ - "windows-sys 0.60.2", + "windows-sys 0.61.2", ] [[package]] @@ -1158,7 +1164,7 @@ checksum = "291e6a250ff86cd4a820112fb8898808a366d8f9f58ce16d1f538353ad55747d" dependencies = [ "anstyle", "once_cell_polyfill", - "windows-sys 0.60.2", + "windows-sys 0.61.2", ] [[package]] @@ -1324,7 +1330,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "62945a2f7e6de02a31fe400aa489f0e0f5b2502e69f95f853adb82a96c7a6b60" dependencies = [ "quote", - "syn 2.0.111", + "syn 2.0.114", ] [[package]] @@ -1362,7 +1368,7 @@ dependencies = [ "num-traits", "proc-macro2", "quote", - "syn 2.0.111", + "syn 2.0.114", ] [[package]] @@ -1447,7 +1453,7 @@ checksum = "213888f660fddcca0d257e88e54ac05bca01885f258ccdf695bafd77031bb69d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.111", + "syn 2.0.114", ] [[package]] @@ -1519,7 +1525,7 @@ checksum = "965c2d33e53cb6b267e148a4cb0760bc01f4904c1cd4bb4002a085bb016d1490" dependencies = [ "proc-macro2", "quote", - "syn 2.0.111", + "syn 2.0.114", "synstructure", ] @@ -1531,7 +1537,7 @@ checksum = "7b18050c2cd6fe86c3a76584ef5e0baf286d038cda203eb6223df2cc413565f7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.111", + "syn 2.0.114", ] [[package]] @@ -1616,9 +1622,9 @@ dependencies = [ [[package]] name = "async-lock" -version = "3.4.1" +version = "3.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fd03604047cee9b6ce9de9f70c6cd540a0520c813cbd49bae61f33ab80ed1dc" +checksum = "290f7f2596bd5b78a9fec8088ccd89180d7f9f55b94b0576823bbbdc72ee8311" dependencies = [ "event-listener 5.4.1", "event-listener-strategy", @@ -1633,7 +1639,7 @@ checksum = "3b43422f69d8ff38f95f1b2bb76517c91589a924d1559a0e935d7c8ce0274c11" dependencies = [ "proc-macro2", "quote", - "syn 2.0.111", + "syn 2.0.114", ] [[package]] @@ -1682,7 +1688,7 @@ checksum = "c7c24de15d275a1ecfd47a380fb4d5ec9bfe0933f309ed5e705b775596a3574d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.111", + "syn 2.0.114", ] [[package]] @@ -1699,7 +1705,7 @@ checksum = "e539d3fca749fcee5236ab05e93a52867dd549cc157c8cb7f99595f3cedffdb5" dependencies = [ "proc-macro2", "quote", - "syn 2.0.111", + "syn 2.0.114", ] [[package]] @@ -1760,7 +1766,7 @@ checksum = "ffdcb70bdbc4d478427380519163274ac86e52916e10f0a8889adf0f96d3fee7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.111", + "syn 2.0.114", ] [[package]] @@ -1814,9 +1820,9 @@ checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" [[package]] name = "base64ct" -version = "1.8.1" +version = "1.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e050f626429857a27ddccb31e0aca21356bfa709c04041aefddac081a8f068a" +checksum = "2af50177e190e07a26ab74f8b1efbfe2ef87da2116221318cb1c2e82baf7de06" [[package]] name = "bigint-poly" @@ -1916,15 +1922,16 @@ dependencies = [ [[package]] name = "blake3" -version = "1.8.2" +version = "1.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3888aaa89e4b2a40fca9848e400f6a658a5a3978de7be858e209cafa8be9a4a0" +checksum = "2468ef7d57b3fb7e16b576e8377cdbde2320c60e1491e961d11da40fc4f02a2d" dependencies = [ "arrayref", "arrayvec", "cc", "cfg-if", "constant_time_eq", + "cpufeatures", ] [[package]] @@ -2002,9 +2009,9 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.19.0" +version = "3.19.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46c5e41b57b8bba42a04676d81cb89e9ee8e859a1a66f80a5a72e1cb76b34d43" +checksum = "5dd9dc738b7a8311c7ade152424974d8115f2cdad61e8dab8dac9f2362298510" [[package]] name = "byte-slice-cast" @@ -2057,11 +2064,17 @@ dependencies = [ "serde", ] +[[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.49" +version = "1.2.54" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90583009037521a116abf44494efecd645ba48b6622457080f080b85544e2215" +checksum = "6354c81bbfd62d9cfa9cb3c773c2b7b2a3a482d569de977fd0e961f6e7c00583" dependencies = [ "find-msvc-tools", "jobserver", @@ -2096,6 +2109,33 @@ dependencies = [ "windows-link 0.1.3", ] +[[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 = "cipher" version = "0.4.4" @@ -2137,14 +2177,14 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.111", + "syn 2.0.114", ] [[package]] name = "clap_lex" -version = "0.7.6" +version = "0.7.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1d728cc89cf3aee9ff92b05e62b19ee65a02b5702cff7d5a377e32c6ae29d8d" +checksum = "c3e64b0cc0439b12df2fa678eae89a1c56a529fd067a9115f7827f1fffd22b32" [[package]] name = "colorchoice" @@ -2204,9 +2244,9 @@ dependencies = [ [[package]] name = "console" -version = "0.16.1" +version = "0.16.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b430743a6eb14e9764d4260d4c0d8123087d504eeb9c48f2b2a5e810dd369df4" +checksum = "03e45a4a8926227e4197636ba97a9fc9b00477e9f4bd711395687c5f0734bec4" dependencies = [ "encode_unicode", "libc", @@ -2261,9 +2301,9 @@ dependencies = [ [[package]] name = "constant_time_eq" -version = "0.3.1" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c74b8349d32d297c9134b8c88677813a227df8f779daa29bfc29c183fe3dca6" +checksum = "3d52eff69cd5e647efe296129160853a42795992097e8af39800e1060caeea9b" [[package]] name = "convert_case" @@ -2352,6 +2392,42 @@ dependencies = [ "cfg-if", ] +[[package]] +name = "criterion" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2b12d017a929603d80db1831cd3a24082f8137ce19c69e6447f54f5fc8d692f" +dependencies = [ + "anes", + "cast", + "ciborium", + "clap", + "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-channel" version = "0.5.15" @@ -2448,7 +2524,7 @@ checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.111", + "syn 2.0.114", ] [[package]] @@ -2473,7 +2549,7 @@ dependencies = [ "quote", "serde", "strsim", - "syn 2.0.111", + "syn 2.0.114", ] [[package]] @@ -2484,7 +2560,7 @@ checksum = "d38308df82d1080de0afee5d069fa14b0326a88c14f15c5ccda35b4a6c414c81" dependencies = [ "darling_core", "quote", - "syn 2.0.111", + "syn 2.0.114", ] [[package]] @@ -2503,15 +2579,15 @@ dependencies = [ [[package]] name = "data-encoding" -version = "2.9.0" +version = "2.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a2330da5de22e8a3cb63252ce2abb30116bf5265e89c0e01bc17015ce30a476" +checksum = "d7a1e2f27636f116493b8b860f5546edb47c8d8f8ea73e1d2a20be88e28d1fea" [[package]] name = "data-encoding-macro" -version = "0.1.18" +version = "0.1.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47ce6c96ea0102f01122a185683611bd5ac8d99e62bc59dd12e6bda344ee673d" +checksum = "8142a83c17aa9461d637e649271eae18bf2edd00e91f2e105df36c3c16355bdb" dependencies = [ "data-encoding", "data-encoding-macro-internal", @@ -2519,12 +2595,12 @@ dependencies = [ [[package]] name = "data-encoding-macro-internal" -version = "0.1.16" +version = "0.1.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d162beedaa69905488a8da94f5ac3edb4dd4788b732fadb7bd120b2625c1976" +checksum = "7ab67060fc6b8ef687992d439ca0fa36e7ed17e9a0b16b25b601e8757df720de" dependencies = [ "data-encoding", - "syn 1.0.109", + "syn 2.0.114", ] [[package]] @@ -2574,24 +2650,24 @@ dependencies = [ [[package]] name = "derive_more" -version = "2.1.0" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10b768e943bed7bf2cab53df09f4bc34bfd217cdb57d971e769874c9a6710618" +checksum = "d751e9e49156b02b44f9c1815bcb94b984cdcc4396ecc32521c739452808b134" dependencies = [ "derive_more-impl", ] [[package]] name = "derive_more-impl" -version = "2.1.0" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d286bfdaf75e988b4a78e013ecd79c581e06399ab53fbacd2d916c2f904f30b" +checksum = "799a97264921d8623a957f6c3b9011f3b5492f557bbb7a5a19b7fa6d06ba8dcb" dependencies = [ "convert_case", "proc-macro2", "quote", "rustc_version 0.4.1", - "syn 2.0.111", + "syn 2.0.114", "unicode-xid", ] @@ -2677,7 +2753,7 @@ dependencies = [ "libc", "option-ext", "redox_users 0.5.2", - "windows-sys 0.60.2", + "windows-sys 0.61.2", ] [[package]] @@ -2688,7 +2764,7 @@ checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.111", + "syn 2.0.114", ] [[package]] @@ -2705,9 +2781,9 @@ checksum = "aac81fa3e28d21450aa4d2ac065992ba96a1d7303efbce51a95f4fd175b67562" [[package]] name = "dtoa" -version = "1.0.10" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6add3b8cff394282be81f3fc1a0605db594ed69890078ca6e2cab1c408bcf04" +checksum = "4c3cf4824e2d5f025c7b531afcb2325364084a16806f6d47fbc1f5fbd9960590" [[package]] name = "duct" @@ -3384,7 +3460,7 @@ name = "e3-wasm" version = "0.1.7" dependencies = [ "e3-bfv-helpers", - "getrandom 0.2.16", + "getrandom 0.2.17", "serde", "serde-wasm-bindgen", "wasm-bindgen", @@ -3438,7 +3514,7 @@ dependencies = [ "enum-ordinalize", "proc-macro2", "quote", - "syn 2.0.111", + "syn 2.0.114", ] [[package]] @@ -3511,7 +3587,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.111", + "syn 2.0.114", ] [[package]] @@ -3531,7 +3607,7 @@ checksum = "8ca9601fb2d62598ee17836250842873a413586e5d7ed88b356e38ddbb0ec631" dependencies = [ "proc-macro2", "quote", - "syn 2.0.111", + "syn 2.0.114", ] [[package]] @@ -3547,7 +3623,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" dependencies = [ "libc", - "windows-sys 0.52.0", + "windows-sys 0.61.2", ] [[package]] @@ -3725,21 +3801,20 @@ dependencies = [ [[package]] name = "filetime" -version = "0.2.26" +version = "0.2.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc0505cd1b6fa6580283f6bdf70a73fcf4aba1184038c90902b92b3dd0df63ed" +checksum = "f98844151eee8917efc50bd9e8318cb963ae8b297431495d3f758616ea5c57db" dependencies = [ "cfg-if", "libc", "libredox", - "windows-sys 0.60.2", ] [[package]] name = "find-msvc-tools" -version = "0.1.5" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a3076410a55c90011c298b04d0cfa770b00fa04e1e3c97d3f6c9de105a03844" +checksum = "8591b0bcc8a98a64310a2fae1bb3e9b8564dd10e381e6e28010fde8e8e8568db" [[package]] name = "fixed-hash" @@ -3761,9 +3836,9 @@ checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" [[package]] name = "flate2" -version = "1.1.5" +version = "1.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfe33edd8e85a12a67454e37f8c75e730830d83e313556ab9ebf9ee7fbeb3bfb" +checksum = "b375d6465b98090a5f25b1c7703f3859783755aa9a80433b36e0379a3ec2f369" dependencies = [ "crc32fast", "miniz_oxide", @@ -3901,7 +3976,7 @@ checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", - "syn 2.0.111", + "syn 2.0.114", ] [[package]] @@ -3990,9 +4065,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.16" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "335ff9f135e4384c8150d6f27c6daed433577f86b4750418338c01a1a2528592" +checksum = "ff2abc00be7fca6ebc474524697ae276ad847ad0a6b3faa4bcb027e9a4614ad0" dependencies = [ "cfg-if", "js-sys", @@ -4087,7 +4162,7 @@ dependencies = [ "futures-sink", "futures-util", "http 0.2.12", - "indexmap 2.12.1", + "indexmap 2.13.0", "slab", "tokio", "tokio-util", @@ -4096,9 +4171,9 @@ dependencies = [ [[package]] name = "h2" -version = "0.4.12" +version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3c0b69cfcb4e1b9f1bf2f53f95f766e4661169728ec61cd3fe5a0166f2d1386" +checksum = "2f44da3a8150a6703ed5d34e164b875fd14c2cdab9af1252a9a1020bde2bdc54" dependencies = [ "atomic-waker", "bytes", @@ -4106,13 +4181,24 @@ dependencies = [ "futures-core", "futures-sink", "http 1.4.0", - "indexmap 2.12.1", + "indexmap 2.13.0", "slab", "tokio", "tokio-util", "tracing", ] +[[package]] +name = "half" +version = "2.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ea2d84b969582b4b1864a92dc5d27cd2b77b622a8d79306834f1be5ba20d84b" +dependencies = [ + "cfg-if", + "crunchy", + "zerocopy", +] + [[package]] name = "hashbrown" version = "0.12.3" @@ -4350,7 +4436,7 @@ dependencies = [ "bytes", "futures-channel", "futures-core", - "h2 0.4.12", + "h2 0.4.13", "http 1.4.0", "http-body 1.0.1", "httparse", @@ -4376,7 +4462,7 @@ dependencies = [ "tokio", "tokio-rustls", "tower-service", - "webpki-roots 1.0.4", + "webpki-roots 1.0.5", ] [[package]] @@ -4426,7 +4512,7 @@ dependencies = [ "libc", "percent-encoding", "pin-project-lite", - "socket2 0.6.1", + "socket2 0.6.2", "system-configuration", "tokio", "tower-service", @@ -4641,7 +4727,7 @@ checksum = "a0eb5a3343abf848c0984fe4604b2b105da9539376e24fc0a3b0007411ae4fd9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.111", + "syn 2.0.114", ] [[package]] @@ -4663,9 +4749,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.12.1" +version = "2.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ad4bb2b565bca0645f4d68c5c9af97fba094e9791da685bf83cb5f3ce74acf2" +checksum = "7714e70437a7dc3ac8eb7e6f8df75fd8eb422675fc7678aff7364301092b1017" dependencies = [ "equivalent", "hashbrown 0.16.1", @@ -4692,7 +4778,7 @@ version = "0.18.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9375e112e4b463ec1b1c6c011953545c65a30164fbab5b581df32b3abf0dcb88" dependencies = [ - "console 0.16.1", + "console 0.16.2", "portable-atomic", "unicode-width", "unit-prefix", @@ -4763,14 +4849,25 @@ checksum = "469fb0b9cefa57e3ef31275ee7cacb78f2fdca44e4765491884a2b119d4eb130" [[package]] name = "iri-string" -version = "0.7.9" +version = "0.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f867b9d1d896b67beb18518eda36fdb77a32ea590de864f1325b294a6d14397" +checksum = "c91338f0783edbd6195decb37bae672fd3b165faffb89bf7b9e6942f8b1a731a" dependencies = [ "memchr", "serde", ] +[[package]] +name = "is-terminal" +version = "0.4.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3640c1c38b8e4e43584d8df18be5fc6b0aa314ce6ebf51b53313d4306cca8e46" +dependencies = [ + "hermit-abi", + "libc", + "windows-sys 0.61.2", +] + [[package]] name = "is_terminal_polyfill" version = "1.70.2" @@ -4815,9 +4912,9 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.15" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" +checksum = "92ecc6618181def0457392ccd0ee51198e065e016d1d527a7ac1b6dc7c1f09d2" [[package]] name = "jobserver" @@ -4831,9 +4928,9 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.83" +version = "0.3.85" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "464a3709c7f55f1f721e5389aa6ea4e3bc6aba669353300af094b29ffbdde1d8" +checksum = "8c942ebf8e95485ca0d52d97da7c5a2c387d0e7f0ba4c35e93bfcaee045955b3" dependencies = [ "once_cell", "wasm-bindgen", @@ -4907,9 +5004,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.178" +version = "0.2.180" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37c93d8daa9d8a012fd8ab92f088405fb202ea0b6ab73ee2482ae66af4f42091" +checksum = "bcc35a38544a891a5f7c865aca548a982ccb3b8650a5b06d0fd33a10283c56fc" [[package]] name = "libgit2-sys" @@ -4941,7 +5038,7 @@ dependencies = [ "either", "futures", "futures-timer", - "getrandom 0.2.16", + "getrandom 0.2.17", "libp2p-allow-block-list", "libp2p-connection-limits", "libp2p-core", @@ -5045,7 +5142,7 @@ dependencies = [ "fnv", "futures", "futures-ticker", - "getrandom 0.2.16", + "getrandom 0.2.17", "hex_fmt", "libp2p-core", "libp2p-identity", @@ -5098,7 +5195,7 @@ dependencies = [ "quick-protobuf", "rand 0.8.5", "sha2", - "thiserror 2.0.17", + "thiserror 2.0.18", "tracing", "zeroize", ] @@ -5247,7 +5344,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.111", + "syn 2.0.114", ] [[package]] @@ -5304,13 +5401,13 @@ dependencies = [ [[package]] name = "libredox" -version = "0.1.10" +version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "416f7e718bdb06000964960ffa43b4335ad4012ae8b99060261aa4a8088d5ccb" +checksum = "3d0b95e02c851351f877147b7deea7b1afb1df71b63aa5f8270716e0c5720616" dependencies = [ "bitflags 2.10.0", "libc", - "redox_syscall 0.5.18", + "redox_syscall 0.7.0", ] [[package]] @@ -5445,18 +5542,18 @@ checksum = "1b27834086c65ec3f9387b096d66e99f221cf081c2b738042aa252bcd41204e3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.111", + "syn 2.0.114", ] [[package]] name = "match-lookup" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1265724d8cb29dbbc2b0f06fffb8bf1a8c0cf73a78eede9ba73a4a66c52a981e" +checksum = "757aee279b8bdbb9f9e676796fd459e4207a1f986e87886700abf589f5abf771" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.114", ] [[package]] @@ -5667,17 +5764,17 @@ dependencies = [ "log", "netlink-packet-core", "netlink-sys", - "thiserror 2.0.17", + "thiserror 2.0.18", ] [[package]] name = "netlink-sys" -version = "0.8.7" +version = "0.8.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16c903aa70590cb93691bf97a767c8d1d6122d2cc9070433deb3bbf36ce8bd23" +checksum = "cd6c30ed10fa69cc491d491b85cc971f6bdeb8e7367b7cde2ee6cc878d583fae" dependencies = [ "bytes", - "futures", + "futures-util", "libc", "log", "tokio", @@ -5840,7 +5937,7 @@ checksum = "ff32365de1b6743cb203b710788263c44a03de03802daf96092f2da4fe6ba4d7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.111", + "syn 2.0.114", ] [[package]] @@ -5851,9 +5948,9 @@ checksum = "830b246a0e5f20af87141b25c173cd1b609bd7779a4617d6ec582abaf90870f3" [[package]] name = "nybbles" -version = "0.4.6" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c4b5ecbd0beec843101bffe848217f770e8b8da81d8355b7d6e226f2199b3dc" +checksum = "7b5676b5c379cf5b03da1df2b3061c4a4e2aa691086a56ac923e08c143f53f59" dependencies = [ "alloy-rlp", "cfg-if", @@ -5893,6 +5990,12 @@ version = "1.70.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "384b8ab6d37215f3c5301a95a4accb5d64aa607f1fcb26a11b5303878451b4fe" +[[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" @@ -5922,7 +6025,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.111", + "syn 2.0.114", ] [[package]] @@ -5953,7 +6056,7 @@ dependencies = [ "futures-sink", "js-sys", "pin-project-lite", - "thiserror 2.0.17", + "thiserror 2.0.18", "tracing", ] @@ -5985,7 +6088,7 @@ dependencies = [ "opentelemetry_sdk", "prost 0.13.5", "reqwest", - "thiserror 2.0.17", + "thiserror 2.0.18", "tokio", "tonic", "tracing", @@ -6029,7 +6132,7 @@ dependencies = [ "percent-encoding", "rand 0.9.2", "serde_json", - "thiserror 2.0.17", + "thiserror 2.0.18", "tracing", ] @@ -6046,7 +6149,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7d8fae84b431384b68627d0f9b3b1245fcf9f46f6c0e3dc902e9dce64edd1967" dependencies = [ "libc", - "windows-sys 0.48.0", + "windows-sys 0.61.2", ] [[package]] @@ -6090,7 +6193,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.111", + "syn 2.0.114", ] [[package]] @@ -6188,9 +6291,9 @@ checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220" [[package]] name = "pest" -version = "2.8.4" +version = "2.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbcfd20a6d4eeba40179f05735784ad32bdaef05ce8e8af05f180d45bb3e7e22" +checksum = "2c9eb05c21a464ea704b53158d358a31e6425db2f63a1a7312268b05fe2b75f7" dependencies = [ "memchr", "ucd-trie", @@ -6203,7 +6306,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b4c5cc86750666a3ed20bdaf5ca2a0344f9c67674cae0515bec2da16fbaa47db" dependencies = [ "fixedbitset", - "indexmap 2.12.1", + "indexmap 2.13.0", ] [[package]] @@ -6260,7 +6363,7 @@ dependencies = [ "phf_shared", "proc-macro2", "quote", - "syn 2.0.111", + "syn 2.0.114", ] [[package]] @@ -6289,7 +6392,7 @@ checksum = "6e918e4ff8c4549eb882f14b3a4bc8c8bc93de829416eacf579f1207a8fbf861" dependencies = [ "proc-macro2", "quote", - "syn 2.0.111", + "syn 2.0.114", ] [[package]] @@ -6331,6 +6434,34 @@ version = "0.3.32" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c" +[[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 = "polling" version = "3.11.0" @@ -6345,6 +6476,18 @@ dependencies = [ "windows-sys 0.61.2", ] +[[package]] +name = "polynomial" +version = "0.1.7" +dependencies = [ + "bincode", + "criterion", + "num-bigint", + "num-traits", + "serde", + "thiserror 1.0.69", +] + [[package]] name = "polyval" version = "0.6.2" @@ -6359,9 +6502,9 @@ dependencies = [ [[package]] name = "portable-atomic" -version = "1.11.1" +version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f84267b20a16ea918e43c6a88433c2d54fa145c92a811b5b047ccbe153674483" +checksum = "f89776e4d69bb58bc6993e99ffa1d11f228b839984854c7daeb5d37f87cbe950" [[package]] name = "potential_utf" @@ -6394,7 +6537,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "479ca8adacdd7ce8f1fb39ce9ecccbfe93a3f1344b3d0d97f20bc0196208f62b" dependencies = [ "proc-macro2", - "syn 2.0.111", + "syn 2.0.114", ] [[package]] @@ -6425,7 +6568,7 @@ version = "3.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "219cb19e96be00ab2e37d6e299658a0cfa83e52429179969b0f0121b4ac46983" dependencies = [ - "toml_edit 0.23.9", + "toml_edit 0.23.10+spec-1.0.0", ] [[package]] @@ -6447,14 +6590,14 @@ dependencies = [ "proc-macro-error-attr2", "proc-macro2", "quote", - "syn 2.0.111", + "syn 2.0.114", ] [[package]] name = "proc-macro2" -version = "1.0.103" +version = "1.0.106" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ee95bc4ef87b8d5ba32e8b7714ccc834865276eab0aed5c9958d00ec45f49e8" +checksum = "8fd00f0bb2e90d81d1044c2b32617f68fcb9fa3bb7640c23e9c748e53fb30934" dependencies = [ "unicode-ident", ] @@ -6479,7 +6622,7 @@ checksum = "440f724eba9f6996b75d63681b0a92b06947f1457076d503a4d2e2c8f56442b8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.111", + "syn 2.0.114", ] [[package]] @@ -6538,7 +6681,7 @@ dependencies = [ "prost 0.12.6", "prost-types", "regex", - "syn 2.0.111", + "syn 2.0.114", "tempfile", ] @@ -6552,7 +6695,7 @@ dependencies = [ "itertools 0.12.1", "proc-macro2", "quote", - "syn 2.0.111", + "syn 2.0.114", ] [[package]] @@ -6565,7 +6708,7 @@ dependencies = [ "itertools 0.14.0", "proc-macro2", "quote", - "syn 2.0.111", + "syn 2.0.114", ] [[package]] @@ -6619,8 +6762,8 @@ dependencies = [ "quinn-udp", "rustc-hash", "rustls", - "socket2 0.6.1", - "thiserror 2.0.17", + "socket2 0.6.2", + "thiserror 2.0.18", "tokio", "tracing", "web-time", @@ -6641,7 +6784,7 @@ dependencies = [ "rustls", "rustls-pki-types", "slab", - "thiserror 2.0.17", + "thiserror 2.0.18", "tinyvec", "tracing", "web-time", @@ -6656,16 +6799,16 @@ dependencies = [ "cfg_aliases", "libc", "once_cell", - "socket2 0.6.1", + "socket2 0.6.2", "tracing", "windows-sys 0.60.2", ] [[package]] name = "quote" -version = "1.0.42" +version = "1.0.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a338cc41d27e6cc6dce6cefc13a0729dfbb81c262b1f519331575dd80ef3067f" +checksum = "21b2ebcf727b7760c461f091f9f0f539b77b8e87f2fd88131e7f1b433b3cece4" dependencies = [ "proc-macro2", ] @@ -6701,7 +6844,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6db2770f06117d490610c7488547d543617b21bfa07796d7a12f6f1bd53850d1" dependencies = [ "rand_chacha 0.9.0", - "rand_core 0.9.3", + "rand_core 0.9.5", "serde", ] @@ -6722,7 +6865,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d3022b5f1df60f26e1ffddd6c66e8aa15de382ae63b3a0c1bfc0e4d3e3f325cb" dependencies = [ "ppv-lite86", - "rand_core 0.9.3", + "rand_core 0.9.5", ] [[package]] @@ -6731,14 +6874,14 @@ version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" dependencies = [ - "getrandom 0.2.16", + "getrandom 0.2.17", ] [[package]] name = "rand_core" -version = "0.9.3" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99d9a13982dcf210057a8a78572b2217b667c3beacbf3a0d8b454f6f82837d38" +checksum = "76afc826de14238e6e8c374ddcc1fa19e374fd8dd986b0d2af0d02377261d83c" dependencies = [ "getrandom 0.3.4", "serde", @@ -6760,7 +6903,7 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "513962919efc330f829edb2535844d1b912b0fbe2ca165d613e4e8788bb05a5a" dependencies = [ - "rand_core 0.9.3", + "rand_core 0.9.5", ] [[package]] @@ -6825,13 +6968,22 @@ dependencies = [ "bitflags 2.10.0", ] +[[package]] +name = "redox_syscall" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49f3fe0889e69e2ae9e41f4d6c4c0181701d00e4697b356fb1f74173a5e0ee27" +dependencies = [ + "bitflags 2.10.0", +] + [[package]] name = "redox_users" version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ba009ff324d1fc1b900bd1fdb31564febe58a8ccc8a6fdbb93b543d33b13ca43" dependencies = [ - "getrandom 0.2.16", + "getrandom 0.2.17", "libredox", "thiserror 1.0.69", ] @@ -6842,9 +6994,9 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a4e608c6638b9c18977b00b475ac1f28d14e84b27d8d42f70e0bf1e3dec127ac" dependencies = [ - "getrandom 0.2.16", + "getrandom 0.2.17", "libredox", - "thiserror 2.0.17", + "thiserror 2.0.18", ] [[package]] @@ -6864,7 +7016,7 @@ checksum = "b7186006dcb21920990093f30e3dea63b7d6e977bf1256be20c3563a5db070da" dependencies = [ "proc-macro2", "quote", - "syn 2.0.111", + "syn 2.0.114", ] [[package]] @@ -6929,7 +7081,7 @@ dependencies = [ "futures-channel", "futures-core", "futures-util", - "h2 0.4.12", + "h2 0.4.13", "http 1.4.0", "http-body 1.0.1", "http-body-util", @@ -6953,14 +7105,14 @@ dependencies = [ "tokio", "tokio-native-tls", "tokio-rustls", - "tower 0.5.2", + "tower 0.5.3", "tower-http", "tower-service", "url", "wasm-bindgen", "wasm-bindgen-futures", "web-sys", - "webpki-roots 1.0.4", + "webpki-roots 1.0.5", ] [[package]] @@ -7002,7 +7154,7 @@ checksum = "a4689e6c2294d81e88dc6261c768b63bc4fcdb852be6d1352498b114f61383b7" dependencies = [ "cc", "cfg-if", - "getrandom 0.2.16", + "getrandom 0.2.17", "libc", "untrusted 0.9.0", "windows-sys 0.52.0", @@ -7038,9 +7190,9 @@ dependencies = [ [[package]] name = "ruint" -version = "1.17.0" +version = "1.17.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a68df0380e5c9d20ce49534f292a36a7514ae21350726efe1865bdb1fa91d278" +checksum = "c141e807189ad38a07276942c6623032d3753c8859c146104ac2e4d68865945a" dependencies = [ "alloy-rlp", "ark-ff 0.3.0", @@ -7072,9 +7224,9 @@ checksum = "48fd7bd8a6377e15ad9d42a8ec25371b94ddc67abe7c8b9127bec79bebaaae18" [[package]] name = "rustc-demangle" -version = "0.1.26" +version = "0.1.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56f7d92ca342cea22a06f2121d944b4fd82af56988c270852495420f961d4ace" +checksum = "b50b8869d9fc858ce7266cce0194bd74df58b9d0e3f6df3a9fc8eb470d95c09d" [[package]] name = "rustc-hash" @@ -7117,36 +7269,36 @@ dependencies = [ [[package]] name = "rustix" -version = "1.1.2" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd15f8a2c5551a84d56efdc1cd049089e409ac19a3072d5037a17fd70719ff3e" +checksum = "146c9e247ccc180c1f61615433868c99f3de3ae256a30a43b49f67c2d9171f34" dependencies = [ "bitflags 2.10.0", "errno", "libc", "linux-raw-sys", - "windows-sys 0.52.0", + "windows-sys 0.61.2", ] [[package]] name = "rustls" -version = "0.23.35" +version = "0.23.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "533f54bc6a7d4f647e46ad909549eda97bf5afc1585190ef692b4286b198bd8f" +checksum = "c665f33d38cea657d9614f766881e4d510e0eda4239891eea56b4cadcf01801b" dependencies = [ "once_cell", "ring 0.17.14", "rustls-pki-types", - "rustls-webpki 0.103.8", + "rustls-webpki 0.103.9", "subtle", "zeroize", ] [[package]] name = "rustls-pki-types" -version = "1.13.1" +version = "1.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "708c0f9d5f54ba0272468c1d306a52c495b31fa155e91bc25371e6df7996908c" +checksum = "be040f8b0a225e40375822a563fa9524378b9d63112f53e19ffff34df5d33fdd" dependencies = [ "web-time", "zeroize", @@ -7164,9 +7316,9 @@ dependencies = [ [[package]] name = "rustls-webpki" -version = "0.103.8" +version = "0.103.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ffdfa2f5286e2247234e03f680868ac2815974dc39e00ea15adc445d0aafe52" +checksum = "d7df23109aa6c1567d1c575b9952556388da57401e4ace1d15f79eedad0d8f53" dependencies = [ "ring 0.17.14", "rustls-pki-types", @@ -7204,9 +7356,9 @@ dependencies = [ [[package]] name = "ryu" -version = "1.0.20" +version = "1.0.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f" +checksum = "a50f4cf475b65d88e057964e0e9bb1f0aa9bbb2036dc65c64596b42932536984" [[package]] name = "safe" @@ -7222,7 +7374,7 @@ dependencies = [ [[package]] name = "safe" version = "0.1.7" -source = "git+https://github.com/gnosisguild/enclave#dd9095cb560ff1b8c3c8e36cfd6ed2edf86ed2c2" +source = "git+https://github.com/gnosisguild/enclave#a3ef19d64142e5dd6916864c6d3dbc82f55f2bf8" dependencies = [ "ark-bn254 0.5.0", "ark-ff 0.5.0", @@ -7231,6 +7383,15 @@ dependencies = [ "taceo-poseidon2", ] +[[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 = "scc" version = "2.4.0" @@ -7263,9 +7424,9 @@ dependencies = [ [[package]] name = "schemars" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9558e172d4e8533736ba97870c4b2cd63f84b382a3d6eb063da41b91cce17289" +checksum = "54e910108742c57a770f492731f99be216a52fadd361b06c8fb59d74ccc267d2" dependencies = [ "dyn-clone", "ref-cast", @@ -7412,7 +7573,7 @@ checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" dependencies = [ "proc-macro2", "quote", - "syn 2.0.111", + "syn 2.0.114", ] [[package]] @@ -7458,9 +7619,9 @@ dependencies = [ "chrono", "hex", "indexmap 1.9.3", - "indexmap 2.12.1", + "indexmap 2.13.0", "schemars 0.9.0", - "schemars 1.1.0", + "schemars 1.2.0", "serde", "serde_derive", "serde_json", @@ -7477,7 +7638,7 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.111", + "syn 2.0.114", ] [[package]] @@ -7486,7 +7647,7 @@ version = "0.9.34+deprecated" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a8b1a1a2ebf674015cc02edccce75287f1a0130d394307b36743c2f5d504b47" dependencies = [ - "indexmap 2.12.1", + "indexmap 2.13.0", "itoa", "ryu", "serde", @@ -7525,7 +7686,7 @@ checksum = "5d69265a08751de7844521fd15003ae0a888e035773ba05695c5c759a6f89eef" dependencies = [ "proc-macro2", "quote", - "syn 2.0.111", + "syn 2.0.114", ] [[package]] @@ -7640,10 +7801,11 @@ dependencies = [ [[package]] name = "signal-hook-registry" -version = "1.4.7" +version = "1.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7664a098b8e616bdfcc2dc0e9ac44eb231eedf41db4e9fe95d8d32ec728dedad" +checksum = "c4db69cba1110affc0e9f7bcd48bbf87b3f4fc7c61fc9155afd4c469eb3d6c1b" dependencies = [ + "errno", "libc", ] @@ -7712,9 +7874,9 @@ dependencies = [ [[package]] name = "socket2" -version = "0.6.1" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17129e116933cf371d018bb80ae557e889637989d8638274fb25622827b03881" +checksum = "86f4aa3ad99f2088c990dfa82d367e19cb29268ed67c574d10d0a4bfe71f07e0" dependencies = [ "libc", "windows-sys 0.60.2", @@ -7778,7 +7940,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.111", + "syn 2.0.114", ] [[package]] @@ -7800,9 +7962,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.111" +version = "2.0.114" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "390cc9a294ab71bdb1aa2e99d13be9c753cd2d7bd6560c77118597410c4d2e87" +checksum = "d4d107df263a3013ef9b1879b0df87d706ff80f65a86ea879bd9c31f9b307c2a" dependencies = [ "proc-macro2", "quote", @@ -7811,14 +7973,14 @@ dependencies = [ [[package]] name = "syn-solidity" -version = "1.4.1" +version = "1.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff790eb176cc81bb8936aed0f7b9f14fc4670069a2d371b3e3b0ecce908b2cb3" +checksum = "5f92d01b5de07eaf324f7fca61cc6bd3d82bbc1de5b6c963e6fe79e86f36580d" dependencies = [ "paste", "proc-macro2", "quote", - "syn 2.0.111", + "syn 2.0.114", ] [[package]] @@ -7838,7 +8000,7 @@ checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2" dependencies = [ "proc-macro2", "quote", - "syn 2.0.111", + "syn 2.0.114", ] [[package]] @@ -7864,9 +8026,9 @@ dependencies = [ [[package]] name = "taceo-poseidon2" -version = "0.2.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fbf106fb8682ee4e057872a18f431828bd467c28d2ead469e4c84dbf6ce5ec6" +checksum = "ac59d3df4c827b3496bff929aebd6440997a5c2e946f46ff4fdd76f318447581" dependencies = [ "ark-bn254 0.5.0", "ark-ff 0.5.0", @@ -7902,7 +8064,7 @@ dependencies = [ "getrandom 0.3.4", "once_cell", "rustix", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -7916,11 +8078,11 @@ dependencies = [ [[package]] name = "thiserror" -version = "2.0.17" +version = "2.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f63587ca0f12b72a0600bcba1d40081f830876000bb46dd2337a3051618f4fc8" +checksum = "4288b5bcbc7920c07a1149a35cf9590a2aa808e0bc1eafaade0b80947865fbc4" dependencies = [ - "thiserror-impl 2.0.17", + "thiserror-impl 2.0.18", ] [[package]] @@ -7931,18 +8093,18 @@ checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.111", + "syn 2.0.114", ] [[package]] name = "thiserror-impl" -version = "2.0.17" +version = "2.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ff15c8ecd7de3849db632e14d18d2571fa09dfc5ed93479bc4485c7a517c913" +checksum = "ebc4ee7f67670e9b64d05fa4253e753e016c6c95ff35b89b7941d6b856dec1d5" dependencies = [ "proc-macro2", "quote", - "syn 2.0.111", + "syn 2.0.114", ] [[package]] @@ -7965,30 +8127,30 @@ dependencies = [ [[package]] name = "time" -version = "0.3.44" +version = "0.3.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91e7d9e3bb61134e77bde20dd4825b97c010155709965fedf0f49bb138e52a9d" +checksum = "f9e442fc33d7fdb45aa9bfeb312c095964abdf596f7567261062b2a7107aaabd" dependencies = [ "deranged", "itoa", "num-conv", "powerfmt", - "serde", + "serde_core", "time-core", "time-macros", ] [[package]] name = "time-core" -version = "0.1.6" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40868e7c1d2f0b8d73e4a8c7f0ff63af4f6d19be117e90bd73eb1d62cf831c6b" +checksum = "8b36ee98fd31ec7426d599183e8fe26932a8dc1fb76ddb6214d05493377d34ca" [[package]] name = "time-macros" -version = "0.2.24" +version = "0.2.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30cfb0125f12d9c277f35663a0a33f8c30190f4e4574868a330595412d34ebf3" +checksum = "71e552d1249bf61ac2a52db88179fd0673def1e1ad8243a00d9ec9ed71fee3dd" dependencies = [ "num-conv", "time-core", @@ -8013,6 +8175,16 @@ dependencies = [ "zerovec", ] +[[package]] +name = "tinytemplate" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be4d6b5f19ff7664e8c98d03e2139cb510db9b0a60b55f8e8709b689d939b6bc" +dependencies = [ + "serde", + "serde_json", +] + [[package]] name = "tinyvec" version = "1.10.0" @@ -8056,7 +8228,7 @@ checksum = "6e06d43f1345a3bcd39f6a56dbb7dcab2ba47e68e8ac134855e7e2bdbaf8cab8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.111", + "syn 2.0.114", ] [[package]] @@ -8081,9 +8253,9 @@ dependencies = [ [[package]] name = "tokio-stream" -version = "0.1.17" +version = "0.1.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eca58d7bba4a75707817a2c44174253f9236b2d5fbd055602e9d5c07c139a047" +checksum = "32da49809aab5c3bc678af03902d4ccddea2a87d028d86392a4b1560c6906c70" dependencies = [ "futures-core", "pin-project-lite", @@ -8109,9 +8281,9 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.17" +version = "0.7.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2efa149fe76073d6e8fd97ef4f4eca7b67f599660115591483572e406e165594" +checksum = "9ae9cec805b01e8fc3fd2fe289f89149a9b66dd16786abd8b19cfa7b48cb0098" dependencies = [ "bytes", "futures-core", @@ -8143,9 +8315,9 @@ dependencies = [ [[package]] name = "toml_datetime" -version = "0.7.3" +version = "0.7.5+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2cdb639ebbc97961c51720f858597f7f24c4fc295327923af55b74c3c724533" +checksum = "92e1cfed4a3038bc5a127e35a2d360f145e1f4b971b551a2ba5fd7aedf7e1347" dependencies = [ "serde_core", ] @@ -8156,7 +8328,7 @@ version = "0.22.27" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "41fe8c660ae4257887cf66394862d21dbca4a6ddd26f04a3560410406a2f819a" dependencies = [ - "indexmap 2.12.1", + "indexmap 2.13.0", "serde", "serde_spanned", "toml_datetime 0.6.11", @@ -8166,21 +8338,21 @@ dependencies = [ [[package]] name = "toml_edit" -version = "0.23.9" +version = "0.23.10+spec-1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d7cbc3b4b49633d57a0509303158ca50de80ae32c265093b24c414705807832" +checksum = "84c8b9f757e028cee9fa244aea147aab2a9ec09d5325a9b01e0a49730c2b5269" dependencies = [ - "indexmap 2.12.1", - "toml_datetime 0.7.3", + "indexmap 2.13.0", + "toml_datetime 0.7.5+spec-1.1.0", "toml_parser", "winnow", ] [[package]] name = "toml_parser" -version = "1.0.4" +version = "1.0.6+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0cbe268d35bdb4bb5a56a2de88d0ad0eb70af5384a99d648cd4b3d04039800e" +checksum = "a3198b4b0a8e11f09dd03e133c0280504d0801269e9afa46362ffde1cbeebf44" dependencies = [ "winnow", ] @@ -8239,9 +8411,9 @@ dependencies = [ [[package]] name = "tower" -version = "0.5.2" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d039ad9159c98b70ecfd540b2573b97f7f52c3e8d9f8ad57a24b916a536975f9" +checksum = "ebe5ef63511595f1344e2d5cfa636d973292adc0eec1f0ad45fae9f0851ab1d4" dependencies = [ "futures-core", "futures-util", @@ -8265,7 +8437,7 @@ dependencies = [ "http-body 1.0.1", "iri-string", "pin-project-lite", - "tower 0.5.2", + "tower 0.5.3", "tower-layer", "tower-service", ] @@ -8302,14 +8474,14 @@ checksum = "7490cfa5ec963746568740651ac6781f701c9c5ea257c58e057f3ba8cf69e8da" dependencies = [ "proc-macro2", "quote", - "syn 2.0.111", + "syn 2.0.114", ] [[package]] name = "tracing-core" -version = "0.1.35" +version = "0.1.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a04e24fab5c89c6a36eb8558c9656f30d81de51dfa4d3b45f26b21d61fa0a6c" +checksum = "db97caf9d906fbde555dd62fa95ddba9eecfd14cb388e4f491a66d74cd5fb79a" dependencies = [ "once_cell", "valuable", @@ -8381,7 +8553,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "04659ddb06c87d233c566112c1c9c5b9e98256d9af50ec3bc9c8327f873a7568" dependencies = [ "quote", - "syn 2.0.111", + "syn 2.0.114", ] [[package]] @@ -8405,7 +8577,7 @@ dependencies = [ "rustls", "rustls-pki-types", "sha1", - "thiserror 2.0.17", + "thiserror 2.0.18", "utf-8", ] @@ -8599,6 +8771,16 @@ dependencies = [ "libc", ] +[[package]] +name = "walkdir" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" +dependencies = [ + "same-file", + "winapi-util", +] + [[package]] name = "want" version = "0.3.1" @@ -8625,9 +8807,9 @@ dependencies = [ [[package]] name = "wasm-bindgen" -version = "0.2.106" +version = "0.2.108" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d759f433fa64a2d763d1340820e46e111a7a5ab75f993d1852d70b03dbb80fd" +checksum = "64024a30ec1e37399cf85a7ffefebdb72205ca1c972291c51512360d90bd8566" dependencies = [ "cfg-if", "once_cell", @@ -8638,11 +8820,12 @@ dependencies = [ [[package]] name = "wasm-bindgen-futures" -version = "0.4.56" +version = "0.4.58" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "836d9622d604feee9e5de25ac10e3ea5f2d65b41eac0d9ce72eb5deae707ce7c" +checksum = "70a6e77fd0ae8029c9ea0063f87c46fde723e7d887703d74ad2616d792e51e6f" dependencies = [ "cfg-if", + "futures-util", "js-sys", "once_cell", "wasm-bindgen", @@ -8651,9 +8834,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.106" +version = "0.2.108" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48cb0d2638f8baedbc542ed444afc0644a29166f1595371af4fecf8ce1e7eeb3" +checksum = "008b239d9c740232e71bd39e8ef6429d27097518b6b30bdf9086833bd5b6d608" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -8661,22 +8844,22 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.106" +version = "0.2.108" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cefb59d5cd5f92d9dcf80e4683949f15ca4b511f4ac0a6e14d4e1ac60c6ecd40" +checksum = "5256bae2d58f54820e6490f9839c49780dff84c65aeab9e772f15d5f0e913a55" dependencies = [ "bumpalo", "proc-macro2", "quote", - "syn 2.0.111", + "syn 2.0.114", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.106" +version = "0.2.108" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbc538057e648b67f72a982e708d485b2efa771e1ac05fec311f9f63e5800db4" +checksum = "1f01b580c9ac74c8d8f0c0e4afb04eeef2acf145458e52c03845ee9cd23e3d12" dependencies = [ "unicode-ident", ] @@ -8697,9 +8880,9 @@ dependencies = [ [[package]] name = "web-sys" -version = "0.3.83" +version = "0.3.85" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b32828d774c412041098d182a8b38b16ea816958e07cf40eec2bc080ae137ac" +checksum = "312e32e551d92129218ea9a2452120f4aabc03529ef03e4d0d82fb2780608598" dependencies = [ "js-sys", "wasm-bindgen", @@ -8721,14 +8904,14 @@ version = "0.26.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "521bc38abb08001b01866da9f51eb7c5d647a19260e00054a8c7fd5f9e57f7a9" dependencies = [ - "webpki-roots 1.0.4", + "webpki-roots 1.0.5", ] [[package]] name = "webpki-roots" -version = "1.0.4" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2878ef029c47c6e8cf779119f20fcf52bde7ad42a731b2a304bc221df17571e" +checksum = "12bed680863276c63889429bfd6cab3b99943659923822de1c8a39c49e4d722c" dependencies = [ "rustls-pki-types", ] @@ -8755,6 +8938,15 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" +[[package]] +name = "winapi-util" +version = "0.1.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22" +dependencies = [ + "windows-sys 0.61.2", +] + [[package]] name = "winapi-x86_64-pc-windows-gnu" version = "0.4.0" @@ -8802,7 +8994,7 @@ checksum = "053e2e040ab57b9dc951b72c264860db7eb3b0200ba345b4e4c3b14f67855ddf" dependencies = [ "proc-macro2", "quote", - "syn 2.0.111", + "syn 2.0.114", ] [[package]] @@ -8813,7 +9005,7 @@ checksum = "3f316c4a2570ba26bbec722032c4099d8c8bc095efccdc15688708623367e358" dependencies = [ "proc-macro2", "quote", - "syn 2.0.111", + "syn 2.0.114", ] [[package]] @@ -9141,7 +9333,7 @@ dependencies = [ "pharos", "rustc_version 0.4.1", "send_wrapper", - "thiserror 2.0.17", + "thiserror 2.0.18", "wasm-bindgen", "wasm-bindgen-futures", "web-sys", @@ -9226,28 +9418,28 @@ checksum = "b659052874eb698efe5b9e8cf382204678a0086ebf46982b79d6ca3182927e5d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.111", + "syn 2.0.114", "synstructure", ] [[package]] name = "zerocopy" -version = "0.8.31" +version = "0.8.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd74ec98b9250adb3ca554bdde269adf631549f51d8a8f8f0a10b50f1cb298c3" +checksum = "668f5168d10b9ee831de31933dc111a459c97ec93225beb307aed970d1372dfd" dependencies = [ "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.8.31" +version = "0.8.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8a8d209fdf45cf5138cbb5a506f6b52522a25afccc534d1475dad8e31105c6a" +checksum = "2c7962b26b0a8685668b671ee4b54d007a67d4eaf05fda79ac0ecf41e32270f1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.111", + "syn 2.0.114", ] [[package]] @@ -9267,7 +9459,7 @@ checksum = "d71e5d6e06ab090c67b5e44993ec16b72dcbaabc526db883a360057678b48502" dependencies = [ "proc-macro2", "quote", - "syn 2.0.111", + "syn 2.0.114", "synstructure", ] @@ -9282,13 +9474,13 @@ dependencies = [ [[package]] name = "zeroize_derive" -version = "1.4.2" +version = "1.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" +checksum = "85a5b4158499876c763cb03bc4e49185d3cccbabb15b33c627f7884f43db852e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.111", + "syn 2.0.114", ] [[package]] @@ -9321,7 +9513,7 @@ checksum = "eadce39539ca5cb3985590102671f2567e659fca9666581ad3411d59207951f3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.111", + "syn 2.0.114", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 4bb2a832ba..b56fa39294 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -32,6 +32,7 @@ members = [ "crates/trbfv", "crates/utils", "crates/wasm", + "crates/polynomial" ] exclude = [ "examples/CRISP", diff --git a/crates/Dockerfile b/crates/Dockerfile index 482f5fd2bf..4def0daf20 100644 --- a/crates/Dockerfile +++ b/crates/Dockerfile @@ -63,6 +63,8 @@ COPY crates/keyshare/Cargo.toml ./keyshare/Cargo.toml COPY crates/logger/Cargo.toml ./logger/Cargo.toml COPY crates/multithread/Cargo.toml ./multithread/Cargo.toml COPY crates/net/Cargo.toml ./net/Cargo.toml +COPY crates/polynomial/Cargo.toml ./polynomial/Cargo.toml +COPY crates/polynomial/benches ./polynomial/benches COPY crates/program-server/Cargo.toml ./program-server/Cargo.toml COPY crates/request/Cargo.toml ./request/Cargo.toml COPY crates/safe/Cargo.toml ./safe/Cargo.toml diff --git a/crates/polynomial/Cargo.toml b/crates/polynomial/Cargo.toml new file mode 100644 index 0000000000..60440b4e62 --- /dev/null +++ b/crates/polynomial/Cargo.toml @@ -0,0 +1,31 @@ +[package] +name = "polynomial" +version.workspace = true +edition.workspace = true +license.workspace = true +description = "A polynomial library with big integer coefficients for cryptographic operations" +repository = "https://github.com/gnosisguild/enclave/crates/polynomial" + +[dependencies] +num-bigint = { workspace = true, features = ["serde"] } +num-traits = { workspace = true } +serde = { workspace = true, optional = true } +bincode = { workspace = true, optional = true } +thiserror = { workspace = true } + +[dev-dependencies] +criterion = "0.5" +bincode = { workspace = true } + +[features] +default = [] +serde = ["dep:serde"] +bincode = ["dep:bincode", "serde"] + +[[bench]] +name = "polynomial" +harness = false + +[package.metadata.docs.rs] +all-features = true +rustdoc-args = ["--cfg", "docsrs"] diff --git a/crates/polynomial/README.md b/crates/polynomial/README.md new file mode 100644 index 0000000000..6039328360 --- /dev/null +++ b/crates/polynomial/README.md @@ -0,0 +1,105 @@ +# Polynomial Library + +A polynomial library with big integer coefficients designed for cryptographic applications, +particularly lattice-based cryptography and homomorphic encryption schemes. + +## Features + +- Uses `num-bigint` for coefficient representation. +- Addition, subtraction, multiplication, division reduction modulo cyclotomic polynomials and prime + moduli. +- Utilities for coefficient range validation. +- Optional serde support for polynomial serialization. + +### Mathematical Background + +This library implements polynomial arithmetic over the ring of integers, with support for modular +reduction operations commonly used in: + +- **Lattice-based cryptography**: Polynomial rings over cyclotomic fields +- **Homomorphic encryption**: BFV, BGV, and CKKS schemes +- **Zero-knowledge proofs**: Polynomial commitment schemes + +### Polynomial Representation + +Polynomials are represented as: + +``` +a_n * x^n + a_{n-1} * x^{n-1} + ... + a_1 * x + a_0 +``` + +Where coefficients are stored in descending order (highest degree first) of degree using `BigInt` +for arbitrary precision. You can rely on some methods to transform to ascending order (lowest degree +first) and viceversa. + +### Performance + +The library is optimized for cryptographic workloads with: + +- Efficient coefficient storage and manipulation +- Optimized modular reduction algorithms +- Minimal memory allocations +- Horner's method for polynomial evaluation + +## Usage + +### Installation + +Add this to your `Cargo.toml`: + +```toml +[dependencies] +polynomial = { git = "https://github.com/gnosisguild/enclave", path = "crates/polynomial" } +``` + +For serialization support, enable the `serde` feature: + +```toml +[dependencies] +polynomial = { git = "https://github.com/gnosisguild/enclave", path = "crates/polynomial", features = ["serde"] } +``` + +### Testing + +Run the test suite: + +```bash +cargo test +``` + +Run tests with verbose output: + +```bash +cargo test -- --nocapture +``` + +### Benchmarks + +Run benchmarks: + +```bash +cargo bench +``` + +### Quick Start + +```rust +use polynomial::Polynomial; +use num_bigint::BigInt; + +// Create polynomials +let poly1 = Polynomial::new(vec![BigInt::from(1), BigInt::from(2), BigInt::from(3)]); +let poly2 = Polynomial::new(vec![BigInt::from(1), BigInt::from(1)]); + +// Perform arithmetic +let sum = poly1.add(&poly2); +let product = poly1.mul(&poly2); + +// Modular reduction +let modulus = BigInt::from(7); +let reduced = poly1.reduce_and_center(&modulus); + +println!("Sum: {}", sum); +println!("Product: {}", product); +println!("Reduced: {}", reduced); +``` diff --git a/crates/polynomial/benches/polynomial.rs b/crates/polynomial/benches/polynomial.rs new file mode 100644 index 0000000000..e4ac19c2c8 --- /dev/null +++ b/crates/polynomial/benches/polynomial.rs @@ -0,0 +1,186 @@ +// SPDX-License-Identifier: LGPL-3.0-only +// +// This file is provided WITHOUT ANY WARRANTY; +// without even the implied warranty of MERCHANTABILITY +// or FITNESS FOR A PARTICULAR PURPOSE. + +use criterion::{black_box, criterion_group, criterion_main, Criterion}; +use num_bigint::BigInt; +use num_traits::{One, Zero}; +use polynomial::Polynomial; + +fn create_test_polynomials(degree: usize) -> (Polynomial, Polynomial) { + let mut coeffs1 = Vec::new(); + let mut coeffs2 = Vec::new(); + + for i in 0..=degree { + coeffs1.push(BigInt::from(i as i64 + 1)); + coeffs2.push(BigInt::from((i + 1) as i64 * 2)); + } + + (Polynomial::new(coeffs1), Polynomial::new(coeffs2)) +} + +fn benchmark_polynomial_addition(c: &mut Criterion) { + let mut group = c.benchmark_group("polynomial_addition"); + + for degree in [10, 50, 100, 500] { + let (poly1, poly2) = create_test_polynomials(degree); + + group.bench_function(&format!("degree_{}", degree), |b| { + b.iter(|| black_box(poly1.add(&poly2))) + }); + } + + group.finish(); +} + +fn benchmark_polynomial_multiplication(c: &mut Criterion) { + let mut group = c.benchmark_group("polynomial_multiplication"); + + for degree in [5, 10, 20, 50] { + let (poly1, poly2) = create_test_polynomials(degree); + + group.bench_function(&format!("degree_{}", degree), |b| { + b.iter(|| black_box(poly1.mul(&poly2))) + }); + } + + group.finish(); +} + +fn benchmark_polynomial_division(c: &mut Criterion) { + let mut group = c.benchmark_group("polynomial_division"); + + for degree in [10, 20, 50, 100] { + let (poly1, poly2) = create_test_polynomials(degree); + + group.bench_function(&format!("degree_{}", degree), |b| { + b.iter(|| black_box(poly1.div(&poly2).unwrap())) + }); + } + + group.finish(); +} + +fn benchmark_polynomial_evaluation(c: &mut Criterion) { + let mut group = c.benchmark_group("polynomial_evaluation"); + + for degree in [10, 50, 100, 500] { + let (poly1, _) = create_test_polynomials(degree); + let x = BigInt::from(42); + + group.bench_function(&format!("degree_{}", degree), |b| { + b.iter(|| black_box(poly1.evaluate(&x))) + }); + } + + group.finish(); +} + +fn benchmark_modular_reduction(c: &mut Criterion) { + let mut group = c.benchmark_group("modular_reduction"); + + for degree in [10, 50, 100, 500] { + let (poly1, _) = create_test_polynomials(degree); + let modulus = BigInt::from(1000000007); // Large prime + + group.bench_function(&format!("degree_{}", degree), |b| { + b.iter(|| black_box(poly1.reduce_and_center(&modulus))) + }); + } + + group.finish(); +} + +fn benchmark_cyclotomic_reduction(c: &mut Criterion) { + let mut group = c.benchmark_group("cyclotomic_reduction"); + + // Create cyclotomic polynomial x^N + 1 + for n in [64, 128, 256, 512] { + let mut cyclo_coeffs = vec![BigInt::zero(); n + 1]; + cyclo_coeffs[0] = BigInt::one(); // x^N + cyclo_coeffs[n] = BigInt::one(); // + 1 + + let cyclo = cyclo_coeffs; + let (poly1, _) = create_test_polynomials(n * 2); // Polynomial of higher degree + + group.bench_function(&format!("cyclo_degree_{}", n), |b| { + b.iter(|| black_box(poly1.reduce_by_cyclotomic(&cyclo).unwrap())) + }); + } + + group.finish(); +} + +fn benchmark_utility_functions(c: &mut Criterion) { + let mut group = c.benchmark_group("utility_functions"); + + // Benchmark reduce_and_center + let x = BigInt::from(123456789); + let modulus = BigInt::from(1000000007); + let half_modulus = &modulus / 2; + + group.bench_function("reduce_and_center", |b| { + b.iter(|| { + black_box(polynomial::utils::reduce_and_center( + &x, + &modulus, + &half_modulus, + )) + }) + }); + + // Benchmark range checking + let coeffs: Vec = (0..1000).map(|i| BigInt::from(i)).collect(); + let bound = BigInt::from(500); + + group.bench_function("range_check_standard", |b| { + b.iter(|| { + black_box(polynomial::utils::range_check_standard( + &coeffs, &bound, &modulus, + )) + }) + }); + + group.finish(); +} + +fn benchmark_coefficient_conversion(c: &mut Criterion) { + let mut group = c.benchmark_group("coefficient_conversion"); + + for degree in [10, 50, 100, 500, 1000] { + let (poly, _) = create_test_polynomials(degree); + + // Benchmark conversion from ascending to descending order + let ascending_coeffs: Vec = (0..=degree).map(|i| BigInt::from(i)).collect(); + + group.bench_function(&format!("from_ascending_degree_{}", degree), |b| { + b.iter(|| { + black_box(Polynomial::from_ascending_coefficients( + ascending_coeffs.clone(), + )) + }) + }); + + // Benchmark conversion from descending to ascending order + group.bench_function(&format!("to_ascending_degree_{}", degree), |b| { + b.iter(|| black_box(poly.to_ascending_coefficients())) + }); + } + + group.finish(); +} + +criterion_group!( + benches, + benchmark_polynomial_addition, + benchmark_polynomial_multiplication, + benchmark_polynomial_division, + benchmark_polynomial_evaluation, + benchmark_modular_reduction, + benchmark_cyclotomic_reduction, + benchmark_utility_functions, + benchmark_coefficient_conversion +); +criterion_main!(benches); diff --git a/crates/polynomial/src/lib.rs b/crates/polynomial/src/lib.rs new file mode 100644 index 0000000000..489fb1ec56 --- /dev/null +++ b/crates/polynomial/src/lib.rs @@ -0,0 +1,32 @@ +// SPDX-License-Identifier: LGPL-3.0-only +// +// This file is provided WITHOUT ANY WARRANTY; +// without even the implied warranty of MERCHANTABILITY +// or FITNESS FOR A PARTICULAR PURPOSE. + +//! # Polynomial Library +//! +//! A polynomial library with big integer coefficients designed for cryptographic operations, +//! particularly lattice-based cryptography and homomorphic encryption schemes. +//! +//! ## Features +//! +//! - Uses `num-bigint` for coefficient representation. +//! - Polynomial Modular Arithmetic: Addition, subtraction, multiplication, division reduction modulo cyclotomic polynomials and prime moduli. +//! - Range Checking: Utilities for coefficient range validation. +//! - Serialization: Optional serde support for polynomial serialization with bincode integration. +//! +//! ## Mathematical Background +//! +//! This library implements polynomial arithmetic over the ring of integers, +//! with support for modular reduction operations commonly used in: +//! +//! - Lattice-based cryptography: Polynomial rings over cyclotomic fields. +//! - Homomorphic encryption: BFV, BGV, and CKKS schemes. +//! - Zero-knowledge proofs: Polynomial commitment schemes. + +pub mod polynomial; +pub mod utils; + +pub use polynomial::{Polynomial, PolynomialError}; +pub use utils::*; diff --git a/crates/polynomial/src/polynomial.rs b/crates/polynomial/src/polynomial.rs new file mode 100644 index 0000000000..86fad50b29 --- /dev/null +++ b/crates/polynomial/src/polynomial.rs @@ -0,0 +1,939 @@ +// SPDX-License-Identifier: LGPL-3.0-only +// +// This file is provided WITHOUT ANY WARRANTY; +// without even the implied warranty of MERCHANTABILITY +// or FITNESS FOR A PARTICULAR PURPOSE. + +//! Polynomial arithmetic implementation. + +use crate::utils::reduce_and_center; +use num_bigint::BigInt; +use num_traits::{One, Zero}; +use std::fmt; +use thiserror::Error; + +#[cfg(feature = "serde")] +use serde::{Deserialize, Serialize}; + +/// Errors that can occur during polynomial operations. +#[derive(Debug, Error)] +pub enum PolynomialError { + /// Division by zero polynomial + #[error("Division by zero polynomial")] + DivisionByZero, + + /// Invalid polynomial (e.g., empty coefficients or zero leading coefficient) + #[error("Invalid polynomial: {message}")] + InvalidPolynomial { message: String }, + + /// Modulus operation error + #[error("Modulus error: {message}")] + ModulusError { message: String }, + + /// Cyclotomic polynomial error + #[error("Cyclotomic polynomial error: {message}")] + CyclotomicError { message: String }, + + /// Range check failure + #[error("Range check error: {message}")] + RangeCheckError { message: String }, + + /// Arithmetic overflow or underflow + #[error("Arithmetic error: {message}")] + ArithmeticError { message: String }, + + /// I/O error + #[error("I/O error: {0}")] + IoError(#[from] std::io::Error), + + /// Parse error for BigInt + #[error("Parse error: {0}")] + ParseError(#[from] num_bigint::ParseBigIntError), +} + +/// A polynomial represented by its coefficients in descending order of degree. +/// +/// The coefficients are stored as `BigInt` to support arbitrary precision arithmetic +/// required for cryptographic operations. The polynomial is represented as: +/// `a_n * x^n + a_{n-1} * x^{n-1} + ... + a_1 * x + a_0` +/// +#[derive(Clone, Debug, PartialEq)] +#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] +pub struct Polynomial { + /// Coefficients in descending order (highest degree first). + pub(crate) coefficients: Vec, +} + +impl fmt::Display for Polynomial { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + if self.coefficients.is_empty() { + return write!(f, "0"); + } + + let mut first = true; + for (i, coeff) in self.coefficients.iter().enumerate() { + let degree = self.coefficients.len() - 1 - i; + + if coeff.is_zero() { + continue; + } + + if first { + if coeff < &BigInt::zero() { + write!(f, "-")?; + } + } else { + if coeff > &BigInt::zero() { + write!(f, " + ")?; + } else { + write!(f, " - ")?; + } + } + first = false; + + let abs_coeff = if coeff < &BigInt::zero() { + -coeff + } else { + coeff.clone() + }; + + if degree == 0 || !abs_coeff.is_one() { + write!(f, "{abs_coeff}")?; + } + + if degree > 0 { + write!(f, "x")?; + if degree > 1 { + write!(f, "^{degree}")?; + } + } + } + + if first { + write!(f, "0")?; + } + + Ok(()) + } +} + +impl Polynomial { + /// Creates a new polynomial from a vector of coefficients. + /// + /// # Arguments + /// + /// * `coefficients` - Vector of coefficients in descending order of degree. + pub fn new(coefficients: Vec) -> Self { + Self { coefficients } + } + + /// Creates a polynomial from coefficients in ascending order format. + /// + /// This method converts from ascending order coefficient ordering (lowest degree first) + /// to this library's ordering (highest degree first). + /// + /// # Arguments + /// + /// * `ascending_coefficients` - Vector of coefficients in ascending order. + pub fn from_ascending_coefficients(ascending_coefficients: Vec) -> Self { + let mut coefficients = ascending_coefficients; + coefficients.reverse(); + Self { coefficients } + } + + /// Converts the polynomial to ascending order coefficient format. + /// + /// This method converts from this library's ordering (highest degree first) + /// to ascending order (lowest degree first). + /// + /// # Returns + /// + /// Vector of coefficients in ascending order. + pub fn to_ascending_coefficients(&self) -> Vec { + let mut coefficients = self.coefficients.clone(); + coefficients.reverse(); + coefficients + } + + /// Creates a zero polynomial of specified degree. + /// + /// # Arguments + /// + /// * `degree` - The degree of the zero polynomial. + pub fn zero(degree: usize) -> Self { + Self { + coefficients: vec![BigInt::zero(); degree + 1], + } + } + + /// Creates a constant polynomial. + /// + /// # Arguments + /// + /// * `constant` - The constant value. + pub fn constant(constant: BigInt) -> Self { + Self { + coefficients: vec![constant], + } + } + + /// Returns the coefficients of the polynomial. + pub fn coefficients(&self) -> &[BigInt] { + &self.coefficients + } + + /// Returns the degree of the polynomial. + /// + /// The degree is computed as `self.coefficients.len().saturating_sub(1)`, + /// which represents the highest exponent implied by the [`coefficients`](Self::coefficients) + /// vector. A coefficients vector of length `n` (including all-zero vectors + /// like those created by [`Polynomial::zero`]) yields degree `n - 1`. + pub fn degree(&self) -> usize { + if self.coefficients.is_empty() { + 0 + } else { + self.coefficients.len() - 1 + } + } + + /// Checks if the polynomial is zero. + pub fn is_zero(&self) -> bool { + self.coefficients.iter().all(|c| c.is_zero()) + } + + /// Removes leading zero coefficients from the polynomial. + /// + /// This method removes zero coefficients from the highest degree terms until + /// a non-zero coefficient is found or only one coefficient remains. + /// + /// # Examples + /// + /// ``` + /// use polynomial::Polynomial; + /// use num_bigint::BigInt; + /// + /// let poly = Polynomial::new(vec![ + /// BigInt::from(0), + /// BigInt::from(0), + /// BigInt::from(1), + /// BigInt::from(2), + /// ]); + /// let trimmed = poly.trim_leading_zeros(); + /// assert_eq!(trimmed.coefficients(), &[BigInt::from(1), BigInt::from(2)]); + /// ``` + /// + /// # Note + /// + /// If all coefficients are zero, the result will be a polynomial with a single zero coefficient. + pub fn trim_leading_zeros(mut self) -> Self { + if let Some(first_non_zero_idx) = self.coefficients.iter().position(|c| !c.is_zero()) { + self.coefficients.drain(..first_non_zero_idx); + } else { + self.coefficients = vec![BigInt::zero()]; + } + self + } + + /// Returns the leading coefficient of the polynomial. + pub fn leading_coefficient(&self) -> Option<&BigInt> { + self.coefficients.first() + } + + /// Adds two polynomials together. + /// + /// This function performs polynomial addition by: + /// 1. Finding the maximum length between the two polynomials. + /// 2. Creating a new polynomial with the maximum length. + /// 3. Adding the coefficients of both polynomials term by term. + /// + /// # Arguments + /// + /// * `other` - A reference to the polynomial to add to `self`. + /// + /// # Returns + /// + /// A new polynomial containing the sum of the two polynomials. + pub fn add(&self, other: &Self) -> Self { + let max_length = std::cmp::max(self.coefficients.len(), other.coefficients.len()); + let mut result = vec![BigInt::zero(); max_length]; + + // Add coefficients from the first polynomial + let self_offset = max_length - self.coefficients.len(); + for (i, coeff) in self.coefficients.iter().enumerate() { + result[self_offset + i] = coeff.clone(); + } + + // Add coefficients from the second polynomial + let other_offset = max_length - other.coefficients.len(); + for (i, coeff) in other.coefficients.iter().enumerate() { + result[other_offset + i] += coeff; + } + + Polynomial::new(result) + } + + /// Subtracts one polynomial from another. + /// + /// # Arguments + /// + /// * `other` - A reference to the polynomial to subtract from `self`. + /// + /// # Returns + /// + /// A new polynomial containing the difference. + pub fn sub(&self, other: &Self) -> Self { + self.add(&other.neg()) + } + + /// Negates all coefficients of the polynomial. + /// + /// # Returns + /// + /// A new polynomial with all coefficients negated. + pub fn neg(&self) -> Self { + Polynomial::new(self.coefficients.iter().map(|x| -x).collect()) + } + + /// Multiplies two polynomials using the naive algorithm. + /// + /// # Arguments + /// + /// * `other` - A reference to the polynomial to multiply with `self`. + /// + /// # Returns + /// + /// A new polynomial containing the product. + pub fn mul(&self, other: &Self) -> Self { + if self.is_zero() || other.is_zero() { + return Polynomial::zero(0); + } + + let product_len = self.coefficients.len() + other.coefficients.len() - 1; + let mut product = vec![BigInt::zero(); product_len]; + + for i in 0..self.coefficients.len() { + for j in 0..other.coefficients.len() { + product[i + j] += &self.coefficients[i] * &other.coefficients[j]; + } + } + + Polynomial::new(product) + } + + /// Divides one polynomial by another, returning the quotient and remainder. + /// + /// # Arguments + /// + /// * `divisor` - A reference to the divisor polynomial. + /// + /// # Returns + /// + /// A result containing a tuple of (quotient, remainder) or an error. + /// + /// # Errors + /// + /// Returns `PolynomialError::DivisionByZero` if the divisor is zero. + /// Returns `PolynomialError::InvalidPolynomial` if the divisor has zero leading coefficient + /// or if exact divisibility is not satisfied (i.e., when a coefficient is not divisible + /// by the divisor's leading coefficient). + pub fn div(&self, divisor: &Self) -> Result<(Self, Self), PolynomialError> { + if divisor.is_zero() { + return Err(PolynomialError::DivisionByZero); + } + + if divisor.coefficients.is_empty() || divisor.coefficients[0].is_zero() { + return Err(PolynomialError::InvalidPolynomial { + message: "Leading coefficient of divisor cannot be zero".to_string(), + }); + } + + if self.degree() < divisor.degree() { + return Ok((Polynomial::zero(0), self.clone())); + } + + let mut quotient = + vec![BigInt::zero(); self.coefficients.len() - divisor.coefficients.len() + 1]; + let mut remainder = self.coefficients.clone(); + + for i in 0..quotient.len() { + // Check for exact divisibility + if !(&remainder[i] % &divisor.coefficients[0]).is_zero() { + return Err(PolynomialError::InvalidPolynomial { + message: format!( + "Polynomial division requires exact divisibility: coefficient {} is not divisible by leading coefficient {}", + &remainder[i], &divisor.coefficients[0] + ), + }); + } + + let coeff = &remainder[i] / &divisor.coefficients[0]; + quotient[i] = coeff.clone(); + + for j in 0..divisor.coefficients.len() { + if i + j < remainder.len() { + remainder[i + j] = &remainder[i + j] - &divisor.coefficients[j] * &coeff; + } + } + } + + // Remove leading zero coefficients from remainder + while !remainder.is_empty() && remainder[0].is_zero() { + remainder.remove(0); + } + + Ok((Polynomial::new(quotient), Polynomial::new(remainder))) + } + + /// Multiplies each coefficient of the polynomial by a scalar. + /// + /// # Arguments + /// + /// * `scalar` - A `BigInt` scalar to multiply with each coefficient. + /// + /// # Returns + /// + /// A new polynomial with each coefficient multiplied by the scalar. + pub fn scalar_mul(&self, scalar: &BigInt) -> Self { + Polynomial::new(self.coefficients.iter().map(|x| x * scalar).collect()) + } + + /// Reduces the polynomial modulo a cyclotomic polynomial. + /// + /// This function performs polynomial division by the cyclotomic polynomial + /// and returns the remainder, padded to length `n = cyclo.len() - 1`. + /// + /// The result is a polynomial of degree `n-1` where `n` is the degree of the + /// cyclotomic polynomial. This is commonly used in lattice-based cryptography + /// where polynomials are reduced modulo `x^N + 1` (the 2N-th cyclotomic polynomial). + /// + /// # Arguments + /// + /// * `cyclo` - Coefficients of the cyclotomic polynomial in descending order. + /// + /// # Returns + /// + /// A new polynomial of degree `n-1` representing the remainder after reduction. + /// + /// # Errors + /// + /// Returns `PolynomialError::DivisionByZero` if the cyclotomic polynomial is zero. + /// Returns `PolynomialError::InvalidPolynomial` if the cyclotomic polynomial has a zero leading coefficient. + /// + /// # Examples + /// + /// ``` + /// use polynomial::Polynomial; + /// use num_bigint::BigInt; + /// + /// // Reduce modulo x^4 + 1 (cyclotomic polynomial for N=4) + /// let poly = Polynomial::new(vec![BigInt::from(1), BigInt::from(0), BigInt::from(0), BigInt::from(0), BigInt::from(1)]); + /// let cyclo = vec![BigInt::from(1), BigInt::from(0), BigInt::from(0), BigInt::from(0), BigInt::from(1)]; + /// let reduced = poly.reduce_by_cyclotomic(&cyclo).unwrap(); + /// assert_eq!(reduced.degree(), 3); + /// ``` + pub fn reduce_by_cyclotomic(&self, cyclo: &[BigInt]) -> Result { + let cyclo_poly = Polynomial::new(cyclo.to_vec()); + let (_, remainder) = self.div(&cyclo_poly)?; + + let n = cyclo.len() - 1; + let mut out = vec![BigInt::zero(); n]; + + if !remainder.coefficients.is_empty() { + let start_idx = n.saturating_sub(remainder.coefficients.len()); + let end_idx = std::cmp::min(start_idx + remainder.coefficients.len(), n); + let src_len = end_idx - start_idx; + for (i, coeff) in remainder.coefficients[..src_len].iter().enumerate() { + out[start_idx + i] = coeff.clone(); + } + } + + Ok(Polynomial::new(out)) + } + + /// Reduces coefficients modulo a prime and centers them. + /// + /// # Arguments + /// + /// * `modulus` - The prime modulus. + /// + /// # Returns + /// + /// A new polynomial with coefficients reduced and centered. + pub fn reduce_and_center(&self, modulus: &BigInt) -> Self { + let half_modulus = modulus / 2; + let reduced_coeffs = self + .coefficients + .iter() + .map(|x| reduce_and_center(x, modulus, &half_modulus)) + .collect(); + Polynomial::new(reduced_coeffs) + } + + /// Evaluates the polynomial at a given point using Horner's method. + /// + /// # Arguments + /// + /// * `x` - The point at which to evaluate the polynomial. + /// + /// # Returns + /// + /// The value of the polynomial at the given point. + pub fn evaluate(&self, x: &BigInt) -> BigInt { + if self.coefficients.is_empty() { + return BigInt::zero(); + } + + // Use Horner's method for efficient evaluation + let mut result = self.coefficients[0].clone(); + for coeff in &self.coefficients[1..] { + result = result * x + coeff; + } + result + } +} + +#[cfg(test)] +mod tests { + use super::*; + use num_bigint::BigInt; + + #[test] + fn test_basic_polynomial_creation() { + let poly = Polynomial::new(vec![BigInt::from(1), BigInt::from(2), BigInt::from(3)]); + assert_eq!(poly.degree(), 2); + assert_eq!( + poly.coefficients(), + &[BigInt::from(1), BigInt::from(2), BigInt::from(3)] + ); + } + + #[test] + fn test_zero_polynomial() { + let zero = Polynomial::zero(3); + assert_eq!(zero.degree(), 3); + assert!(zero.is_zero()); + } + + #[test] + fn test_constant_polynomial() { + let const_poly = Polynomial::constant(BigInt::from(42)); + assert_eq!(const_poly.degree(), 0); + assert_eq!(const_poly.coefficients(), &[BigInt::from(42)]); + } + + #[test] + fn test_polynomial_display() { + let poly = Polynomial::new(vec![BigInt::from(2), BigInt::from(-3), BigInt::from(1)]); + assert_eq!(poly.to_string(), "2x^2 - 3x + 1"); + } + + #[test] + fn test_polynomial_display_negative_leading() { + let poly = Polynomial::new(vec![BigInt::from(-3), BigInt::from(2), BigInt::from(-1)]); + assert_eq!(poly.to_string(), "-3x^2 + 2x - 1"); + } + + #[test] + fn test_polynomial_addition() { + let poly1 = Polynomial::new(vec![BigInt::from(1), BigInt::from(2)]); + let poly2 = Polynomial::new(vec![BigInt::from(3), BigInt::from(4)]); + let result = poly1.add(&poly2); + assert_eq!(result.coefficients(), &[BigInt::from(4), BigInt::from(6)]); + } + + #[test] + fn test_polynomial_subtraction() { + let poly1 = Polynomial::new(vec![BigInt::from(5), BigInt::from(3)]); + let poly2 = Polynomial::new(vec![BigInt::from(2), BigInt::from(1)]); + let result = poly1.sub(&poly2); + assert_eq!(result.coefficients(), &[BigInt::from(3), BigInt::from(2)]); + } + + #[test] + fn test_polynomial_negation() { + let poly = Polynomial::new(vec![BigInt::from(1), BigInt::from(-2), BigInt::from(3)]); + let neg_poly = poly.neg(); + assert_eq!( + neg_poly.coefficients(), + &[BigInt::from(-1), BigInt::from(2), BigInt::from(-3)] + ); + } + + #[test] + fn test_polynomial_multiplication() { + let poly1 = Polynomial::new(vec![BigInt::from(1), BigInt::from(2)]); // x + 2 + let poly2 = Polynomial::new(vec![BigInt::from(1), BigInt::from(3)]); // x + 3 + let result = poly1.mul(&poly2); // Should be x^2 + 5x + 6 + assert_eq!( + result.coefficients(), + &[BigInt::from(1), BigInt::from(5), BigInt::from(6)] + ); + } + + #[test] + fn test_polynomial_division() { + let dividend = Polynomial::new(vec![BigInt::from(1), BigInt::from(5), BigInt::from(6)]); // x^2 + 5x + 6 + let divisor = Polynomial::new(vec![BigInt::from(1), BigInt::from(2)]); // x + 2 + let (quotient, remainder) = dividend.div(&divisor).unwrap(); + assert_eq!(quotient.coefficients(), &[BigInt::from(1), BigInt::from(3)]); // x + 3 + assert!(remainder.is_zero()); + } + + #[test] + fn test_division_by_zero() { + let poly = Polynomial::new(vec![BigInt::from(1), BigInt::from(2)]); + let zero = Polynomial::zero(0); + assert!(matches!( + poly.div(&zero), + Err(PolynomialError::DivisionByZero) + )); + } + + #[test] + fn test_scalar_multiplication() { + let poly = Polynomial::new(vec![BigInt::from(1), BigInt::from(2), BigInt::from(3)]); + let scalar = BigInt::from(5); + let result = poly.scalar_mul(&scalar); + assert_eq!( + result.coefficients(), + &[BigInt::from(5), BigInt::from(10), BigInt::from(15)] + ); + } + + #[test] + fn test_polynomial_evaluation() { + let poly = Polynomial::new(vec![BigInt::from(1), BigInt::from(2), BigInt::from(3)]); // x^2 + 2x + 3 + let result = poly.evaluate(&BigInt::from(2)); // 1*4 + 2*2 + 3 = 11 + assert_eq!(result, BigInt::from(11)); + } + + #[test] + fn test_trim_leading_zeros() { + let poly = Polynomial::new(vec![ + BigInt::from(0), + BigInt::from(0), + BigInt::from(1), + BigInt::from(2), + ]); + let trimmed = poly.trim_leading_zeros(); + assert_eq!(trimmed.coefficients(), &[BigInt::from(1), BigInt::from(2)]); + } + + #[test] + fn test_trim_leading_zeros_all_zero() { + let poly = Polynomial::new(vec![BigInt::from(0), BigInt::from(0), BigInt::from(0)]); + let trimmed = poly.trim_leading_zeros(); + assert_eq!(trimmed.coefficients(), &[BigInt::from(0)]); + } + + #[test] + fn test_trim_leading_zeros_no_leading_zeros() { + let poly = Polynomial::new(vec![BigInt::from(1), BigInt::from(2)]); + let trimmed = poly.trim_leading_zeros(); + assert_eq!(trimmed.coefficients(), &[BigInt::from(1), BigInt::from(2)]); + } + + #[test] + fn test_trim_leading_zeros_single_zero() { + let poly = Polynomial::new(vec![BigInt::from(0)]); + let trimmed = poly.trim_leading_zeros(); + assert_eq!(trimmed.coefficients(), &[BigInt::from(0)]); + } + + #[test] + fn test_ascending_coefficients_conversion() { + // Test conversion from ascending format to Rust format + let ascending_coeffs = vec![BigInt::from(2), BigInt::from(3), BigInt::from(1)]; // 2 + 3x + x^2 + let poly = Polynomial::from_ascending_coefficients(ascending_coeffs); + assert_eq!( + poly.coefficients(), + &[BigInt::from(1), BigInt::from(3), BigInt::from(2)] + ); // x^2 + 3x + 2 + + // Test conversion back to ascending format + let back_to_ascending = poly.to_ascending_coefficients(); + assert_eq!( + back_to_ascending, + vec![BigInt::from(2), BigInt::from(3), BigInt::from(1)] + ); + } + + #[test] + fn test_ascending_coefficients_conversion_edge_cases() { + // Test empty polynomial + let empty_ascending = vec![]; + let poly_empty = Polynomial::from_ascending_coefficients(empty_ascending); + assert_eq!(poly_empty.coefficients(), &[]); + assert_eq!(poly_empty.to_ascending_coefficients(), vec![]); + + // Test single coefficient + let single_ascending = vec![BigInt::from(5)]; + let poly_single = Polynomial::from_ascending_coefficients(single_ascending); + assert_eq!(poly_single.coefficients(), &[BigInt::from(5)]); + assert_eq!( + poly_single.to_ascending_coefficients(), + vec![BigInt::from(5)] + ); + + // Test two coefficients + let two_ascending = vec![BigInt::from(1), BigInt::from(2)]; // 1 + 2x + let poly_two = Polynomial::from_ascending_coefficients(two_ascending); + assert_eq!(poly_two.coefficients(), &[BigInt::from(2), BigInt::from(1)]); // 2x + 1 + assert_eq!( + poly_two.to_ascending_coefficients(), + vec![BigInt::from(1), BigInt::from(2)] + ); + } + + #[test] + fn test_ascending_coefficients_compatibility_example() { + // This test demonstrates the exact scenario mentioned in the issue + // Ascending: [2, 3, 1] represents 2 + 3x + x^2 + let ascending_coefficients = vec![BigInt::from(2), BigInt::from(3), BigInt::from(1)]; + let poly = Polynomial::from_ascending_coefficients(ascending_coefficients); + + // Rust: [1, 3, 2] represents x^2 + 3x + 2 + assert_eq!( + poly.coefficients(), + &[BigInt::from(1), BigInt::from(3), BigInt::from(2)] + ); + assert_eq!(poly.to_string(), "x^2 + 3x + 2"); + + // Convert back to ascending format + let back_to_ascending = poly.to_ascending_coefficients(); + assert_eq!( + back_to_ascending, + vec![BigInt::from(2), BigInt::from(3), BigInt::from(1)] + ); + } + + #[cfg(feature = "serde")] + mod serialization_tests { + use super::*; + use bincode; + + #[test] + fn test_polynomial_bincode_serialization() { + let poly = Polynomial::new(vec![BigInt::from(2), BigInt::from(-3), BigInt::from(1)]); // 2x^2 - 3x + 1 + + // Test binary serialization with bincode + let bytes = bincode::serialize(&poly).expect("Failed to serialize"); + let reconstructed: Polynomial = + bincode::deserialize(&bytes).expect("Failed to deserialize"); + + // Verify the polynomial is correctly reconstructed + assert_eq!(poly, reconstructed); + assert_eq!(poly.coefficients(), reconstructed.coefficients()); + assert_eq!(poly.degree(), reconstructed.degree()); + assert_eq!(poly.to_string(), reconstructed.to_string()); + } + + #[test] + fn test_polynomial_bincode_serialization_edge_cases() { + // Test zero polynomial + let zero_poly = Polynomial::zero(3); + let bytes = bincode::serialize(&zero_poly).expect("Failed to serialize"); + let reconstructed: Polynomial = + bincode::deserialize(&bytes).expect("Failed to deserialize"); + assert_eq!(zero_poly, reconstructed); + assert!(reconstructed.is_zero()); + + // Test constant polynomial + let const_poly = Polynomial::constant(BigInt::from(42)); + let bytes = bincode::serialize(&const_poly).expect("Failed to serialize"); + let reconstructed: Polynomial = + bincode::deserialize(&bytes).expect("Failed to deserialize"); + assert_eq!(const_poly, reconstructed); + assert_eq!(reconstructed.degree(), 0); + + // Test empty polynomial + let empty_poly = Polynomial::new(vec![]); + let bytes = bincode::serialize(&empty_poly).expect("Failed to serialize"); + let reconstructed: Polynomial = + bincode::deserialize(&bytes).expect("Failed to deserialize"); + assert_eq!(empty_poly, reconstructed); + } + + #[test] + fn test_polynomial_bincode_serialization_large_numbers() { + // Test with very large numbers + let large_coeffs = vec![ + BigInt::from(i64::MAX), + BigInt::from(i64::MIN), + BigInt::from(0), + BigInt::from(42), + ]; + let poly = Polynomial::new(large_coeffs); + + let bytes = bincode::serialize(&poly).expect("Failed to serialize"); + let reconstructed: Polynomial = + bincode::deserialize(&bytes).expect("Failed to deserialize"); + + assert_eq!(poly, reconstructed); + assert_eq!(poly.coefficients(), reconstructed.coefficients()); + } + + #[test] + fn test_polynomial_bincode_serialization_roundtrip() { + // Test that operations work correctly after serialization/deserialization + let poly1 = Polynomial::new(vec![BigInt::from(1), BigInt::from(2), BigInt::from(3)]); + let poly2 = Polynomial::new(vec![BigInt::from(4), BigInt::from(5)]); + + // Serialize and deserialize both polynomials + let bytes1 = bincode::serialize(&poly1).expect("Failed to serialize"); + let bytes2 = bincode::serialize(&poly2).expect("Failed to serialize"); + + let reconstructed1: Polynomial = + bincode::deserialize(&bytes1).expect("Failed to deserialize"); + let reconstructed2: Polynomial = + bincode::deserialize(&bytes2).expect("Failed to deserialize"); + + // Test that operations still work + let original_sum = poly1.add(&poly2); + let reconstructed_sum = reconstructed1.add(&reconstructed2); + assert_eq!(original_sum, reconstructed_sum); + + let original_product = poly1.mul(&poly2); + let reconstructed_product = reconstructed1.mul(&reconstructed2); + assert_eq!(original_product, reconstructed_product); + } + + #[test] + fn test_polynomial_bincode_serialization_ascending_conversion() { + // Test that ascending coefficient conversion works after serialization + let ascending_coeffs = vec![BigInt::from(2), BigInt::from(3), BigInt::from(1)]; + let poly = Polynomial::from_ascending_coefficients(ascending_coeffs.clone()); + + let bytes = bincode::serialize(&poly).expect("Failed to serialize"); + let reconstructed: Polynomial = + bincode::deserialize(&bytes).expect("Failed to deserialize"); + + // Test ascending conversion still works + let back_to_ascending = reconstructed.to_ascending_coefficients(); + assert_eq!(back_to_ascending, ascending_coeffs); + } + } + + #[test] + fn test_reduce_by_cyclotomic() { + // Test reduction modulo x^4 + 1 (cyclotomic polynomial for N=4) + // cyclo = [1, 0, 0, 0, 1] represents x^4 + 1 + let cyclo = vec![ + BigInt::from(1), + BigInt::from(0), + BigInt::from(0), + BigInt::from(0), + BigInt::from(1), + ]; + + // Test: x^4 + 1 divided by x^4 + 1 should give remainder 0 + let poly = Polynomial::new(vec![ + BigInt::from(1), + BigInt::from(0), + BigInt::from(0), + BigInt::from(0), + BigInt::from(1), + ]); + let reduced = poly.reduce_by_cyclotomic(&cyclo).unwrap(); + assert_eq!(reduced.degree(), 3); + assert!(reduced.is_zero()); + + // Test: x^5 divided by x^4 + 1 gives remainder -x + // x^5 = x * x^4 = x * (x^4 + 1 - 1) = x(x^4 + 1) - x + // So remainder is -x, which becomes x^3 - x after padding + let poly2 = Polynomial::new(vec![ + BigInt::from(1), + BigInt::from(0), + BigInt::from(0), + BigInt::from(0), + BigInt::from(0), + BigInt::from(0), + ]); + let reduced2 = poly2.reduce_by_cyclotomic(&cyclo).unwrap(); + assert_eq!(reduced2.degree(), 3); + // The remainder should be -x, padded to length 4: [0, 0, 0, -1] + // But actually, the algorithm right-aligns, so it should be [0, 0, 0, -1] + // Let's just verify it's not zero and has the right degree + assert!(!reduced2.is_zero()); + } + + #[test] + fn test_reduce_by_cyclotomic_right_alignment() { + // Test that remainder is right-aligned correctly + // cyclo = [1, 0, 1] represents x^2 + 1, so n = cyclo.len() - 1 = 2 + let cyclo = vec![BigInt::from(1), BigInt::from(0), BigInt::from(1)]; + + // Test with remainder that fits exactly + // x^2 + 2x + 1 divided by x^2 + 1 gives remainder 2x + // remainder.coefficients = [2, 0] (2x + 0) + // After right-aligning to n=2: we copy [2, 0] to output + let poly = Polynomial::new(vec![BigInt::from(1), BigInt::from(2), BigInt::from(1)]); + let reduced = poly.reduce_by_cyclotomic(&cyclo).unwrap(); + // n = cyclo.len() - 1 = 3 - 1 = 2, so output length is 2 + assert_eq!(reduced.coefficients().len(), 2); + // The remainder is 2x = [2, 0], right-aligned to length 2 gives [2, 0] + assert_eq!(reduced.coefficients()[0].clone(), BigInt::from(2)); + assert_eq!(reduced.coefficients()[1].clone(), BigInt::from(0)); + } + + #[test] + fn test_reduce_by_cyclotomic_long_remainder() { + // Test with remainder longer than output size (should truncate) + // cyclo = [1, 0, 1] represents x^2 + 1, so n = cyclo.len() - 1 = 2 + let cyclo = vec![BigInt::from(1), BigInt::from(0), BigInt::from(1)]; + + // x^4 + 2x^3 + 3x^2 divided by x^2 + 1 + // This will give a remainder, and we test truncation + let poly = Polynomial::new(vec![ + BigInt::from(1), + BigInt::from(2), + BigInt::from(3), + BigInt::from(0), + BigInt::from(0), + ]); + let reduced = poly.reduce_by_cyclotomic(&cyclo).unwrap(); + // Output should be length n = 2 + assert_eq!(reduced.coefficients().len(), 2); + } + + #[test] + fn test_reduce_by_cyclotomic_empty_remainder() { + // Test with zero remainder + let cyclo = vec![ + BigInt::from(1), + BigInt::from(0), + BigInt::from(0), + BigInt::from(0), + BigInt::from(1), + ]; + // x^4 + 1 divided by x^4 + 1 = 1 with remainder 0 + let poly = Polynomial::new(vec![ + BigInt::from(1), + BigInt::from(0), + BigInt::from(0), + BigInt::from(0), + BigInt::from(1), + ]); + let reduced = poly.reduce_by_cyclotomic(&cyclo).unwrap(); + assert_eq!(reduced.degree(), 3); + assert!(reduced.is_zero()); + } + + #[test] + fn test_reduce_by_cyclotomic_error_cases() { + // Test division by zero cyclotomic polynomial + let cyclo_zero = vec![BigInt::from(0), BigInt::from(0)]; + let poly = Polynomial::new(vec![BigInt::from(1), BigInt::from(2)]); + assert!(matches!( + poly.reduce_by_cyclotomic(&cyclo_zero), + Err(PolynomialError::DivisionByZero) + )); + + // Test zero leading coefficient + let cyclo_invalid = vec![BigInt::from(0), BigInt::from(1)]; + assert!(matches!( + poly.reduce_by_cyclotomic(&cyclo_invalid), + Err(PolynomialError::InvalidPolynomial { .. }) + )); + } +} diff --git a/crates/polynomial/src/utils.rs b/crates/polynomial/src/utils.rs new file mode 100644 index 0000000000..95d685ed8a --- /dev/null +++ b/crates/polynomial/src/utils.rs @@ -0,0 +1,640 @@ +// SPDX-License-Identifier: LGPL-3.0-only +// +// This file is provided WITHOUT ANY WARRANTY; +// without even the implied warranty of MERCHANTABILITY +// or FITNESS FOR A PARTICULAR PURPOSE. + +//! Utility functions for polynomial operations. + +use crate::polynomial::PolynomialError; +use crate::Polynomial; +use num_bigint::BigInt; +use num_traits::Zero; + +/// Reduces a number modulo a prime modulus and centers it. +/// +/// This function takes an arbitrary number and reduces it modulo the specified prime modulus. +/// After reduction, the number is adjusted to be within the symmetric range +/// [−(modulus−1)/2, (modulus−1)/2]. If the number is already within this range, it remains unchanged. +/// +/// # Arguments +/// +/// * `x` - A reference to a `BigInt` representing the number to be reduced and centered. +/// * `modulus` - A reference to the prime modulus `BigInt` used for reduction. +/// * `half_modulus` - A reference to a `BigInt` representing half of the modulus used to center the coefficient. +/// +/// # Returns +/// +/// A `BigInt` representing the reduced and centered number. +pub fn reduce_and_center(x: &BigInt, modulus: &BigInt, half_modulus: &BigInt) -> BigInt { + // Calculate the remainder ensuring it's non-negative. + let mut r: BigInt = x % modulus; + if r < BigInt::zero() { + r += modulus; + } + + // Adjust the remainder if it is greater than half_modulus. + if (modulus % BigInt::from(2)) == BigInt::from(1) { + if r > *half_modulus { + r -= modulus; + } + } else if r >= *half_modulus { + r -= modulus; + } + + r +} + +/// Reduces and centers polynomial coefficients modulo a prime modulus. +/// +/// This function iterates over a mutable slice of polynomial coefficients, reducing each coefficient +/// modulo a given prime modulus and adjusting the result to be within the symmetric range +/// [−(modulus−1)/2, (modulus−1)/2]. +/// +/// # Arguments +/// +/// * `coefficients` - A mutable slice of `BigInt` coefficients to be reduced and centered +/// * `modulus` - A prime modulus `BigInt` used for reduction and centering +/// +/// # Panics +/// +/// Panics if `modulus` is zero due to division by zero +pub fn reduce_and_center_coefficients_mut(coefficients: &mut [BigInt], modulus: &BigInt) { + let half_modulus = modulus / 2; + coefficients + .iter_mut() + .for_each(|x| *x = reduce_and_center(x, modulus, &half_modulus)); +} + +/// Reduces and centers polynomial coefficients modulo a prime modulus. +/// +/// This function creates a new vector with coefficients reduced and centered modulo the given modulus. +/// +/// # Arguments +/// +/// * `coefficients` - A slice of `BigInt` coefficients to be reduced and centered +/// * `modulus` - A prime modulus `BigInt` used for reduction and centering +/// +/// # Returns +/// +/// A new `Vec` with reduced and centered coefficients +pub fn reduce_and_center_coefficients(coefficients: &[BigInt], modulus: &BigInt) -> Vec { + let half_modulus = modulus / 2; + coefficients + .iter() + .map(|x| reduce_and_center(x, modulus, &half_modulus)) + .collect() +} + +/// Reduces and centers a scalar value. +/// +/// # Arguments +/// +/// * `x` - The scalar value to reduce and center +/// * `modulus` - The modulus to reduce by +/// +/// # Returns +/// +/// The reduced and centered scalar value +pub fn reduce_and_center_scalar(x: &BigInt, modulus: &BigInt) -> BigInt { + let half_modulus = modulus / 2; + reduce_and_center(x, modulus, &half_modulus) +} + +/// Reduces a scalar value modulo a modulus. +/// +/// # Arguments +/// +/// * `x` - The scalar value to reduce +/// * `modulus` - The modulus to reduce by +/// +/// # Returns +/// +/// The reduced scalar value in the range [0, modulus) +pub fn reduce_scalar(x: &BigInt, modulus: &BigInt) -> BigInt { + let mut r = x % modulus; + if r < BigInt::zero() { + r += modulus; + } + r +} + +/// Reduces a polynomial's coefficients within a polynomial ring defined by a cyclotomic polynomial and a modulus. +/// +/// This function performs two reductions on the polynomial represented by `coefficients`: +/// 1. **Cyclotomic Reduction**: Reduces the polynomial by the cyclotomic polynomial, replacing +/// the original coefficients with the remainder after polynomial division. +/// 2. **Modulus Reduction**: Reduces the coefficients of the polynomial modulo a given modulus, +/// centering the coefficients within the range [-modulus/2, modulus/2). +/// +/// # Arguments +/// +/// * `coefficients` - A mutable reference to a `Vec` representing the coefficients of the polynomial +/// to be reduced. The coefficients should be in descending order of degree. +/// * `cyclo` - A slice of `BigInt` representing the coefficients of the cyclotomic polynomial (typically x^N + 1). +/// * `modulus` - A reference to a `BigInt` representing the modulus for the coefficient reduction. The coefficients +/// will be reduced and centered modulo this value. +/// +/// # Returns +/// +/// Returns `Ok(())` on success, or a `PolynomialError` if the cyclotomic reduction fails. +pub fn reduce_in_ring( + coefficients: &mut Vec, + cyclo: &[BigInt], + modulus: &BigInt, +) -> Result<(), PolynomialError> { + let coeffs = coefficients.clone(); + let poly = Polynomial::new(coeffs); + let reduced = poly.reduce_by_cyclotomic(cyclo)?; + *coefficients = reduced.coefficients; + reduce_and_center_coefficients_mut(coefficients, modulus); + Ok(()) +} + +/// Reduces each element in the given slice of `BigInt` by the modulus `p`. +/// +/// This function takes a slice of `BigInt` coefficients and applies the modulus operation +/// on each element. It ensures the result is within the range `[0, p-1]` by computing +/// `r = coeff % p` and adding `p` if `r` is negative. The result is collected into a new `Vec`. +/// +/// # Arguments +/// +/// * `coefficients` - A slice of `BigInt` representing the coefficients to be reduced. +/// * `p` - A reference to a `BigInt` that represents the modulus value. +/// +/// # Returns +/// +/// A `Vec` where each element is reduced modulo `p`. +pub fn reduce_coefficients(coefficients: &[BigInt], p: &BigInt) -> Vec { + coefficients + .iter() + .map(|coeff| { + let mut r = coeff % p; + if r < BigInt::zero() { + r += p; + } + r + }) + .collect() +} + +/// Reduces coefficients in a 2D matrix. +/// +/// # Arguments +/// +/// * `coefficient_matrix` - A 2D matrix of coefficients to reduce. +/// * `p` - The modulus to reduce by. +/// +/// # Returns +/// +/// A new 2D matrix with reduced coefficients. +pub fn reduce_coefficients_2d(coefficient_matrix: &[Vec], p: &BigInt) -> Vec> { + coefficient_matrix + .iter() + .map(|coeffs| reduce_coefficients(coeffs, p)) + .collect() +} + +/// Reduces coefficients in a 3D matrix. +/// +/// # Arguments +/// +/// * `coefficient_matrix` - A 3D matrix of coefficients to reduce. +/// * `p` - The modulus to reduce by. +/// +/// # Returns +/// +/// A new 3D matrix with reduced coefficients. +pub fn reduce_coefficients_3d( + coefficient_matrix: &[Vec>], + p: &BigInt, +) -> Vec>> { + coefficient_matrix + .iter() + .map(|coeffs| reduce_coefficients_2d(coeffs, p)) + .collect() +} + +/// Mutably reduces each element in the given slice of `BigInt` by the modulus `p`. +/// +/// This function modifies the given mutable slice of `BigInt` coefficients in place. It computes +/// `r = coeff % p` for each element, then adds `p` if `r` is negative, ensuring the results are +/// within the range `[0, p-1]`. +/// +/// # Arguments +/// +/// * `coefficients` - A mutable slice of `BigInt` representing the coefficients to be reduced. +/// * `p` - A reference to a `BigInt` that represents the modulus value. +pub fn reduce_coefficients_mut(coefficients: &mut [BigInt], p: &BigInt) { + for coeff in coefficients.iter_mut() { + let mut r = &*coeff % p; + if r < BigInt::zero() { + r += p; + } + *coeff = r; + } +} + +/// Checks if all coefficients in a vector are within a centered range. +/// +/// This function verifies that every coefficient in the input vector falls within +/// the inclusive range [lower_bound, upper_bound]. This is typically used for +/// coefficients that have been centered around zero. +/// +/// # Arguments +/// +/// * `vec` - A slice of `BigInt` coefficients to check. +/// * `lower_bound` - The minimum allowed value (inclusive). +/// * `upper_bound` - The maximum allowed value (inclusive). +/// +/// # Returns +/// +/// `true` if all coefficients are within bounds, `false` otherwise. +pub fn range_check_centered(vec: &[BigInt], lower_bound: &BigInt, upper_bound: &BigInt) -> bool { + vec.iter() + .all(|coeff| coeff >= lower_bound && coeff <= upper_bound) +} + +/// Checks if all coefficients satisfy standard range constraints with separate upper and lower bounds. +/// +/// This function verifies that each coefficient falls within one of two ranges: +/// 1. [0, up_bound] (positive range) +/// 2. [modulus + low_bound, modulus) (negative range wrapped around modulus) +/// +/// This is commonly used in cryptographic applications where coefficients can be +/// represented in both positive and negative forms modulo a prime. +/// +/// # Mathematical Background +/// +/// In modular arithmetic, negative values are often represented as their positive +/// equivalents: `-x ≡ modulus - x (mod modulus)`. This function checks both +/// the direct positive representation and the wrapped negative representation. +/// +/// # Arguments +/// +/// * `vec` - A slice of `BigInt` coefficients to check +/// * `low_bound` - The lower bound for the negative range (typically negative) +/// * `up_bound` - The upper bound for the positive range +/// * `modulus` - The modulus used for wraparound calculations +/// +/// # Returns +/// +/// `true` if all coefficients satisfy the range constraints, `false` otherwise +pub fn range_check_standard_2bounds( + vec: &[BigInt], + low_bound: &BigInt, + up_bound: &BigInt, + modulus: &BigInt, +) -> bool { + vec.iter().all(|coeff| { + (coeff >= &BigInt::from(0) && coeff <= up_bound) + || (coeff >= &(modulus + low_bound) && coeff < modulus) + }) +} + +/// Checks if all coefficients satisfy symmetric standard range constraints. +/// +/// This function verifies that each coefficient falls within one of two symmetric ranges: +/// 1. [0, bound] (positive range) +/// 2. [modulus - bound, modulus) (negative range wrapped around modulus) +/// +/// This is a special case of `range_check_standard_2bounds` where the bounds are +/// symmetric around zero. Commonly used for error distributions in cryptography. +/// +/// # Mathematical Background +/// +/// For a coefficient `c` and bound `b`, this function accepts: +/// - `c ∈ [0, b]` (small positive values). +/// - `c ∈ [modulus - b, modulus)` (small negative values as positive representatives). +/// +/// # Arguments +/// +/// * `vec` - A slice of `BigInt` coefficients to check +/// * `bound` - The symmetric bound (both positive and negative) +/// * `modulus` - The modulus used for wraparound calculations +/// +/// # Returns +/// +/// `true` if all coefficients satisfy the symmetric range constraints, `false` otherwise +pub fn range_check_standard(vec: &[BigInt], bound: &BigInt, modulus: &BigInt) -> bool { + vec.iter().all(|coeff| { + (coeff >= &BigInt::from(0) && coeff <= bound) + || (coeff >= &(modulus - bound) && coeff < modulus) + }) +} + +#[cfg(test)] +mod tests { + use super::*; + use num_bigint::BigInt; + + #[test] + fn test_reduce_and_center() { + let modulus = BigInt::from(7); + let half_modulus = &modulus / 2; + + // Test positive number + assert_eq!( + reduce_and_center(&BigInt::from(10), &modulus, &half_modulus), + BigInt::from(3) + ); + + // Test negative number + assert_eq!( + reduce_and_center(&BigInt::from(-3), &modulus, &half_modulus), + BigInt::from(-3) + ); + + // Test number greater than half modulus + assert_eq!( + reduce_and_center(&BigInt::from(6), &modulus, &half_modulus), + BigInt::from(-1) + ); + } + + #[test] + fn test_reduce_coefficients() { + let coeffs = vec![BigInt::from(10), BigInt::from(-3), BigInt::from(15)]; + let modulus = BigInt::from(7); + let result = reduce_coefficients(&coeffs, &modulus); + assert_eq!( + result, + vec![BigInt::from(3), BigInt::from(4), BigInt::from(1)] + ); + } + + #[test] + fn test_reduce_coefficients_less_than_neg_modulus() { + let modulus = BigInt::from(7); + + // Test with values < -p (the bug fix case) + let coeffs = vec![ + BigInt::from(-10), // -10 % 7 = -3, -3 + 7 = 4 + BigInt::from(-14), // -14 % 7 = 0 + BigInt::from(-15), // -15 % 7 = -1, -1 + 7 = 6 + BigInt::from(-21), // -21 % 7 = 0 + ]; + let result = reduce_coefficients(&coeffs, &modulus); + assert_eq!( + result, + vec![ + BigInt::from(4), + BigInt::from(0), + BigInt::from(6), + BigInt::from(0) + ] + ); + + // Test mixed positive and negative values + let coeffs2 = vec![ + BigInt::from(-50), + BigInt::from(-7), + BigInt::from(-1), + BigInt::from(0), + BigInt::from(1), + BigInt::from(7), + BigInt::from(50), + ]; + let result2 = reduce_coefficients(&coeffs2, &modulus); + assert_eq!( + result2, + vec![ + BigInt::from(6), // -50 % 7 = -1, -1 + 7 = 6 + BigInt::from(0), // -7 % 7 = 0 + BigInt::from(6), // -1 % 7 = -1, -1 + 7 = 6 + BigInt::from(0), + BigInt::from(1), + BigInt::from(0), // 7 % 7 = 0 + BigInt::from(1), // 50 % 7 = 1 + ] + ); + + // Verify all results are in [0, modulus) + for r in &result2 { + assert!(*r >= BigInt::from(0), "Result {} should be >= 0", r); + assert!(*r < modulus, "Result {} should be < {}", r, modulus); + } + } + + #[test] + fn test_range_check_centered() { + let vec = vec![BigInt::from(-2), BigInt::from(0), BigInt::from(2)]; + let lower = BigInt::from(-3); + let upper = BigInt::from(3); + assert!(range_check_centered(&vec, &lower, &upper)); + + let vec_out_of_range = vec![BigInt::from(-5), BigInt::from(0), BigInt::from(2)]; + assert!(!range_check_centered(&vec_out_of_range, &lower, &upper)); + } + + #[test] + fn test_range_check_standard() { + let vec = vec![BigInt::from(1), BigInt::from(2), BigInt::from(3)]; + let bound = BigInt::from(5); + let modulus = BigInt::from(7); + assert!(range_check_standard(&vec, &bound, &modulus)); + } + + #[test] + fn test_reduce_and_center_coefficients() { + let coeffs = vec![BigInt::from(10), BigInt::from(15), BigInt::from(20)]; + let modulus = BigInt::from(7); + let result = reduce_and_center_coefficients(&coeffs, &modulus); + assert_eq!( + result, + vec![BigInt::from(3), BigInt::from(1), BigInt::from(-1)] + ); + } + + #[test] + fn test_reduce_scalar() { + let x = BigInt::from(-3); + let modulus = BigInt::from(7); + let result = reduce_scalar(&x, &modulus); + assert_eq!(result, BigInt::from(4)); + } + + #[test] + fn test_reduce_scalar_less_than_neg_modulus() { + let modulus = BigInt::from(7); + + // Test value < -p (the bug fix case) + assert_eq!(reduce_scalar(&BigInt::from(-10), &modulus), BigInt::from(4)); // -10 % 7 = -3, -3 + 7 = 4 + assert_eq!(reduce_scalar(&BigInt::from(-14), &modulus), BigInt::from(0)); // -14 % 7 = 0 + assert_eq!(reduce_scalar(&BigInt::from(-15), &modulus), BigInt::from(6)); // -15 % 7 = -1, -1 + 7 = 6 + assert_eq!(reduce_scalar(&BigInt::from(-21), &modulus), BigInt::from(0)); // -21 % 7 = 0 + + // Test exactly -p + assert_eq!(reduce_scalar(&BigInt::from(-7), &modulus), BigInt::from(0)); + + // Test values in [-p, 0) + assert_eq!(reduce_scalar(&BigInt::from(-6), &modulus), BigInt::from(1)); // -6 % 7 = -6, -6 + 7 = 1 + assert_eq!(reduce_scalar(&BigInt::from(-1), &modulus), BigInt::from(6)); // -1 % 7 = -1, -1 + 7 = 6 + + // Test positive values + assert_eq!(reduce_scalar(&BigInt::from(0), &modulus), BigInt::from(0)); + assert_eq!(reduce_scalar(&BigInt::from(3), &modulus), BigInt::from(3)); + assert_eq!(reduce_scalar(&BigInt::from(7), &modulus), BigInt::from(0)); + assert_eq!(reduce_scalar(&BigInt::from(10), &modulus), BigInt::from(3)); + + // Verify all results are in [0, modulus) + let test_values = vec![ + BigInt::from(-100), + BigInt::from(-50), + BigInt::from(-7), + BigInt::from(-1), + BigInt::from(0), + BigInt::from(1), + BigInt::from(7), + BigInt::from(50), + BigInt::from(100), + ]; + for val in test_values { + let result = reduce_scalar(&val, &modulus); + assert!( + result >= BigInt::from(0), + "Result {} should be >= 0", + result + ); + assert!( + result < modulus, + "Result {} should be < {}", + result, + modulus + ); + } + } + + #[test] + fn test_reduce_and_center_scalar() { + let x = BigInt::from(6); + let modulus = BigInt::from(7); + let result = reduce_and_center_scalar(&x, &modulus); + assert_eq!(result, BigInt::from(-1)); + } + + #[test] + fn test_reduce_in_ring() { + // Test successful reduction + // cyclo = [1, 0, 1] represents x^2 + 1, so n = cyclo.len() - 1 = 2 + let cyclo = vec![BigInt::from(1), BigInt::from(0), BigInt::from(1)]; + let modulus = BigInt::from(7); + + // Create coefficients: [1, 2, 3] represents x^2 + 2x + 3 + let mut coeffs = vec![BigInt::from(1), BigInt::from(2), BigInt::from(3)]; + + // Reduce in ring: first reduce by cyclotomic, then reduce coefficients modulo + let result = reduce_in_ring(&mut coeffs, &cyclo, &modulus); + assert!(result.is_ok()); + + // Verify coefficients were modified in place + // The result should be the remainder after dividing by x^2 + 1, then reduced mod 7 + // x^2 + 2x + 3 divided by x^2 + 1 gives remainder 2x + 2 + // After right-aligning to n=2 (cyclo.len()-1 = 2): [2, 2] + // After mod 7 and centering: [2, 2] + assert_eq!(coeffs.len(), 2); + // The remainder 2x + 2 = [2, 2], when right-aligned to length 2, gives [2, 2] + assert_eq!(coeffs[0], BigInt::from(2)); + assert_eq!(coeffs[1], BigInt::from(2)); + } + + #[test] + fn test_reduce_in_ring_error_cases() { + // Test with zero cyclotomic polynomial + let cyclo_zero = vec![BigInt::from(0), BigInt::from(0)]; + let modulus = BigInt::from(7); + let mut coeffs = vec![BigInt::from(1), BigInt::from(2)]; + + let result = reduce_in_ring(&mut coeffs, &cyclo_zero, &modulus); + assert!(matches!(result, Err(PolynomialError::DivisionByZero))); + + // Test with invalid cyclotomic (zero leading coefficient) + let cyclo_invalid = vec![BigInt::from(0), BigInt::from(1)]; + let mut coeffs2 = vec![BigInt::from(1), BigInt::from(2)]; + + let result2 = reduce_in_ring(&mut coeffs2, &cyclo_invalid, &modulus); + assert!(matches!( + result2, + Err(PolynomialError::InvalidPolynomial { .. }) + )); + } + + #[test] + fn test_reduce_in_ring_modulus_reduction() { + // Test that coefficients are properly reduced and centered modulo + let cyclo = vec![BigInt::from(1), BigInt::from(0), BigInt::from(1)]; + let modulus = BigInt::from(7); + + // Create coefficients with large values + let mut coeffs = vec![BigInt::from(10), BigInt::from(15), BigInt::from(20)]; + + let result = reduce_in_ring(&mut coeffs, &cyclo, &modulus); + assert!(result.is_ok()); + + // Verify coefficients are reduced and centered (within [-3, 3] for modulus 7) + for coeff in &coeffs { + assert!(*coeff >= BigInt::from(-3)); + assert!(*coeff <= BigInt::from(3)); + } + } + + #[test] + fn test_reduce_coefficients_mut() { + let modulus = BigInt::from(7); + + // Test with values < -p (the bug fix case) + let mut coeffs = vec![ + BigInt::from(-10), // -10 % 7 = -3, -3 + 7 = 4 + BigInt::from(-14), // -14 % 7 = 0 + BigInt::from(-15), // -15 % 7 = -1, -1 + 7 = 6 + BigInt::from(-21), // -21 % 7 = 0 + ]; + reduce_coefficients_mut(&mut coeffs, &modulus); + assert_eq!( + coeffs, + vec![ + BigInt::from(4), + BigInt::from(0), + BigInt::from(6), + BigInt::from(0) + ] + ); + + // Test mixed positive and negative values + let mut coeffs2 = vec![ + BigInt::from(-50), + BigInt::from(-7), + BigInt::from(-1), + BigInt::from(0), + BigInt::from(1), + BigInt::from(7), + BigInt::from(50), + ]; + reduce_coefficients_mut(&mut coeffs2, &modulus); + assert_eq!( + coeffs2, + vec![ + BigInt::from(6), // -50 % 7 = -1, -1 + 7 = 6 + BigInt::from(0), // -7 % 7 = 0 + BigInt::from(6), // -1 % 7 = -1, -1 + 7 = 6 + BigInt::from(0), + BigInt::from(1), + BigInt::from(0), // 7 % 7 = 0 + BigInt::from(1), // 50 % 7 = 1 + ] + ); + + // Verify all results are in [0, modulus) + for r in &coeffs2 { + assert!(*r >= BigInt::from(0), "Result {} should be >= 0", r); + assert!(*r < modulus, "Result {} should be < {}", r, modulus); + } + + // Test that it modifies in place + let mut coeffs3 = vec![BigInt::from(-3)]; + let original_ptr = coeffs3.as_ptr(); + reduce_coefficients_mut(&mut coeffs3, &modulus); + assert_eq!(coeffs3[0], BigInt::from(4)); + assert_eq!(coeffs3.as_ptr(), original_ptr); // Same memory location + } +} diff --git a/examples/CRISP/Cargo.lock b/examples/CRISP/Cargo.lock index b545a2ae44..9596d540c0 100644 --- a/examples/CRISP/Cargo.lock +++ b/examples/CRISP/Cargo.lock @@ -4320,6 +4320,16 @@ version = "0.3.32" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c" +[[package]] +name = "polynomial" +version = "0.1.7" +dependencies = [ + "num-bigint", + "num-traits", + "serde", + "thiserror 1.0.69", +] + [[package]] name = "portable-atomic" version = "1.12.0" @@ -6712,7 +6722,6 @@ version = "0.1.0" dependencies = [ "ark-bn254 0.5.0", "ark-ff 0.5.0", - "bigint-poly", "crisp-constants", "e3-sdk", "eyre", @@ -6724,6 +6733,7 @@ dependencies = [ "num-bigint", "num-integer", "num-traits", + "polynomial", "rand 0.8.5", "rayon", "serde", diff --git a/examples/CRISP/Cargo.toml b/examples/CRISP/Cargo.toml index b75fa344e6..fc00926ba2 100644 --- a/examples/CRISP/Cargo.toml +++ b/examples/CRISP/Cargo.toml @@ -39,6 +39,7 @@ e3-compute-provider = { path = "../../crates/compute-provider" } e3-program-server = { path = "../../crates/program-server" } e3-bfv-helpers = { path = "../../crates/bfv-helpers" } e3-sdk = { path = "../../crates/sdk", default-features = false } +polynomial = { path = "../../crates/polynomial" } eyre = "=0.6.12" env_logger = "=0.11.8" hex = { version = "=0.4.3" } diff --git a/examples/CRISP/crates/zk-inputs/Cargo.toml b/examples/CRISP/crates/zk-inputs/Cargo.toml index 69f81eb5de..d0e5a0d589 100644 --- a/examples/CRISP/crates/zk-inputs/Cargo.toml +++ b/examples/CRISP/crates/zk-inputs/Cargo.toml @@ -14,7 +14,7 @@ fhe-math.workspace = true fhe-traits.workspace = true greco = { package = "zkfhe-greco", git = "https://github.com/gnosisguild/zkfhe-generator" } shared = { package = "zkfhe-shared", git = "https://github.com/gnosisguild/zkfhe-generator" } -bigint-poly = { git = "https://github.com/gnosisguild/bigint-poly", features = ["serde"] } +polynomial = { workspace = true, features = ["serde"] } serde.workspace = true serde_json.workspace = true num-bigint = "0.4.6" diff --git a/examples/CRISP/crates/zk-inputs/src/ciphertext_addition.rs b/examples/CRISP/crates/zk-inputs/src/ciphertext_addition.rs index c6695cfed4..debaf02c7f 100644 --- a/examples/CRISP/crates/zk-inputs/src/ciphertext_addition.rs +++ b/examples/CRISP/crates/zk-inputs/src/ciphertext_addition.rs @@ -5,7 +5,6 @@ // or FITNESS FOR A PARTICULAR PURPOSE. use crate::commitments::compute_commitment; -use bigint_poly::*; use eyre::{Context, Result}; use fhe::bfv::BfvParameters; use fhe::bfv::Ciphertext; @@ -15,6 +14,7 @@ use itertools::izip; use num_bigint::BigInt; use num_integer::Integer; use num_traits::Zero; +use polynomial::{reduce_and_center_coefficients_mut, reduce_coefficients_2d}; use rayon::iter::{ParallelBridge, ParallelIterator}; use shared::constants::get_zkp_modulus; use std::sync::Arc; diff --git a/package.json b/package.json index ced2a6b0f3..0de69e58ec 100644 --- a/package.json +++ b/package.json @@ -73,6 +73,7 @@ "eslint": "^9.39.1", "glob": "^11.0.3", "husky": "^9.1.7", + "lint-staged": "^15.2.0", "prettier": "^3.1.1", "prettier-plugin-solidity": "^1.2.0", "prettier-plugin-tailwindcss": "^0.6.9", @@ -88,5 +89,10 @@ "undici-types": "6.19.8", "viem": "2.38.6" } + }, + "lint-staged": { + "*.{js,jsx,mjs,cjs,json,md,mdx,ts,tsx,yml,yaml,css,sol}": [ + "prettier --check" + ] } } diff --git a/packages/enclave-contracts/package.json b/packages/enclave-contracts/package.json index 44b671f69b..48c26d54f6 100644 --- a/packages/enclave-contracts/package.json +++ b/packages/enclave-contracts/package.json @@ -160,8 +160,7 @@ "ciphernode:remove": "hardhat ciphernode:remove", "ciphernode:siblings": "hardhat ciphernode:siblings", "committee:new": "hardhat committee:new", - "lint": "pnpm lint:sol && pnpm prettier:check", - "lint:sol": "solhint --disc --max-warnings 10 \"contracts/**/*.sol\"", + "lint": "solhint --disc --max-warnings 10 \"contracts/**/*.sol\"", "prettier:check": "prettier --check \"**/*.{js,json,md,sol,ts,yml}\"", "prettier:write": "prettier --write \"**/*.{js,json,md,sol,ts,yml}\"", "test": "hardhat test mocha", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index eb6dfbd936..b408afeb7f 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -36,6 +36,9 @@ importers: husky: specifier: ^9.1.7 version: 9.1.7 + lint-staged: + specifier: ^15.2.0 + version: 15.5.2 prettier: specifier: ^3.1.1 version: 3.6.2 @@ -202,7 +205,7 @@ importers: devDependencies: '@tailwindcss/typography': specifier: ^0.5.12 - version: 0.5.19(tailwindcss@3.4.18(tsx@4.20.6)) + version: 0.5.19(tailwindcss@3.4.18(tsx@4.20.6)(yaml@2.8.2)) '@types/react': specifier: ^18.2.66 version: 18.3.26 @@ -232,7 +235,7 @@ importers: version: 0.5.14(@trivago/prettier-plugin-sort-imports@4.3.0(prettier@3.6.2))(prettier@3.6.2) tailwindcss: specifier: ^3.4.2 - version: 3.4.18(tsx@4.20.6) + version: 3.4.18(tsx@4.20.6)(yaml@2.8.2) typescript: specifier: 5.8.3 version: 5.8.3 @@ -372,7 +375,7 @@ importers: version: 6.2.0 tsup: specifier: 8.5.0 - version: 8.5.0(@microsoft/api-extractor@7.54.0(@types/node@22.7.5))(@swc/core@1.15.0(@swc/helpers@0.5.17))(jiti@1.21.7)(postcss@8.5.6)(tsx@4.20.6)(typescript@5.8.3) + version: 8.5.0(@microsoft/api-extractor@7.54.0(@types/node@22.7.5))(@swc/core@1.15.0(@swc/helpers@0.5.17))(jiti@1.21.7)(postcss@8.5.6)(tsx@4.20.6)(typescript@5.8.3)(yaml@2.8.2) typescript: specifier: 5.8.3 version: 5.8.3 @@ -429,7 +432,7 @@ importers: version: 15.15.0 tsup: specifier: 8.5.0 - version: 8.5.0(@microsoft/api-extractor@7.54.0(@types/node@22.7.5))(@swc/core@1.15.0(@swc/helpers@0.5.17))(jiti@1.21.7)(postcss@8.5.6)(tsx@4.20.6)(typescript@5.8.3) + version: 8.5.0(@microsoft/api-extractor@7.54.0(@types/node@22.7.5))(@swc/core@1.15.0(@swc/helpers@0.5.17))(jiti@1.21.7)(postcss@8.5.6)(tsx@4.20.6)(typescript@5.8.3)(yaml@2.8.2) packages/enclave-contracts: dependencies: @@ -565,7 +568,7 @@ importers: version: 0.1.1 tsup: specifier: 8.5.0 - version: 8.5.0(@microsoft/api-extractor@7.54.0(@types/node@22.7.5))(@swc/core@1.15.0(@swc/helpers@0.5.17))(jiti@1.21.7)(postcss@8.5.6)(tsx@4.20.6)(typescript@5.8.3) + version: 8.5.0(@microsoft/api-extractor@7.54.0(@types/node@22.7.5))(@swc/core@1.15.0(@swc/helpers@0.5.17))(jiti@1.21.7)(postcss@8.5.6)(tsx@4.20.6)(typescript@5.8.3)(yaml@2.8.2) typechain: specifier: ^8.3.2 version: 8.3.2(typescript@5.8.3) @@ -596,7 +599,7 @@ importers: version: 18.3.26 tsup: specifier: 8.5.0 - version: 8.5.0(@microsoft/api-extractor@7.54.0(@types/node@22.7.5))(@swc/core@1.15.0(@swc/helpers@0.5.17))(jiti@1.21.7)(postcss@8.5.6)(tsx@4.20.6)(typescript@5.8.3) + version: 8.5.0(@microsoft/api-extractor@7.54.0(@types/node@22.7.5))(@swc/core@1.15.0(@swc/helpers@0.5.17))(jiti@1.21.7)(postcss@8.5.6)(tsx@4.20.6)(typescript@5.8.3)(yaml@2.8.2) typescript: specifier: 5.8.3 version: 5.8.3 @@ -623,10 +626,10 @@ importers: version: 2.38.6(bufferutil@4.0.9)(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@4.1.12) vite-plugin-top-level-await: specifier: ^1.5.0 - version: 1.6.0(@swc/helpers@0.5.17)(rollup@4.52.5)(vite@6.4.1(@types/node@22.7.5)(jiti@1.21.7)(tsx@4.20.6)) + version: 1.6.0(@swc/helpers@0.5.17)(rollup@4.52.5)(vite@6.4.1(@types/node@22.7.5)(jiti@1.21.7)(tsx@4.20.6)(yaml@2.8.2)) vite-plugin-wasm: specifier: ^3.4.1 - version: 3.5.0(vite@6.4.1(@types/node@22.7.5)(jiti@1.21.7)(tsx@4.20.6)) + version: 3.5.0(vite@6.4.1(@types/node@22.7.5)(jiti@1.21.7)(tsx@4.20.6)(yaml@2.8.2)) vitest: specifier: ^1.6.1 version: 1.6.1(@types/node@22.7.5) @@ -642,16 +645,16 @@ importers: version: 9.2.1 tsup: specifier: 8.5.0 - version: 8.5.0(@microsoft/api-extractor@7.54.0(@types/node@22.7.5))(@swc/core@1.15.0(@swc/helpers@0.5.17))(jiti@1.21.7)(postcss@8.5.6)(tsx@4.20.6)(typescript@5.8.3) + version: 8.5.0(@microsoft/api-extractor@7.54.0(@types/node@22.7.5))(@swc/core@1.15.0(@swc/helpers@0.5.17))(jiti@1.21.7)(postcss@8.5.6)(tsx@4.20.6)(typescript@5.8.3)(yaml@2.8.2) typescript: specifier: 5.8.3 version: 5.8.3 vite: specifier: ^6.2.0 - version: 6.4.1(@types/node@22.7.5)(jiti@1.21.7)(tsx@4.20.6) + version: 6.4.1(@types/node@22.7.5)(jiti@1.21.7)(tsx@4.20.6)(yaml@2.8.2) vite-plugin-dts: specifier: ^4.5.3 - version: 4.5.4(@types/node@22.7.5)(rollup@4.52.5)(typescript@5.8.3)(vite@6.4.1(@types/node@22.7.5)(jiti@1.21.7)(tsx@4.20.6)) + version: 4.5.4(@types/node@22.7.5)(rollup@4.52.5)(typescript@5.8.3)(vite@6.4.1(@types/node@22.7.5)(jiti@1.21.7)(tsx@4.20.6)(yaml@2.8.2)) templates/default: dependencies: @@ -809,7 +812,7 @@ importers: devDependencies: '@tailwindcss/typography': specifier: ^0.5.12 - version: 0.5.19(tailwindcss@3.4.18(tsx@4.20.6)) + version: 0.5.19(tailwindcss@3.4.18(tsx@4.20.6)(yaml@2.8.2)) '@types/react': specifier: ^18.2.66 version: 18.3.26 @@ -830,7 +833,7 @@ importers: version: 0.5.14(@trivago/prettier-plugin-sort-imports@4.3.0(prettier@3.6.2))(prettier@3.6.2) tailwindcss: specifier: ^3.4.2 - version: 3.4.18(tsx@4.20.6) + version: 3.4.18(tsx@4.20.6)(yaml@2.8.2) typescript: specifier: 5.8.3 version: 5.8.3 @@ -4478,6 +4481,10 @@ packages: resolution: {integrity: sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw==} engines: {node: '>=6'} + ansi-escapes@7.2.0: + resolution: {integrity: sha512-g6LhBsl+GBPRWGWsBtutpzBYuIIdBkLEvad5C/va/74Db018+5TZiyA26cZJAr3Rft5lprVqOIPxf5Vid6tqAw==} + engines: {node: '>=18'} + ansi-regex@3.0.1: resolution: {integrity: sha512-+O9Jct8wf++lXxxFc4hc8LsjaSq0HFzzL7cVsw8pRDIPdjKD2mT4ytDZlLuSBZ4cLKZFXIrMGO7DbQCtMJJMKw==} engines: {node: '>=4'} @@ -4979,6 +4986,10 @@ packages: resolution: {integrity: sha512-Mz9QMT5fJe7bKI7MH31UilT5cEK5EHHRCccw/YRFsRY47AuNgaV6HY3rscp0/I4Q+tTW/5zoqpSeRRI54TkDWA==} engines: {node: '>= 0.10'} + cli-cursor@5.0.0: + resolution: {integrity: sha512-aCj4O5wKyszjMmDT4tZj93kxyydN/K5zPWSCe6/0AV/AA1pqe5ZBIw0a2ZfPQV7lL5/yb5HsUreJ6UFAF1tEQw==} + engines: {node: '>=18'} + cli-table3@0.5.1: resolution: {integrity: sha512-7Qg2Jrep1S/+Q3EceiZtQcDPWxhAvBw+ERf1162v4sikJrvojMHFqXt8QIVha8UlH9rgU0BeWPytZ9/TzYqlUw==} engines: {node: '>=6'} @@ -4987,6 +4998,10 @@ packages: resolution: {integrity: sha512-+W/5efTR7y5HRD7gACw9yQjqMVvEMLBHmboM/kPWam+H+Hmyrgjh6YncVKK122YZkXrLudzTuAukUw9FnMf7IQ==} engines: {node: 10.* || >= 12.*} + cli-truncate@4.0.0: + resolution: {integrity: sha512-nPdaFdQ0h/GEigbPClz11D0v/ZJEwxmeVZGeMo3Z5StPtUTkA9o1lD6QwoirYiSDzbcwn2XcjwmCp68W1IS4TA==} + engines: {node: '>=18'} + client-only@0.0.1: resolution: {integrity: sha512-IV3Ou0jSMzZrd3pZ48nLkT9DA7Ag1pnPzaiQhpW7c3RbcqqzvzzVu+L8gfqMp/8IM2MQtSiqaCxrrcfu8I8rMA==} @@ -5029,6 +5044,9 @@ packages: color-name@1.1.4: resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==} + colorette@2.0.20: + resolution: {integrity: sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==} + colors@1.4.0: resolution: {integrity: sha512-a+UqTh4kgZg/SlGvfbzDHpgRu7AAQOmmqRHJnxhRZICKFUT91brVhNNt58CMWU9PsBbv3PDCZUHbVxuDiH2mtA==} engines: {node: '>=0.1.90'} @@ -5761,6 +5779,10 @@ packages: resolution: {integrity: sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A==} engines: {node: '>=6'} + environment@1.1.0: + resolution: {integrity: sha512-xUtoPkMggbz0MPyPiIWr1Kp4aeWJjDZ6SMvURhimjdZgsRuDplF5/s9hcgGhyXMhs+6vpnuoiZ2kFiu3FMnS8Q==} + engines: {node: '>=18'} + error-ex@1.3.4: resolution: {integrity: sha512-sqQamAnR14VgCr1A618A3sGrygcpK+HEbenA/HiEAkkUwcZIIB/tgWqHFxWgOyDh4nB4JCRimh79dR5Ywc9MDQ==} @@ -6803,6 +6825,14 @@ packages: resolution: {integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==} engines: {node: '>=8'} + is-fullwidth-code-point@4.0.0: + resolution: {integrity: sha512-O4L094N2/dZ7xqVdrXhh9r1KODPJpFms8B5sGdJLPy664AgvXsreZUyCQQNItZRDlYug4xStLjNp/sz3HvBowQ==} + engines: {node: '>=12'} + + is-fullwidth-code-point@5.1.0: + resolution: {integrity: sha512-5XHYaSyiqADb4RnZ1Bdad6cPp8Toise4TzEjcOYDHZkTCbKgiUl7WTUCpNWHuxmDt91wnsZBc9xinNzopv3JMQ==} + engines: {node: '>=18'} + is-generator-function@1.1.2: resolution: {integrity: sha512-upqt1SkGkODW9tsGNG5mtXTXtECizwtS2kA161M+gJPc1xdb/Ax629af6YrTwcOeQHbewrPNlE5Dx7kzvXTizA==} engines: {node: '>= 0.4'} @@ -7087,9 +7117,18 @@ packages: lines-and-columns@1.2.4: resolution: {integrity: sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==} + lint-staged@15.5.2: + resolution: {integrity: sha512-YUSOLq9VeRNAo/CTaVmhGDKG+LBtA8KF1X4K5+ykMSwWST1vDxJRB2kv2COgLb1fvpCo+A/y9A0G0znNVmdx4w==} + engines: {node: '>=18.12.0'} + hasBin: true + listenercount@1.0.1: resolution: {integrity: sha512-3mk/Zag0+IJxeDrxSgaDPy4zZ3w05PRZeJNnlWhzFz5OkX49J4krc+A8X2d2M69vGMBEX0uyl8M+W+8gH+kBqQ==} + listr2@8.3.3: + resolution: {integrity: sha512-LWzX2KsqcB1wqQ4AHgYb4RsDXauQiqhjLk+6hjbaeHG4zpjjVAB6wC/gz6X0l+Du1cN3pUB5ZlrvTbhGSNnUQQ==} + engines: {node: '>=18.0.0'} + lit-element@4.2.1: resolution: {integrity: sha512-WGAWRGzirAgyphK2urmYOV72tlvnxw7YfyLDgQ+OZnM9vQQBQnumQ7jUJe6unEzwGU3ahFOjuz1iz1jjrpCPuw==} @@ -7148,6 +7187,10 @@ packages: resolution: {integrity: sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==} engines: {node: '>=10'} + log-update@6.1.0: + resolution: {integrity: sha512-9ie8ItPR6tjY5uYJh8K/Zrv/RMZ5VOlOWvtZdEHYSTFKZfIBPQa9tOAEeAWhd+AnIneLJ22w5fjOYtoutpWq5w==} + engines: {node: '>=18'} + longest-streak@3.1.0: resolution: {integrity: sha512-9Ri+o0JYgehTaVBBDoMqIl8GXtbWg711O3srftcHhZ0dqnETqLaoIK0x17fUw9rFSlK/0NlsKe0Ahhyl5pXE2g==} @@ -7541,6 +7584,10 @@ packages: resolution: {integrity: sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw==} engines: {node: '>=12'} + mimic-function@5.0.1: + resolution: {integrity: sha512-VP79XUPxV2CigYP3jWwAUFSku2aKqBH7uTAapFWCBqutsbmDo96KY5o8uh6U+/YSIn5OxJnXp73beVkpqMIGhA==} + engines: {node: '>=18'} + mimic-response@3.1.0: resolution: {integrity: sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ==} engines: {node: '>=10'} @@ -7856,6 +7903,10 @@ packages: resolution: {integrity: sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==} engines: {node: '>=12'} + onetime@7.0.0: + resolution: {integrity: sha512-VXJjc87FScF88uafS3JllDgvAm+c/Slfz06lorj2uAY34rlUu0Nt+v8wreiImcrgAjjIHp1rXpTDlLOGw29WwQ==} + engines: {node: '>=18'} + openapi-fetch@0.13.8: resolution: {integrity: sha512-yJ4QKRyNxE44baQ9mY5+r/kAzZ8yXMemtNAOFwOzRXJscdjSxxzWSNlyBAr+o5JjkUw9Lc3W7OIoca0cY3PYnQ==} @@ -8066,6 +8117,11 @@ packages: resolution: {integrity: sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==} engines: {node: '>=12'} + pidtree@0.6.0: + resolution: {integrity: sha512-eG2dWTVw5bzqGRztnHExczNxt5VGsE6OwTeCG3fdUf9KBsZzO3R5OIIIzWR+iZA0NtZ+RDVdaoE2dK1cn6jH4g==} + engines: {node: '>=0.10'} + hasBin: true + pify@2.3.0: resolution: {integrity: sha512-udgsAY+fTnvv7kI7aaxbqwWNb0AHiB0qBO89PZKPkoTmGOgdbrHDKD+0B2X4uTfJ/FT1R09r9gTsjUjNJotuog==} engines: {node: '>=0.10.0'} @@ -8765,6 +8821,10 @@ packages: resolution: {integrity: sha512-40yHxbNcl2+rzXvZuVkrYohathsSJlMTXKryG5y8uciHv1+xDLHQpgjG64JUO9nrEq2jGLH6IZ8BcZyw3wrweg==} engines: {node: '>=14.16'} + restore-cursor@5.1.0: + resolution: {integrity: sha512-oMA2dcrw6u0YfxJQXm342bFKX/E4sG9rbTzO9ptUcR/e8A33cHuvStiYOwH7fszkZlZ1z/ta9AAoPk2F4qIOHA==} + engines: {node: '>=18'} + reusify@1.1.0: resolution: {integrity: sha512-g6QUff04oZpHs0eG5p83rFLhHeV00ug/Yf9nZM6fLeUrPguBTkTQOdpAWWspMh55TZfVQDPaN3NQJfbVRAxdIw==} engines: {iojs: '>=1.0.0', node: '>=0.10.0'} @@ -8970,6 +9030,14 @@ packages: resolution: {integrity: sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==} engines: {node: '>=10'} + slice-ansi@5.0.0: + resolution: {integrity: sha512-FC+lgizVPfie0kkhqUScwRu1O/lF6NOgJmlCgK+/LYxDCTk8sGelYaHDhFcDN+Sn3Cv+3VSa4Byeo+IMCzpMgQ==} + engines: {node: '>=12'} + + slice-ansi@7.1.2: + resolution: {integrity: sha512-iOBWFgUX7caIZiuutICxVgX1SdxwAVFFKwt1EvMYYec/NWO5meOJ6K5uQxhrYBdQJne4KxiqZc+KptFOWFSI9w==} + engines: {node: '>=18'} + snake-case@3.0.4: resolution: {integrity: sha512-LAOh4z89bGQvl9pFfNF8V146i7o7/CqFPbqzYgP+yYzDIDeS9HaNFtXABamRW+AQzEVODcvE79ljJ+8a9YSdMg==} @@ -10155,6 +10223,11 @@ packages: resolution: {integrity: sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==} engines: {node: '>= 6'} + yaml@2.8.2: + resolution: {integrity: sha512-mplynKqc1C2hTVYxd0PU2xQAc22TI1vShAYGksCCfxbn/dFwnHTNi1bvYsBTkhdUNtGIf5xNOg938rrSSYvS9A==} + engines: {node: '>= 14.6'} + hasBin: true + yargs-parser@18.1.3: resolution: {integrity: sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==} engines: {node: '>=6'} @@ -14132,7 +14205,7 @@ snapshots: gradient-string: 2.0.2 playwright-core: 1.52.0 progress: 2.0.3 - tsup: 8.5.0(@microsoft/api-extractor@7.54.0(@types/node@22.7.5))(@swc/core@1.15.0(@swc/helpers@0.5.17))(jiti@1.21.7)(postcss@8.5.6)(tsx@4.20.6)(typescript@5.8.3) + tsup: 8.5.0(@microsoft/api-extractor@7.54.0(@types/node@22.7.5))(@swc/core@1.15.0(@swc/helpers@0.5.17))(jiti@1.21.7)(postcss@8.5.6)(tsx@4.20.6)(typescript@5.8.3)(yaml@2.8.2) unzip-crx-3: 0.2.0 unzipper: 0.10.14 zod: 3.22.4 @@ -14158,7 +14231,7 @@ snapshots: gradient-string: 2.0.2 playwright-core: 1.52.0 progress: 2.0.3 - tsup: 8.5.0(@microsoft/api-extractor@7.54.0(@types/node@22.7.5))(@swc/core@1.15.0(@swc/helpers@0.5.17))(jiti@1.21.7)(postcss@8.5.6)(tsx@4.20.6)(typescript@5.8.3) + tsup: 8.5.0(@microsoft/api-extractor@7.54.0(@types/node@22.7.5))(@swc/core@1.15.0(@swc/helpers@0.5.17))(jiti@1.21.7)(postcss@8.5.6)(tsx@4.20.6)(typescript@5.8.3)(yaml@2.8.2) unzip-crx-3: 0.2.0 unzipper: 0.10.14 zod: 3.22.4 @@ -14251,10 +14324,10 @@ snapshots: dependencies: defer-to-connect: 2.0.1 - '@tailwindcss/typography@0.5.19(tailwindcss@3.4.18(tsx@4.20.6))': + '@tailwindcss/typography@0.5.19(tailwindcss@3.4.18(tsx@4.20.6)(yaml@2.8.2))': dependencies: postcss-selector-parser: 6.0.10 - tailwindcss: 3.4.18(tsx@4.20.6) + tailwindcss: 3.4.18(tsx@4.20.6)(yaml@2.8.2) '@tanstack/query-core@5.90.6': {} @@ -15619,6 +15692,10 @@ snapshots: ansi-colors@4.1.3: {} + ansi-escapes@7.2.0: + dependencies: + environment: 1.1.0 + ansi-regex@3.0.1: {} ansi-regex@5.0.1: {} @@ -16163,6 +16240,10 @@ snapshots: safe-buffer: 5.2.1 to-buffer: 1.2.2 + cli-cursor@5.0.0: + dependencies: + restore-cursor: 5.1.0 + cli-table3@0.5.1: dependencies: object-assign: 4.1.1 @@ -16176,6 +16257,11 @@ snapshots: optionalDependencies: '@colors/colors': 1.5.0 + cli-truncate@4.0.0: + dependencies: + slice-ansi: 5.0.0 + string-width: 7.2.0 + client-only@0.0.1: {} clipboardy@1.2.2: @@ -16223,6 +16309,8 @@ snapshots: color-name@1.1.4: {} + colorette@2.0.20: {} + colors@1.4.0: {} combined-stream@1.0.8: @@ -17014,6 +17102,8 @@ snapshots: env-paths@2.2.1: {} + environment@1.1.0: {} + error-ex@1.3.4: dependencies: is-arrayish: 0.2.1 @@ -18483,6 +18573,12 @@ snapshots: is-fullwidth-code-point@3.0.0: {} + is-fullwidth-code-point@4.0.0: {} + + is-fullwidth-code-point@5.1.0: + dependencies: + get-east-asian-width: 1.4.0 + is-generator-function@1.1.2: dependencies: call-bound: 1.0.4 @@ -18736,8 +18832,32 @@ snapshots: lines-and-columns@1.2.4: {} + lint-staged@15.5.2: + dependencies: + chalk: 5.6.2 + commander: 13.1.0 + debug: 4.4.3(supports-color@8.1.1) + execa: 8.0.1 + lilconfig: 3.1.3 + listr2: 8.3.3 + micromatch: 4.0.8 + pidtree: 0.6.0 + string-argv: 0.3.2 + yaml: 2.8.2 + transitivePeerDependencies: + - supports-color + listenercount@1.0.1: {} + listr2@8.3.3: + dependencies: + cli-truncate: 4.0.0 + colorette: 2.0.20 + eventemitter3: 5.0.1 + log-update: 6.1.0 + rfdc: 1.4.1 + wrap-ansi: 9.0.2 + lit-element@4.2.1: dependencies: '@lit-labs/ssr-dom-shim': 1.4.0 @@ -18796,6 +18916,14 @@ snapshots: chalk: 4.1.2 is-unicode-supported: 0.1.0 + log-update@6.1.0: + dependencies: + ansi-escapes: 7.2.0 + cli-cursor: 5.0.0 + slice-ansi: 7.1.2 + strip-ansi: 7.1.2 + wrap-ansi: 9.0.2 + longest-streak@3.1.0: {} loose-envify@1.4.0: @@ -19606,6 +19734,8 @@ snapshots: mimic-fn@4.0.0: {} + mimic-function@5.0.1: {} + mimic-response@3.1.0: {} mimic-response@4.0.0: {} @@ -20015,6 +20145,10 @@ snapshots: dependencies: mimic-fn: 4.0.0 + onetime@7.0.0: + dependencies: + mimic-function: 5.0.1 + openapi-fetch@0.13.8: dependencies: openapi-typescript-helpers: 0.0.15 @@ -20072,21 +20206,6 @@ snapshots: transitivePeerDependencies: - zod - ox@0.9.6(typescript@5.8.3): - dependencies: - '@adraffy/ens-normalize': 1.11.1 - '@noble/ciphers': 1.3.0 - '@noble/curves': 1.9.1 - '@noble/hashes': 1.8.0 - '@scure/bip32': 1.7.0 - '@scure/bip39': 1.6.0 - abitype: 1.1.1(typescript@5.8.3)(zod@4.1.12) - eventemitter3: 5.0.1 - optionalDependencies: - typescript: 5.8.3 - transitivePeerDependencies: - - zod - ox@0.9.6(typescript@5.8.3)(zod@3.22.4): dependencies: '@adraffy/ens-normalize': 1.11.1 @@ -20294,6 +20413,8 @@ snapshots: picomatch@4.0.3: {} + pidtree@0.6.0: {} + pify@2.3.0: {} pify@3.0.0: {} @@ -20444,13 +20565,14 @@ snapshots: camelcase-css: 2.0.1 postcss: 8.5.6 - postcss-load-config@6.0.1(jiti@1.21.7)(postcss@8.5.6)(tsx@4.20.6): + postcss-load-config@6.0.1(jiti@1.21.7)(postcss@8.5.6)(tsx@4.20.6)(yaml@2.8.2): dependencies: lilconfig: 3.1.3 optionalDependencies: jiti: 1.21.7 postcss: 8.5.6 tsx: 4.20.6 + yaml: 2.8.2 postcss-nested@6.2.0(postcss@8.5.6): dependencies: @@ -20941,6 +21063,11 @@ snapshots: dependencies: lowercase-keys: 3.0.0 + restore-cursor@5.1.0: + dependencies: + onetime: 7.0.0 + signal-exit: 4.1.0 + reusify@1.1.0: {} rfdc@1.4.1: {} @@ -21240,6 +21367,16 @@ snapshots: astral-regex: 2.0.0 is-fullwidth-code-point: 3.0.0 + slice-ansi@5.0.0: + dependencies: + ansi-styles: 6.2.3 + is-fullwidth-code-point: 4.0.0 + + slice-ansi@7.1.2: + dependencies: + ansi-styles: 6.2.3 + is-fullwidth-code-point: 5.1.0 + snake-case@3.0.4: dependencies: dot-case: 3.0.4 @@ -21605,7 +21742,7 @@ snapshots: string-width: 4.2.3 strip-ansi: 6.0.1 - tailwindcss@3.4.18(tsx@4.20.6): + tailwindcss@3.4.18(tsx@4.20.6)(yaml@2.8.2): dependencies: '@alloc/quick-lru': 5.2.0 arg: 5.0.2 @@ -21624,7 +21761,7 @@ snapshots: postcss: 8.5.6 postcss-import: 15.1.0(postcss@8.5.6) postcss-js: 4.1.0(postcss@8.5.6) - postcss-load-config: 6.0.1(jiti@1.21.7)(postcss@8.5.6)(tsx@4.20.6) + postcss-load-config: 6.0.1(jiti@1.21.7)(postcss@8.5.6)(tsx@4.20.6)(yaml@2.8.2) postcss-nested: 6.2.0(postcss@8.5.6) postcss-selector-parser: 6.1.2 resolve: 1.22.11 @@ -21819,7 +21956,7 @@ snapshots: tslib@2.8.1: {} - tsup@8.5.0(@microsoft/api-extractor@7.54.0(@types/node@22.7.5))(@swc/core@1.15.0(@swc/helpers@0.5.17))(jiti@1.21.7)(postcss@8.5.6)(tsx@4.20.6)(typescript@5.8.3): + tsup@8.5.0(@microsoft/api-extractor@7.54.0(@types/node@22.7.5))(@swc/core@1.15.0(@swc/helpers@0.5.17))(jiti@1.21.7)(postcss@8.5.6)(tsx@4.20.6)(typescript@5.8.3)(yaml@2.8.2): dependencies: bundle-require: 5.1.0(esbuild@0.25.12) cac: 6.7.14 @@ -21830,7 +21967,7 @@ snapshots: fix-dts-default-cjs-exports: 1.0.1 joycon: 3.1.1 picocolors: 1.1.1 - postcss-load-config: 6.0.1(jiti@1.21.7)(postcss@8.5.6)(tsx@4.20.6) + postcss-load-config: 6.0.1(jiti@1.21.7)(postcss@8.5.6)(tsx@4.20.6)(yaml@2.8.2) resolve-from: 5.0.0 rollup: 4.52.5 source-map: 0.8.0-beta.0 @@ -22191,7 +22328,7 @@ snapshots: '@scure/bip39': 1.6.0 abitype: 1.1.0(typescript@5.8.3)(zod@4.1.12) isows: 1.0.7(ws@8.18.3(bufferutil@4.0.9)(utf-8-validate@5.0.10)) - ox: 0.9.6(typescript@5.8.3) + ox: 0.9.6(typescript@5.8.3)(zod@4.1.12) ws: 8.18.3(bufferutil@4.0.9)(utf-8-validate@5.0.10) optionalDependencies: typescript: 5.8.3 @@ -22269,7 +22406,7 @@ snapshots: - supports-color - terser - vite-plugin-dts@4.5.4(@types/node@22.7.5)(rollup@4.52.5)(typescript@5.8.3)(vite@6.4.1(@types/node@22.7.5)(jiti@1.21.7)(tsx@4.20.6)): + vite-plugin-dts@4.5.4(@types/node@22.7.5)(rollup@4.52.5)(typescript@5.8.3)(vite@6.4.1(@types/node@22.7.5)(jiti@1.21.7)(tsx@4.20.6)(yaml@2.8.2)): dependencies: '@microsoft/api-extractor': 7.54.0(@types/node@22.7.5) '@rollup/pluginutils': 5.3.0(rollup@4.52.5) @@ -22282,7 +22419,7 @@ snapshots: magic-string: 0.30.21 typescript: 5.8.3 optionalDependencies: - vite: 6.4.1(@types/node@22.7.5)(jiti@1.21.7)(tsx@4.20.6) + vite: 6.4.1(@types/node@22.7.5)(jiti@1.21.7)(tsx@4.20.6)(yaml@2.8.2) transitivePeerDependencies: - '@types/node' - rollup @@ -22307,13 +22444,13 @@ snapshots: - '@swc/helpers' - rollup - vite-plugin-top-level-await@1.6.0(@swc/helpers@0.5.17)(rollup@4.52.5)(vite@6.4.1(@types/node@22.7.5)(jiti@1.21.7)(tsx@4.20.6)): + vite-plugin-top-level-await@1.6.0(@swc/helpers@0.5.17)(rollup@4.52.5)(vite@6.4.1(@types/node@22.7.5)(jiti@1.21.7)(tsx@4.20.6)(yaml@2.8.2)): dependencies: '@rollup/plugin-virtual': 3.0.2(rollup@4.52.5) '@swc/core': 1.15.0(@swc/helpers@0.5.17) '@swc/wasm': 1.15.0 uuid: 10.0.0 - vite: 6.4.1(@types/node@22.7.5)(jiti@1.21.7)(tsx@4.20.6) + vite: 6.4.1(@types/node@22.7.5)(jiti@1.21.7)(tsx@4.20.6)(yaml@2.8.2) transitivePeerDependencies: - '@swc/helpers' - rollup @@ -22322,9 +22459,9 @@ snapshots: dependencies: vite: 5.4.21(@types/node@22.7.5) - vite-plugin-wasm@3.5.0(vite@6.4.1(@types/node@22.7.5)(jiti@1.21.7)(tsx@4.20.6)): + vite-plugin-wasm@3.5.0(vite@6.4.1(@types/node@22.7.5)(jiti@1.21.7)(tsx@4.20.6)(yaml@2.8.2)): dependencies: - vite: 6.4.1(@types/node@22.7.5)(jiti@1.21.7)(tsx@4.20.6) + vite: 6.4.1(@types/node@22.7.5)(jiti@1.21.7)(tsx@4.20.6)(yaml@2.8.2) vite-tsconfig-paths@4.3.2(typescript@5.8.3)(vite@5.4.21(@types/node@22.7.5)): dependencies: @@ -22346,7 +22483,7 @@ snapshots: '@types/node': 22.7.5 fsevents: 2.3.3 - vite@6.4.1(@types/node@22.7.5)(jiti@1.21.7)(tsx@4.20.6): + vite@6.4.1(@types/node@22.7.5)(jiti@1.21.7)(tsx@4.20.6)(yaml@2.8.2): dependencies: esbuild: 0.25.12 fdir: 6.5.0(picomatch@4.0.3) @@ -22359,6 +22496,7 @@ snapshots: fsevents: 2.3.3 jiti: 1.21.7 tsx: 4.20.6 + yaml: 2.8.2 vitest@1.6.1(@types/node@22.7.5): dependencies: @@ -22644,6 +22782,8 @@ snapshots: yaml@1.10.2: {} + yaml@2.8.2: {} + yargs-parser@18.1.3: dependencies: camelcase: 5.3.1