diff --git a/Cargo.lock b/Cargo.lock index a4215b7dbc77a..59f6f8e55a36e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -106,9 +106,9 @@ dependencies = [ [[package]] name = "aes-gcm" -version = "0.10.1" +version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82e1366e0c69c9f927b1fa5ce2c7bf9eafc8f9268c0b9800729e8b267612447c" +checksum = "209b47e8954a928e1d72e86eca7000ebb6655fe1436d33eefc2201cad027e237" dependencies = [ "aead 0.5.2", "aes 0.8.2", @@ -172,13 +172,19 @@ dependencies = [ [[package]] name = "aho-corasick" -version = "1.0.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67fc08ce920c31afb70f013dcce1bfc3a3195de6a228474e45e1f145b36f8d04" +checksum = "43f6cb1bf222025340178f382c426f13757b2960e89779dfcb319c32542a5a41" dependencies = [ "memchr", ] +[[package]] +name = "android-tzdata" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" + [[package]] name = "android_system_properties" version = "0.1.5" @@ -279,6 +285,26 @@ version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bddcadddf5e9015d310179a59bb28c4d4b9920ad0f11e8e14dbadf654890c9a6" +[[package]] +name = "ark-algebra-test-templates" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "400bd3a79c741b1832f1416d4373ae077ef82ca14a8b4cee1248a2f11c8b9172" +dependencies = [ + "ark-ec", + "ark-ff", + "ark-serialize", + "ark-std", + "hex", + "num-bigint", + "num-integer", + "num-traits", + "serde", + "serde_derive", + "serde_json", + "sha2 0.10.6", +] + [[package]] name = "ark-bls12-377" version = "0.4.0" @@ -302,6 +328,18 @@ dependencies = [ "ark-std", ] +[[package]] +name = "ark-bw6-761" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e0605daf0cc5aa2034b78d008aaf159f56901d92a52ee4f6ecdfdac4f426700" +dependencies = [ + "ark-bls12-377", + "ark-ec", + "ark-ff", + "ark-std", +] + [[package]] name = "ark-ec" version = "0.4.2" @@ -319,6 +357,30 @@ dependencies = [ "zeroize", ] +[[package]] +name = "ark-ed-on-bls12-377" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b10d901b9ac4b38f9c32beacedfadcdd64e46f8d7f8e88c1ae1060022cf6f6c6" +dependencies = [ + "ark-bls12-377", + "ark-ec", + "ark-ff", + "ark-std", +] + +[[package]] +name = "ark-ed-on-bls12-381-bandersnatch" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9cde0f2aa063a2a5c28d39b47761aa102bda7c13c84fc118a61b87c7b2f785c" +dependencies = [ + "ark-bls12-381", + "ark-ec", + "ark-ff", + "ark-std", +] + [[package]] name = "ark-ff" version = "0.4.2" @@ -330,7 +392,7 @@ dependencies = [ "ark-serialize", "ark-std", "derivative", - "digest 0.10.6", + "digest 0.10.7", "itertools", "num-bigint", "num-traits", @@ -375,6 +437,47 @@ dependencies = [ "hashbrown 0.13.2", ] +[[package]] +name = "ark-r1cs-std" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de1d1472e5cb020cb3405ce2567c91c8d43f21b674aef37b0202f5c3304761db" +dependencies = [ + "ark-ec", + "ark-ff", + "ark-relations", + "ark-std", + "derivative", + "num-bigint", + "num-integer", + "num-traits", + "tracing", +] + +[[package]] +name = "ark-relations" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00796b6efc05a3f48225e59cb6a2cda78881e7c390872d5786aaf112f31fb4f0" +dependencies = [ + "ark-ff", + "ark-std", + "tracing", + "tracing-subscriber 0.2.25", +] + +[[package]] +name = "ark-scale" +version = "0.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d028cd1025d002fa88c10cd644d29028a7b40806579b608c6ba843b937bbb23" +dependencies = [ + "ark-ec", + "ark-serialize", + "ark-std", + "parity-scale-codec", +] + [[package]] name = "ark-serialize" version = "0.4.2" @@ -383,7 +486,7 @@ checksum = "adb7b85a02b83d2f22f89bd5cac66c9c89474240cb6207cb1efc16d098e822a5" dependencies = [ "ark-serialize-derive", "ark-std", - "digest 0.10.6", + "digest 0.10.7", "num-bigint", ] @@ -574,7 +677,7 @@ checksum = "0e97ce7de6cf12de5d7226c73f5ba9811622f4db3a5b91b55c53e987e5f91cba" dependencies = [ "proc-macro2", "quote", - "syn 2.0.16", + "syn 2.0.18", ] [[package]] @@ -596,7 +699,7 @@ checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" dependencies = [ "proc-macro2", "quote", - "syn 2.0.16", + "syn 2.0.18", ] [[package]] @@ -607,7 +710,7 @@ checksum = "b9ccdd8f2a161be9bd5c023df56f1b2a0bd1d83872ae53b71a84a12c9bf6e842" dependencies = [ "proc-macro2", "quote", - "syn 2.0.16", + "syn 2.0.18", ] [[package]] @@ -687,9 +790,9 @@ checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" [[package]] name = "base64" -version = "0.21.0" +version = "0.21.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4a4ddaa51a5bc52a6948f74c06d20aaaddb71924eab79b8c97a8c556e942d6a" +checksum = "604178f6c5c21f02dc555784810edfb88d34ac2c73b2eae109655649ee73ce3d" [[package]] name = "base64ct" @@ -748,13 +851,13 @@ dependencies = [ "lazy_static", "lazycell", "peeking_take_while", - "prettyplease 0.2.4", + "prettyplease 0.2.6", "proc-macro2", "quote", "regex", "rustc-hash", "shlex", - "syn 2.0.16", + "syn 2.0.18", ] [[package]] @@ -781,7 +884,7 @@ version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "46502ad458c9a52b69d4d4d32775c788b7a1b85e8bc9d482d92250fc0e3f8efe" dependencies = [ - "digest 0.10.6", + "digest 0.10.7", ] [[package]] @@ -894,9 +997,9 @@ checksum = "771fe0050b883fcc3ea2359b1a96bcfbc090b7116eae7c3c512c7a083fdf23d3" [[package]] name = "bstr" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3d4260bcc2e8fc9df1eac4919a720effeb63a3f0952f5bf4944adfa18897f09" +checksum = "a246e68bb43f6cd9db24bea052a53e40405417c5fb372e3d1a8a7f770a564ef5" dependencies = [ "memchr", "once_cell", @@ -915,9 +1018,9 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.12.1" +version = "3.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b1ce199063694f33ffb7dd4e0ee620741495c32833cde5aa08f02a0bf96f0c8" +checksum = "a3e2c3daef883ecc1b5d58c15adae93470a91d425f3532ba1695849656af3fc1" [[package]] name = "byte-slice-cast" @@ -1029,9 +1132,9 @@ dependencies = [ [[package]] name = "cfg-expr" -version = "0.15.1" +version = "0.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8790cf1286da485c72cf5fc7aeba308438800036ec67d89425924c4807268c9" +checksum = "e70d3ad08698a0568b0562f22710fe6bfc1f4a61a367c77d0398c562eadd453a" dependencies = [ "smallvec", ] @@ -1078,7 +1181,7 @@ name = "chain-spec-builder" version = "2.0.0" dependencies = [ "ansi_term", - "clap 4.2.7", + "clap 4.3.2", "node-cli", "rand 0.8.5", "sc-chain-spec", @@ -1089,13 +1192,13 @@ dependencies = [ [[package]] name = "chrono" -version = "0.4.24" +version = "0.4.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e3c5919066adf22df73762e50cffcde3a758f2a848b113b586d1f86728b673b" +checksum = "ec837a71355b28f6556dbd569b37b3f363091c0bd4b2e735674521b4c5fd9bc5" dependencies = [ + "android-tzdata", "iana-time-zone", "js-sys", - "num-integer", "num-traits", "time 0.1.45", "wasm-bindgen", @@ -1204,9 +1307,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.2.7" +version = "4.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34d21f9bf1b425d2968943631ec91202fe5e837264063503708b83013f8fc938" +checksum = "401a4694d2bf92537b6867d94de48c4842089645fdcdf6c71865b175d836e9c2" dependencies = [ "clap_builder", "clap_derive", @@ -1215,36 +1318,36 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.2.7" +version = "4.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "914c8c79fb560f238ef6429439a30023c862f7a28e688c58f7203f12b29970bd" +checksum = "72394f3339a76daf211e57d4bcb374410f3965dcc606dd0e03738c7888766980" dependencies = [ "anstream", "anstyle", "bitflags", - "clap_lex 0.4.1", + "clap_lex 0.5.0", "strsim", ] [[package]] name = "clap_complete" -version = "4.2.1" +version = "4.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a19591b2ab0e3c04b588a0e04ddde7b9eaa423646d1b4a8092879216bf47473" +checksum = "7f6b5c519bab3ea61843a7923d074b04245624bb84a64a8c150f5deb014e388b" dependencies = [ - "clap 4.2.7", + "clap 4.3.2", ] [[package]] name = "clap_derive" -version = "4.2.0" +version = "4.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f9644cd56d6b87dbe899ef8b053e331c0637664e9e21a33dfcdc36093f5c5c4" +checksum = "b8cd2b2a819ad6eec39e8f1d6b53001af1e5469f8c177579cdaeb313115b825f" dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.16", + "syn 2.0.18", ] [[package]] @@ -1258,9 +1361,9 @@ dependencies = [ [[package]] name = "clap_lex" -version = "0.4.1" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a2dd5a6fe8c6e3502f568a6353e5273bbb15193ad9a89e457b9970798efbea1" +checksum = "2da6da31387c7e4ef160ffab6d5e7f00c42626fe39aea70a7b0f1773f7dd6c1b" [[package]] name = "codespan-reporting" @@ -1280,9 +1383,9 @@ checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" [[package]] name = "comfy-table" -version = "6.1.4" +version = "6.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e7b787b0dc42e8111badfdbe4c3059158ccb2db8780352fa1b01e8ccf45cc4d" +checksum = "7e959d788268e3bf9d35ace83e81b124190378e4c91c9067524675e33394b8ba" dependencies = [ "strum", "strum_macros", @@ -1306,15 +1409,15 @@ dependencies = [ [[package]] name = "console" -version = "0.15.5" +version = "0.15.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3d79fbe8970a77e3e34151cc13d3b3e248aa0faaecb9f6091fa07ebefe5ad60" +checksum = "c926e00cc70edefdc64d3a5ff31cc65bb97a3460097762bd23afb4d8145fccf8" dependencies = [ "encode_unicode", "lazy_static", "libc", "unicode-width", - "windows-sys 0.42.0", + "windows-sys 0.45.0", ] [[package]] @@ -1712,9 +1815,9 @@ dependencies = [ [[package]] name = "cxx" -version = "1.0.94" +version = "1.0.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f61f1b6389c3fe1c316bf8a4dccc90a38208354b330925bce1f74a6c4756eb93" +checksum = "109308c20e8445959c2792e81871054c6a17e6976489a93d2769641a2ba5839c" dependencies = [ "cc", "cxxbridge-flags", @@ -1724,9 +1827,9 @@ dependencies = [ [[package]] name = "cxx-build" -version = "1.0.94" +version = "1.0.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12cee708e8962df2aeb38f594aae5d827c022b6460ac71a7a3e2c3c2aae5a07b" +checksum = "daf4c6755cdf10798b97510e0e2b3edb9573032bd9379de8fffa59d68165494f" dependencies = [ "cc", "codespan-reporting", @@ -1734,24 +1837,24 @@ dependencies = [ "proc-macro2", "quote", "scratch", - "syn 2.0.16", + "syn 2.0.18", ] [[package]] name = "cxxbridge-flags" -version = "1.0.94" +version = "1.0.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7944172ae7e4068c533afbb984114a56c46e9ccddda550499caa222902c7f7bb" +checksum = "882074421238e84fe3b4c65d0081de34e5b323bf64555d3e61991f76eb64a7bb" [[package]] name = "cxxbridge-macro" -version = "1.0.94" +version = "1.0.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2345488264226bf682893e25de0769f3360aac9957980ec49361b083ddaa5bc5" +checksum = "4a076022ece33e7686fb76513518e219cca4fce5750a8ae6d1ce6c0f48fd1af9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.16", + "syn 2.0.18", ] [[package]] @@ -1791,15 +1894,15 @@ dependencies = [ [[package]] name = "data-encoding" -version = "2.3.3" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23d8666cb01533c39dde32bcbab8e227b4ed6679b2c925eba05feabea39508fb" +checksum = "c2e66c9d817f1720209181c316d28635c050fa304f9c79e47a520882661b7308" [[package]] name = "data-encoding-macro" -version = "0.1.12" +version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86927b7cd2fe88fa698b87404b287ab98d1a0063a34071d92e575b72d3029aca" +checksum = "c904b33cc60130e1aeea4956ab803d08a3f4a0ca82d64ed757afac3891f2bb99" dependencies = [ "data-encoding", "data-encoding-macro-internal", @@ -1807,9 +1910,9 @@ dependencies = [ [[package]] name = "data-encoding-macro-internal" -version = "0.1.10" +version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5bbed42daaa95e780b60a50546aa345b8413a1e46f9a40a12907d3598f038db" +checksum = "8fdf3fce3ce863539ec1d7fd1b6dcc3c645663376b43ed376bbf887733e4f772" dependencies = [ "data-encoding", "syn 1.0.109", @@ -1828,9 +1931,9 @@ dependencies = [ [[package]] name = "der" -version = "0.7.5" +version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05e58dffcdcc8ee7b22f0c1f71a69243d7c2d9ad87b5a14361f2424a1565c219" +checksum = "56acb310e15652100da43d130af8d97b509e95af61aab1c5a7939ef24337ee17" dependencies = [ "const-oid", "zeroize", @@ -1960,9 +2063,9 @@ dependencies = [ [[package]] name = "digest" -version = "0.10.6" +version = "0.10.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8168378f4e5023e7218c89c891c0fd8ecdb5e5e4f18cb78f38cf245dd021e76f" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" dependencies = [ "block-buffer 0.10.4", "const-oid", @@ -2019,7 +2122,7 @@ checksum = "487585f4d0c6655fe74905e2504d8ad6908e4db67f744eb140876906c2f3175d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.16", + "syn 2.0.18", ] [[package]] @@ -2036,27 +2139,27 @@ checksum = "fea41bba32d969b513997752735605054bc0dfa92b4c56bf1189f2e174be7a10" [[package]] name = "docify" -version = "0.1.13" +version = "0.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18b972b74c30cbe838fc6a07665132ff94f257350e26fd01d80bc59ee7fcf129" +checksum = "15aa210b350ff62db3149ac5d0b2a0287c01ee91354e16290de344082b2b3ff6" dependencies = [ "docify_macros", ] [[package]] name = "docify_macros" -version = "0.1.13" +version = "0.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c93004d1011191c56df9e853dca42f2012e7488638bcd5078935f5ce43e06cf3" +checksum = "9bf3504ed030133996c59a9954669a7a4f869f93a7e74389e16149843db16f57" dependencies = [ "common-path", "derive-syn-parse", "lazy_static", - "prettyplease 0.2.4", + "prettyplease 0.2.6", "proc-macro2", "quote", "regex", - "syn 2.0.16", + "syn 2.0.18", "termcolor", "walkdir", ] @@ -2120,15 +2223,16 @@ dependencies = [ [[package]] name = "ecdsa" -version = "0.16.6" +version = "0.16.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a48e5d537b8a30c0b023116d981b16334be1485af7ca68db3a2b7024cbc957fd" +checksum = "0997c976637b606099b9985693efa3581e84e41f5c11ba5255f88711058ad428" dependencies = [ - "der 0.7.5", - "digest 0.10.6", - "elliptic-curve 0.13.4", + "der 0.7.6", + "digest 0.10.7", + "elliptic-curve 0.13.5", "rfc6979 0.4.0", "signature 2.1.0", + "spki 0.7.2", ] [[package]] @@ -2183,7 +2287,7 @@ dependencies = [ "base16ct 0.1.1", "crypto-bigint 0.4.9", "der 0.6.1", - "digest 0.10.6", + "digest 0.10.7", "ff 0.12.1", "generic-array 0.14.7", "group 0.12.1", @@ -2198,13 +2302,13 @@ dependencies = [ [[package]] name = "elliptic-curve" -version = "0.13.4" +version = "0.13.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75c71eaa367f2e5d556414a8eea812bc62985c879748d6403edabd9cb03f16e7" +checksum = "968405c8fdc9b3bf4df0a6638858cc0b52462836ab6b1c87377785dd09cf1c0b" dependencies = [ "base16ct 0.2.0", "crypto-bigint 0.5.2", - "digest 0.10.6", + "digest 0.10.7", "ff 0.13.0", "generic-array 0.14.7", "group 0.13.0", @@ -2250,7 +2354,7 @@ checksum = "5e9a1f9f7d83e59740248a6e14ecf93929ade55027844dfcea78beafccc15745" dependencies = [ "proc-macro2", "quote", - "syn 2.0.16", + "syn 2.0.18", ] [[package]] @@ -2482,9 +2586,9 @@ dependencies = [ [[package]] name = "form_urlencoded" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9c384f161156f5260c24a097c56119f9be8c798586aecc13afbcbe7b7e26bf8" +checksum = "a62bc1cf6f830c2ec14a513a9fb124d0a213a629668a4186f329db21fe045652" dependencies = [ "percent-encoding", ] @@ -2539,7 +2643,7 @@ dependencies = [ "Inflector", "array-bytes 4.2.0", "chrono", - "clap 4.2.7", + "clap 4.3.2", "comfy-table", "frame-benchmarking", "frame-support", @@ -2604,7 +2708,7 @@ dependencies = [ "quote", "scale-info", "sp-arithmetic", - "syn 2.0.16", + "syn 2.0.18", "trybuild", ] @@ -2630,7 +2734,7 @@ dependencies = [ name = "frame-election-solution-type-fuzzer" version = "2.0.0-alpha.5" dependencies = [ - "clap 4.2.7", + "clap 4.3.2", "frame-election-provider-solution-type", "frame-election-provider-support", "frame-support", @@ -2750,7 +2854,7 @@ dependencies = [ "proc-macro-warning", "proc-macro2", "quote", - "syn 2.0.16", + "syn 2.0.18", ] [[package]] @@ -2761,7 +2865,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.16", + "syn 2.0.18", ] [[package]] @@ -2770,7 +2874,7 @@ version = "3.0.0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.16", + "syn 2.0.18", ] [[package]] @@ -2898,9 +3002,9 @@ dependencies = [ [[package]] name = "fs4" -version = "0.6.4" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7f5b6908aecca5812a4569056285e58c666588c9573ee59765bf1d3692699e2" +checksum = "7672706608ecb74ab2e055c68327ffc25ae4cac1e12349204fd5fb0f3487cce2" dependencies = [ "rustix 0.37.19", "windows-sys 0.48.0", @@ -2990,7 +3094,7 @@ checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" dependencies = [ "proc-macro2", "quote", - "syn 2.0.16", + "syn 2.0.18", ] [[package]] @@ -3110,8 +3214,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c85e1d9ab2eadba7e5040d4e09cbd6d072b76a557ad64e797c2cb9d4da21d7e4" dependencies = [ "cfg-if", + "js-sys", "libc", "wasi 0.11.0+wasi-snapshot-preview1", + "wasm-bindgen", ] [[package]] @@ -3203,9 +3309,9 @@ dependencies = [ [[package]] name = "h2" -version = "0.3.18" +version = "0.3.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17f8a914c2987b688368b5138aa05321db91f4090cf26118185672ad588bce21" +checksum = "d357c7ae988e7d2182f7d7871d0b963962420b0678b0997ce7de72001aeab782" dependencies = [ "bytes", "fnv", @@ -3228,9 +3334,9 @@ checksum = "eabb4a44450da02c90444cf74558da904edde8fb4e9035a9a6a4e15445af0bd7" [[package]] name = "handlebars" -version = "4.3.6" +version = "4.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "035ef95d03713f2c347a72547b7cd38cbc9af7cd51e6099fb62d586d4a6dee3a" +checksum = "83c3372087601b532857d332f5957cbae686da52bb7810bf038c3e3c3cc2fa0d" dependencies = [ "log", "pest", @@ -3350,7 +3456,7 @@ version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" dependencies = [ - "digest 0.10.6", + "digest 0.10.7", ] [[package]] @@ -3489,12 +3595,11 @@ dependencies = [ [[package]] name = "iana-time-zone-haiku" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0703ae284fc167426161c2e3f1da3ea71d94b21bedbcc9494e92b28e334e3dca" +checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" dependencies = [ - "cxx", - "cxx-build", + "cc", ] [[package]] @@ -3516,9 +3621,9 @@ dependencies = [ [[package]] name = "idna" -version = "0.3.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e14ddfc70884202db2244c223200c204c2bda1bc6e0998d11b5e024d657209e6" +checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c" dependencies = [ "unicode-bidi", "unicode-normalization", @@ -3612,13 +3717,14 @@ checksum = "8e04e2fd2b8188ea827b32ef11de88377086d690286ab35747ef7f9bf3ccb590" [[package]] name = "indicatif" -version = "0.17.3" +version = "0.17.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cef509aa9bc73864d6756f0d34d35504af3cf0844373afe9b8669a5b8005a729" +checksum = "8ff8cc23a7393a397ed1d7f56e6365cba772aba9f9912ab968b03043c395d057" dependencies = [ "console", + "instant", "number_prefix", - "portable-atomic 0.3.20", + "portable-atomic", "unicode-width", ] @@ -3670,9 +3776,9 @@ dependencies = [ [[package]] name = "io-lifetimes" -version = "1.0.10" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c66c74d2ae7e79a5a8f7ac924adbe38ee42a859c6539ad869eb51f0b52dc220" +checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" dependencies = [ "hermit-abi 0.3.1", "libc", @@ -3741,9 +3847,9 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.62" +version = "0.3.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68c16e1bfd491478ab155fd8b4896b86f9ede344949b641e61501e07c2b8b4d5" +checksum = "2f37a4a5928311ac501dee68b3c7613a1037d0edb30c8e5427bd832d55d1b790" dependencies = [ "wasm-bindgen", ] @@ -3899,8 +4005,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cadb76004ed8e97623117f3df85b17aaa6626ab0b0831e6573f104df16cd1bcc" dependencies = [ "cfg-if", - "ecdsa 0.16.6", - "elliptic-curve 0.13.4", + "ecdsa 0.16.7", + "elliptic-curve 0.13.5", "once_cell", "sha2 0.10.6", ] @@ -4086,9 +4192,9 @@ checksum = "884e2677b40cc8c339eaefcb701c32ef1fd2493d71118dc0ca4b6a736c93bd67" [[package]] name = "libc" -version = "0.2.144" +version = "0.2.145" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b00cc1c228a6782d0f076e7b232802e0c5689d41bb5df366f2a6b6621cfdfe1" +checksum = "fc86cde3ff845662b8f4ef6cb50ea0e20c524eb3d29ae048287e06a1b3fa6a81" [[package]] name = "libgit2-sys" @@ -4122,9 +4228,9 @@ checksum = "7fc7aa29613bd6a620df431842069224d8bc9011086b1db4c0e0cd47fa03ec9a" [[package]] name = "libm" -version = "0.2.6" +version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "348108ab3fba42ec82ff6e9564fc4ca0247bdccdc68dd8af9764bbc79c3c8ffb" +checksum = "f7012b1bbb0719e1097c47611d3898568c546d597c2e74d66f6087edd5233ff4" [[package]] name = "libp2p" @@ -4681,9 +4787,9 @@ checksum = "f051f77a7c8e6957c0696eac88f26b0117e54f52d3fc682ab19397a8812846a4" [[package]] name = "linux-raw-sys" -version = "0.3.7" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ece97ea872ece730aed82664c424eb4c8291e1ff2480247ccf7409044bc6479f" +checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" [[package]] name = "lite-json" @@ -4705,9 +4811,9 @@ dependencies = [ [[package]] name = "lock_api" -version = "0.4.9" +version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "435011366fe56583b16cf956f9df0095b405b82d76425bc8981c0e22e60ec4df" +checksum = "c1cc9717a20b1bb222f333e6a92fd32f7d8a18ddc5a3191a11af45dcbf4dcd16" dependencies = [ "autocfg", "scopeguard", @@ -4715,12 +4821,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.17" +version = "0.4.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" -dependencies = [ - "cfg-if", -] +checksum = "518ef76f2f87365916b142844c16d8fefd85039bc5699050210a7778ee1cd1de" [[package]] name = "lru" @@ -4778,7 +4881,7 @@ dependencies = [ "macro_magic_core", "macro_magic_macros", "quote", - "syn 2.0.16", + "syn 2.0.18", ] [[package]] @@ -4791,7 +4894,7 @@ dependencies = [ "macro_magic_core_macros", "proc-macro2", "quote", - "syn 2.0.16", + "syn 2.0.18", ] [[package]] @@ -4802,7 +4905,7 @@ checksum = "de6267819c9042df1a9e62ca279e5a34254ad5dfdcb13ff988f560d75576e8b4" dependencies = [ "proc-macro2", "quote", - "syn 2.0.16", + "syn 2.0.18", ] [[package]] @@ -4813,7 +4916,7 @@ checksum = "dc7176ac15ab2ed7f335e2398f729b9562dae0c233705bc1e1e3acd8452d403d" dependencies = [ "macro_magic_core", "quote", - "syn 2.0.16", + "syn 2.0.18", ] [[package]] @@ -4868,7 +4971,7 @@ version = "0.10.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6365506850d44bff6e2fbcb5176cf63650e48bd45ef2fe2665ae1570e0f4b9ca" dependencies = [ - "digest 0.10.6", + "digest 0.10.7", ] [[package]] @@ -4969,14 +5072,13 @@ dependencies = [ [[package]] name = "mio" -version = "0.8.6" +version = "0.8.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b9d9a46eff5b4ff64b45a9e316a6d1e0bc719ef429cbec4dc630684212bfdf9" +checksum = "927a765cd3fc26206e66b296465fa9d3e5ab003e651c1b3c060e7956d96b19d2" dependencies = [ "libc", - "log", "wasi 0.11.0+wasi-snapshot-preview1", - "windows-sys 0.45.0", + "windows-sys 0.48.0", ] [[package]] @@ -5085,7 +5187,7 @@ dependencies = [ "blake2s_simd", "blake3", "core2", - "digest 0.10.6", + "digest 0.10.7", "multihash-derive", "sha2 0.10.6", "sha3", @@ -5099,7 +5201,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "835d6ff01d610179fbce3de1694d007e500bf33a7f29689838941d6bf783ae40" dependencies = [ "core2", - "digest 0.10.6", + "digest 0.10.7", "multihash-derive", "sha2 0.10.6", "unsigned-varint", @@ -5272,7 +5374,7 @@ name = "node-bench" version = "0.9.0-dev" dependencies = [ "array-bytes 4.2.0", - "clap 4.2.7", + "clap 4.3.2", "derive_more", "fs_extra", "futures", @@ -5309,7 +5411,7 @@ version = "3.0.0-dev" dependencies = [ "array-bytes 4.2.0", "assert_cmd", - "clap 4.2.7", + "clap 4.3.2", "clap_complete", "criterion", "frame-benchmarking-cli", @@ -5435,7 +5537,7 @@ dependencies = [ name = "node-inspect" version = "0.9.0-dev" dependencies = [ - "clap 4.2.7", + "clap 4.3.2", "parity-scale-codec", "sc-cli", "sc-client-api", @@ -5494,7 +5596,7 @@ dependencies = [ name = "node-runtime-generate-bags" version = "3.0.0" dependencies = [ - "clap 4.2.7", + "clap 4.3.2", "generate-bags", "kitchensink-runtime", ] @@ -5503,7 +5605,7 @@ dependencies = [ name = "node-template" version = "4.0.0-dev" dependencies = [ - "clap 4.2.7", + "clap 4.3.2", "frame-benchmarking", "frame-benchmarking-cli", "frame-system", @@ -5549,7 +5651,7 @@ dependencies = [ name = "node-template-release" version = "3.0.0" dependencies = [ - "clap 4.2.7", + "clap 4.3.2", "flate2", "fs_extra", "git2", @@ -5748,7 +5850,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" dependencies = [ "autocfg", - "libm 0.2.6", + "libm 0.2.7", ] [[package]] @@ -5769,9 +5871,9 @@ checksum = "830b246a0e5f20af87141b25c173cd1b609bd7779a4617d6ec582abaf90870f3" [[package]] name = "object" -version = "0.30.3" +version = "0.30.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea86265d3d3dcb6a27fc51bd29a4bf387fae9d2986b823079d4986af253eb439" +checksum = "03b4680b86d9cfafba8fc491dc9b6df26b68cf40e9e6cd73909194759a63c385" dependencies = [ "crc32fast", "hashbrown 0.13.2", @@ -5799,9 +5901,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.17.1" +version = "1.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7e5500299e16ebb147ae15a00a942af264cf3688f47923b8fc2cd5858f23ad3" +checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" [[package]] name = "oorandom" @@ -5829,9 +5931,9 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-sys" -version = "0.9.87" +version = "0.9.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e17f59264b2809d77ae94f0e1ebabc434773f370d6ca667bd223ea10e06cc7e" +checksum = "c2ce0f250f34a308dcfdbb351f511359857d4ed2134ba715a4eadd46e1ffd617" dependencies = [ "cc", "libc", @@ -6305,7 +6407,7 @@ version = "4.0.0-dev" dependencies = [ "proc-macro2", "quote", - "syn 2.0.16", + "syn 2.0.18", ] [[package]] @@ -7263,7 +7365,7 @@ dependencies = [ "proc-macro2", "quote", "sp-runtime", - "syn 2.0.16", + "syn 2.0.18", ] [[package]] @@ -7629,7 +7731,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" dependencies = [ "lock_api", - "parking_lot_core 0.9.7", + "parking_lot_core 0.9.8", ] [[package]] @@ -7648,15 +7750,15 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.9.7" +version = "0.9.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9069cbb9f99e3a5083476ccb29ceb1de18b9118cafa53e90c9551235de2b9521" +checksum = "93f00c865fe7cabf650081affecd3871070f26767e7b2070a3ffae14c654b447" dependencies = [ "cfg-if", "libc", - "redox_syscall 0.2.16", + "redox_syscall 0.3.5", "smallvec", - "windows-sys 0.45.0", + "windows-targets 0.48.0", ] [[package]] @@ -7686,7 +7788,7 @@ version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "83a0692ec44e4cf1ef28ca317f14f8f07da2d95ec3fa01f86e4467b725e60917" dependencies = [ - "digest 0.10.6", + "digest 0.10.7", ] [[package]] @@ -7715,9 +7817,9 @@ dependencies = [ [[package]] name = "percent-encoding" -version = "2.2.0" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e" +checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" [[package]] name = "pest" @@ -7749,7 +7851,7 @@ dependencies = [ "pest_meta", "proc-macro2", "quote", - "syn 2.0.16", + "syn 2.0.18", ] [[package]] @@ -7775,22 +7877,22 @@ dependencies = [ [[package]] name = "pin-project" -version = "1.0.12" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad29a609b6bcd67fee905812e544992d216af9d755757c05ed2d0e15a74c6ecc" +checksum = "c95a7476719eab1e366eaf73d0260af3021184f18177925b07f54b30089ceead" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.0.12" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "069bdb1e05adc7a8990dce9cc75370895fbe4e3d58b9b73bf1aee56359344a55" +checksum = "39407670928234ebc5e6e580247dd567ad73a3578460c5990f9503df207e8f07" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.18", ] [[package]] @@ -7827,7 +7929,7 @@ version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" dependencies = [ - "der 0.7.5", + "der 0.7.6", "spki 0.7.2", ] @@ -7919,23 +8021,14 @@ dependencies = [ "cfg-if", "cpufeatures", "opaque-debug 0.3.0", - "universal-hash 0.5.0", -] - -[[package]] -name = "portable-atomic" -version = "0.3.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e30165d31df606f5726b090ec7592c308a0eaf61721ff64c9a3018e344a8753e" -dependencies = [ - "portable-atomic 1.3.2", + "universal-hash 0.5.1", ] [[package]] name = "portable-atomic" -version = "1.3.2" +version = "1.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc59d1bcc64fc5d021d67521f818db868368028108d37f0e98d74e33f68297b5" +checksum = "767eb9f07d4a5ebcb39bbf2d452058a93c011373abf6832e24194a1c3f004794" [[package]] name = "ppv-lite86" @@ -8009,12 +8102,12 @@ dependencies = [ [[package]] name = "prettyplease" -version = "0.2.4" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ceca8aaf45b5c46ec7ed39fff75f57290368c1846d33d24a122ca81416ab058" +checksum = "3b69d39aab54d069e7f2fe8cb970493e7834601ca2d8c65fd7bbd183578080d1" dependencies = [ "proc-macro2", - "syn 2.0.16", + "syn 2.0.18", ] [[package]] @@ -8073,14 +8166,14 @@ checksum = "70550716265d1ec349c41f70dd4f964b4fd88394efe4405f0c1da679c4799a07" dependencies = [ "proc-macro2", "quote", - "syn 2.0.16", + "syn 2.0.18", ] [[package]] name = "proc-macro2" -version = "1.0.56" +version = "1.0.59" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b63bdb0cd06f1f4dedf69b254734f9b45af66e4a031e42a7480257d9898b435" +checksum = "6aeca18b86b413c660b781aa319e4e2648a3e6f9eadc9b47e9038e6fe9f3451b" dependencies = [ "unicode-ident", ] @@ -8455,7 +8548,7 @@ checksum = "8d2275aab483050ab2a7364c1a46604865ee7d6906684e08db0f090acf74f9e7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.16", + "syn 2.0.18", ] [[package]] @@ -8472,13 +8565,13 @@ dependencies = [ [[package]] name = "regex" -version = "1.8.1" +version = "1.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af83e617f331cc6ae2da5443c602dfa5af81e517212d9d611a5b3ba1777b5370" +checksum = "d0ab3ca65655bb1e41f2a8c8cd662eb4fb035e67c3f78da1d61dffe89d07300f" dependencies = [ - "aho-corasick 1.0.1", + "aho-corasick 1.0.2", "memchr", - "regex-syntax 0.7.1", + "regex-syntax 0.7.2", ] [[package]] @@ -8498,9 +8591,9 @@ checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" [[package]] name = "regex-syntax" -version = "0.7.1" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5996294f19bd3aae0453a862ad728f60e6600695733dd5df01da90c54363a3c" +checksum = "436b050e76ed2903236f032a59761c1eb99e1b0aead2c257922771dab1fc8c78" [[package]] name = "resolv-conf" @@ -8666,9 +8759,9 @@ dependencies = [ [[package]] name = "rustix" -version = "0.36.13" +version = "0.36.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a38f9520be93aba504e8ca974197f46158de5dcaa9fa04b57c57cd6a679d658" +checksum = "14e4d67015953998ad0eb82887a0eb0129e18a7e2f3b7b0f6c422fddcd503d62" dependencies = [ "bitflags", "errno", @@ -8688,7 +8781,7 @@ dependencies = [ "errno", "io-lifetimes", "libc", - "linux-raw-sys 0.3.7", + "linux-raw-sys 0.3.8", "windows-sys 0.48.0", ] @@ -8735,7 +8828,7 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d194b56d58803a43635bdc398cd17e383d6f71f9182b9a192c127ca42494a59b" dependencies = [ - "base64 0.21.0", + "base64 0.21.2", ] [[package]] @@ -8906,7 +8999,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.16", + "syn 2.0.18", ] [[package]] @@ -8915,7 +9008,7 @@ version = "0.10.0-dev" dependencies = [ "array-bytes 4.2.0", "chrono", - "clap 4.2.7", + "clap 4.3.2", "fdlimit", "futures", "futures-timer", @@ -9440,7 +9533,7 @@ dependencies = [ "once_cell", "parity-scale-codec", "paste", - "rustix 0.36.13", + "rustix 0.36.14", "sc-allocator", "sc-executor-common", "sc-runtime-test", @@ -10044,7 +10137,7 @@ dependencies = [ name = "sc-storage-monitor" version = "0.1.0" dependencies = [ - "clap 4.2.7", + "clap 4.3.2", "fs4", "futures", "log", @@ -10148,7 +10241,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.16", + "syn 2.0.18", ] [[package]] @@ -10217,9 +10310,9 @@ dependencies = [ [[package]] name = "scale-info" -version = "2.6.0" +version = "2.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfdef77228a4c05dc94211441595746732131ad7f6530c6c18f045da7b7ab937" +checksum = "b569c32c806ec3abdf3b5869fb8bf1e0d275a7c1c9b0b05603d9464632649edf" dependencies = [ "bitvec", "cfg-if", @@ -10344,7 +10437,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f0aec48e813d6b90b15f0b8948af3c63483992dee44c03e9930b3eebdabe046e" dependencies = [ "base16ct 0.2.0", - "der 0.7.5", + "der 0.7.6", "generic-array 0.14.7", "pkcs8 0.10.2", "subtle", @@ -10380,9 +10473,9 @@ dependencies = [ [[package]] name = "security-framework" -version = "2.8.2" +version = "2.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a332be01508d814fed64bf28f798a146d73792121129962fdf335bb3c49a4254" +checksum = "1fc758eb7bffce5b308734e9b0c1468893cae9ff70ebf13e7090be8dcbcc83a8" dependencies = [ "bitflags", "core-foundation", @@ -10393,9 +10486,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.8.0" +version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31c9bb296072e961fcbd8853511dd39c2d8be2deb1e17c6860b1d30732b323b4" +checksum = "f51d0c0d83bec45f16480d0ce0058397a69e48fcdc52d1dc8855fb68acbd31a7" dependencies = [ "core-foundation-sys", "libc", @@ -10451,7 +10544,7 @@ checksum = "8c805777e3930c8883389c602315a24224bcc738b63905ef87cd1420353ea93e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.16", + "syn 2.0.18", ] [[package]] @@ -10467,9 +10560,9 @@ dependencies = [ [[package]] name = "serde_spanned" -version = "0.6.1" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0efd8caf556a6cebd3b285caf480045fcc1ac04f6bd786b09a6f11af30c4fcf4" +checksum = "93107647184f6027e3b7dcb2e11034cf95ffa1e3a682c67951963ac69c1c007d" dependencies = [ "serde", ] @@ -10495,7 +10588,7 @@ checksum = "f04293dc80c3993519f2d7f6f511707ee7094fe0c6d3406feb330cdb3540eba3" dependencies = [ "cfg-if", "cpufeatures", - "digest 0.10.6", + "digest 0.10.7", ] [[package]] @@ -10531,7 +10624,7 @@ checksum = "82e6b795fe2e3b1e845bafcb27aa35405c4d47cdfc92af5fc8d3002f76cebdc0" dependencies = [ "cfg-if", "cpufeatures", - "digest 0.10.6", + "digest 0.10.7", ] [[package]] @@ -10540,7 +10633,7 @@ version = "0.10.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "75872d278a8f37ef87fa0ddbda7802605cb18344497949862c0d4dcb291eba60" dependencies = [ - "digest 0.10.6", + "digest 0.10.7", "keccak", ] @@ -10574,7 +10667,7 @@ version = "1.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "74233d3b3b2f6d4b006dc19dee745e73e2a6bfb6f93607cd3b02bd5b00797d7c" dependencies = [ - "digest 0.10.6", + "digest 0.10.7", "rand_core 0.6.4", ] @@ -10584,7 +10677,7 @@ version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5e1788eed21689f9cf370582dfc467ef36ed9c707f073528ddafa8d83e3b8500" dependencies = [ - "digest 0.10.6", + "digest 0.10.7", "rand_core 0.6.4", ] @@ -10709,7 +10802,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.16", + "syn 2.0.18", ] [[package]] @@ -10788,6 +10881,100 @@ dependencies = [ "sp-arithmetic", ] +[[package]] +name = "sp-ark-bls12-377" +version = "0.4.0-beta" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b8e61a06f286f4e8565a67865ef52e83edabf447881898c94527ffc7b839177" +dependencies = [ + "ark-bls12-377", + "ark-ff", + "ark-r1cs-std", + "ark-scale", + "ark-std", + "parity-scale-codec", + "sp-ark-models", +] + +[[package]] +name = "sp-ark-bls12-381" +version = "0.4.0-beta" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3352feef6c9c34022fa766a0c9a86a88a83d280a3e5b34781a1a9af98377a130" +dependencies = [ + "ark-bls12-381", + "ark-ff", + "ark-scale", + "ark-serialize", + "ark-std", + "parity-scale-codec", + "sp-ark-models", +] + +[[package]] +name = "sp-ark-bw6-761" +version = "0.4.0-beta" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bf069165e230aef3c4680edea2d8ab3caa89c039e0b61fad2b8e061fb393668" +dependencies = [ + "ark-bw6-761", + "ark-ff", + "ark-scale", + "ark-std", + "parity-scale-codec", + "sp-ark-models", +] + +[[package]] +name = "sp-ark-ed-on-bls12-377" +version = "0.4.0-beta" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e63f1fe8e7e87cb0258d61212b019d4d0fd230293ec42a564eb671c83d437497" +dependencies = [ + "ark-ed-on-bls12-377", + "ark-ff", + "ark-r1cs-std", + "ark-scale", + "ark-serialize", + "ark-std", + "parity-scale-codec", + "sp-ark-models", +] + +[[package]] +name = "sp-ark-ed-on-bls12-381-bandersnatch" +version = "0.4.0-beta" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "838ddc5508aff3e89f930e7e7f3565d0786ac27868cfd61587afe681011e1140" +dependencies = [ + "ark-ec", + "ark-ed-on-bls12-381-bandersnatch", + "ark-ff", + "ark-r1cs-std", + "ark-scale", + "ark-std", + "parity-scale-codec", + "sp-ark-bls12-381", + "sp-ark-models", +] + +[[package]] +name = "sp-ark-models" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28fa906b809d7a346b2aa32a4bd0c884a75f9f588f9a4a07272f63eaf8a10765" +dependencies = [ + "ark-ec", + "ark-ff", + "ark-serialize", + "ark-std", + "derivative", + "getrandom 0.2.9", + "itertools", + "num-traits", + "zeroize", +] + [[package]] name = "sp-authority-discovery" version = "4.0.0-dev" @@ -10993,7 +11180,7 @@ version = "9.0.0" dependencies = [ "blake2b_simd", "byteorder", - "digest 0.10.6", + "digest 0.10.7", "sha2 0.10.6", "sha3", "sp-std", @@ -11007,7 +11194,34 @@ dependencies = [ "proc-macro2", "quote", "sp-core-hashing", - "syn 2.0.16", + "syn 2.0.18", +] + +[[package]] +name = "sp-crypto-ec-utils" +version = "0.4.0" +dependencies = [ + "ark-algebra-test-templates", + "ark-bls12-377", + "ark-bls12-381", + "ark-bw6-761", + "ark-ec", + "ark-ed-on-bls12-377", + "ark-ed-on-bls12-381-bandersnatch", + "ark-ff", + "ark-scale", + "ark-serialize", + "ark-std", + "parity-scale-codec", + "sp-ark-bls12-377", + "sp-ark-bls12-381", + "sp-ark-bw6-761", + "sp-ark-ed-on-bls12-377", + "sp-ark-ed-on-bls12-381-bandersnatch", + "sp-ark-models", + "sp-io", + "sp-runtime-interface", + "sp-std", ] [[package]] @@ -11024,7 +11238,7 @@ version = "8.0.0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.16", + "syn 2.0.18", ] [[package]] @@ -11157,7 +11371,7 @@ dependencies = [ name = "sp-npos-elections-fuzzer" version = "2.0.0-alpha.5" dependencies = [ - "clap 4.2.7", + "clap 4.3.2", "honggfuzz", "parity-scale-codec", "rand 0.8.5", @@ -11252,7 +11466,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.16", + "syn 2.0.18", ] [[package]] @@ -11488,7 +11702,7 @@ dependencies = [ "proc-macro2", "quote", "sp-version", - "syn 2.0.16", + "syn 2.0.18", ] [[package]] @@ -11557,7 +11771,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9d1e996ef02c474957d681f1b05213dfb0abab947b446a62d37770b23500184a" dependencies = [ "base64ct", - "der 0.7.5", + "der 0.7.6", ] [[package]] @@ -11666,7 +11880,7 @@ dependencies = [ name = "subkey" version = "3.0.0" dependencies = [ - "clap 4.2.7", + "clap 4.3.2", "sc-cli", ] @@ -11708,7 +11922,7 @@ dependencies = [ name = "substrate-frame-cli" version = "4.0.0-dev" dependencies = [ - "clap 4.2.7", + "clap 4.3.2", "frame-support", "frame-system", "sc-cli", @@ -11930,7 +12144,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.16", + "syn 2.0.18", ] [[package]] @@ -11954,7 +12168,7 @@ dependencies = [ "sp-maybe-compressed-blob", "strum", "tempfile", - "toml 0.7.3", + "toml 0.7.4", "walkdir", "wasm-opt", ] @@ -11987,9 +12201,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.16" +version = "2.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6f671d4b5ffdb8eadec19c0ae67fe2639df8684bd7bc4b83d986b8db549cf01" +checksum = "32d41677bcbe24c20c52e7c70b0d8db04134c5d1066bf98662e2871ad200ea3e" dependencies = [ "proc-macro2", "quote", @@ -12010,9 +12224,9 @@ dependencies = [ [[package]] name = "system-configuration" -version = "0.5.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d75182f12f490e953596550b65ee31bda7c8e043d9386174b353bda50838c3fd" +checksum = "ba3a3adc5c275d719af8cb4272ea1c4a6d668a777f37e115f6d11ddbc1c8e0e7" dependencies = [ "bitflags", "core-foundation", @@ -12103,7 +12317,7 @@ checksum = "f9456a42c5b0d803c8cd86e73dd7cc9edd429499f37a3550d286d5e86720569f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.16", + "syn 2.0.18", ] [[package]] @@ -12234,9 +12448,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.28.0" +version = "1.28.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3c786bf8134e5a3a166db9b29ab8f48134739014a3eca7bc6bfa95d673b136f" +checksum = "94d7b1cfd2aa4011f2de74c2c4c63665e27a71006b0a192dcd2710272e73dfa2" dependencies = [ "autocfg", "bytes", @@ -12259,7 +12473,7 @@ checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.16", + "syn 2.0.18", ] [[package]] @@ -12335,9 +12549,9 @@ dependencies = [ [[package]] name = "toml" -version = "0.7.3" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b403acf6f2bb0859c93c7f0d967cb4a75a7ac552100f9322faf64dc047669b21" +checksum = "d6135d499e69981f9ff0ef2167955a5333c35e36f6937d382974566b3d5b94ec" dependencies = [ "serde", "serde_spanned", @@ -12347,18 +12561,18 @@ dependencies = [ [[package]] name = "toml_datetime" -version = "0.6.1" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ab8ed2edee10b50132aed5f331333428b011c99402b5a534154ed15746f9622" +checksum = "5a76a9312f5ba4c2dec6b9161fdf25d87ad8a09256ccea5a556fef03c706a10f" dependencies = [ "serde", ] [[package]] name = "toml_edit" -version = "0.19.8" +version = "0.19.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "239410c8609e8125456927e6707163a3b1fdb40561e4b803bc041f466ccfdc13" +checksum = "2380d56e8670370eee6566b0bfd4265f65b3f432e8c6d85623f728d4fa31f739" dependencies = [ "indexmap", "serde", @@ -12429,14 +12643,14 @@ checksum = "0f57e3ca2a01450b1a921183a9c9cbfda207fd822cef4ccb00a65402cbba7a74" dependencies = [ "proc-macro2", "quote", - "syn 2.0.16", + "syn 2.0.18", ] [[package]] name = "tracing-core" -version = "0.1.30" +version = "0.1.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24eb03ba0eab1fd845050058ce5e616558e8f8d8fca633e6b163fe25c797213a" +checksum = "0955b8137a1df6f1a2e9a37d8a6656291ff0297c1a97c24e0d8425fe2312f79a" dependencies = [ "once_cell", "valuable", @@ -12620,7 +12834,7 @@ version = "0.10.0-dev" dependencies = [ "assert_cmd", "async-trait", - "clap 4.2.7", + "clap 4.3.2", "frame-remote-externalities", "frame-try-runtime", "hex", @@ -12702,7 +12916,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "97fee6b57c6a41524a810daee9286c02d7752c4253064d0b05472833a438f675" dependencies = [ "cfg-if", - "digest 0.10.6", + "digest 0.10.7", "rand 0.8.5", "static_assertions", ] @@ -12739,9 +12953,9 @@ checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" [[package]] name = "unicode-ident" -version = "1.0.8" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5464a87b239f13a63a501f2701565754bae92d243d4bb7eb12f6d57d2269bf4" +checksum = "b15811caf2415fb889178633e7724bad2509101cde276048e013b9def5e51fa0" [[package]] name = "unicode-normalization" @@ -12776,9 +12990,9 @@ dependencies = [ [[package]] name = "universal-hash" -version = "0.5.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d3160b73c9a19f7e2939a2fdad446c57c1bbbbf4d919d3213ff1267a580d8b5" +checksum = "fc1de2c688dc15305988b563c3854064043356019f97a4b46276fe734c4f07ea" dependencies = [ "crypto-common", "subtle", @@ -12804,12 +13018,12 @@ checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" [[package]] name = "url" -version = "2.3.1" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d68c799ae75762b8c3fe375feb6600ef5602c883c5d21eb51c09f22b83c4643" +checksum = "50bff7831e19200a85b17131d085c25d7811bc4e186efdaf54bbd132994a88cb" dependencies = [ "form_urlencoded", - "idna 0.3.0", + "idna 0.4.0", "percent-encoding", ] @@ -12821,9 +13035,9 @@ checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" [[package]] name = "uuid" -version = "1.3.2" +version = "1.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4dad5567ad0cf5b760e5665964bec1b47dfd077ba8a2544b513f3556d3d239a2" +checksum = "345444e32442451b267fc254ae85a209c64be56d2890e601a0c37ff0c3c5ecd2" dependencies = [ "getrandom 0.2.9", ] @@ -12866,7 +13080,7 @@ dependencies = [ "ark-serialize-derive", "arrayref", "constcat", - "digest 0.10.6", + "digest 0.10.7", "rand 0.8.5", "rand_chacha 0.3.1", "rand_core 0.6.4", @@ -12940,9 +13154,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.85" +version = "0.2.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b6cb788c4e39112fbe1822277ef6fb3c55cd86b95cb3d3c4c1c9597e4ac74b4" +checksum = "5bba0e8cb82ba49ff4e229459ff22a191bbe9a1cb3a341610c9c33efc27ddf73" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -12950,24 +13164,24 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.85" +version = "0.2.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35e522ed4105a9d626d885b35d62501b30d9666283a5c8be12c14a8bdafe7822" +checksum = "19b04bc93f9d6bdee709f6bd2118f57dd6679cf1176a1af464fca3ab0d66d8fb" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn 2.0.16", + "syn 2.0.18", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.35" +version = "0.4.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "083abe15c5d88556b77bdf7aef403625be9e327ad37c62c4e4129af740168163" +checksum = "2d1985d03709c53167ce907ff394f5316aa22cb4e12761295c5dc57dacb6297e" dependencies = [ "cfg-if", "js-sys", @@ -12977,9 +13191,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.85" +version = "0.2.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "358a79a0cb89d21db8120cbfb91392335913e4890665b1a7981d9e956903b434" +checksum = "14d6b024f1a526bb0234f52840389927257beb670610081360e5a03c5df9c258" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -12987,28 +13201,28 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.85" +version = "0.2.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4783ce29f09b9d93134d41297aded3a712b7b979e9c6f28c32cb88c973a94869" +checksum = "e128beba882dd1eb6200e1dc92ae6c5dbaa4311aa7bb211ca035779e5efc39f8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.16", + "syn 2.0.18", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.85" +version = "0.2.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a901d592cafaa4d711bc324edfaff879ac700b19c3dfd60058d2b445be2691eb" +checksum = "ed9d5b4305409d1fc9482fee2d7f9bcbf24b3972bf59817ef757e23982242a93" [[package]] name = "wasm-encoder" -version = "0.26.0" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d05d0b6fcd0aeb98adf16e7975331b3c17222aa815148f5b976370ce589d80ef" +checksum = "18c41dbd92eaebf3612a39be316540b8377c871cb9bde6b064af962984912881" dependencies = [ "leb128", ] @@ -13111,7 +13325,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "624e6333e861ef49095d2d678b76ebf30b06bf37effca845be7e5b87c90071b7" dependencies = [ "downcast-rs", - "libm 0.2.6", + "libm 0.2.7", "num-traits", "paste", ] @@ -13179,12 +13393,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c86437fa68626fe896e5afc69234bb2b5894949083586535f200385adfd71213" dependencies = [ "anyhow", - "base64 0.21.0", + "base64 0.21.2", "bincode", "directories-next", "file-per-thread-logger", "log", - "rustix 0.36.13", + "rustix 0.36.14", "serde", "sha2 0.10.6", "toml 0.5.11", @@ -13280,7 +13494,7 @@ checksum = "6e0554b84c15a27d76281d06838aed94e13a77d7bf604bbbaf548aa20eb93846" dependencies = [ "object", "once_cell", - "rustix 0.36.13", + "rustix 0.36.14", ] [[package]] @@ -13311,7 +13525,7 @@ dependencies = [ "memoffset 0.8.0", "paste", "rand 0.8.5", - "rustix 0.36.13", + "rustix 0.36.14", "wasmtime-asm-macros", "wasmtime-environ", "wasmtime-jit-debug", @@ -13332,9 +13546,9 @@ dependencies = [ [[package]] name = "wast" -version = "57.0.0" +version = "60.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6eb0f5ed17ac4421193c7477da05892c2edafd67f9639e3c11a82086416662dc" +checksum = "bd06cc744b536e30387e72a48fdd492105b9c938bb4f415c39c616a7a0a697ad" dependencies = [ "leb128", "memchr", @@ -13344,18 +13558,18 @@ dependencies = [ [[package]] name = "wat" -version = "1.0.63" +version = "1.0.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab9ab0d87337c3be2bb6fc5cd331c4ba9fd6bcb4ee85048a0dd59ed9ecf92e53" +checksum = "5abe520f0ab205366e9ac7d3e6b2fc71de44e32a2b58f2ec871b6b575bdcea3b" dependencies = [ "wast", ] [[package]] name = "web-sys" -version = "0.3.62" +version = "0.3.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16b5f940c7edfdc6d12126d98c9ef4d1b3d470011c47c76a6581df47ad9ba721" +checksum = "3bdd9ef4e984da1187bf8110c5cf5b845fbc87a23602cdf912386a76fcd3a7c2" dependencies = [ "js-sys", "wasm-bindgen", @@ -13453,7 +13667,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "942be5bd85f072c3128396f6e5a9bfb93ca8c1939ded735d177b7bcba9a13d05" dependencies = [ "aes 0.6.0", - "aes-gcm 0.10.1", + "aes-gcm 0.10.2", "async-trait", "bincode", "block-modes", @@ -13612,9 +13826,9 @@ dependencies = [ [[package]] name = "wide" -version = "0.7.8" +version = "0.7.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b689b6c49d6549434bf944e6b0f39238cf63693cb7a147e9d887507fffa3b223" +checksum = "5cd0496a71f3cc6bc4bf0ed91346426a5099e93d89807e663162dc5a1069ff65" dependencies = [ "bytemuck", "safe_arch", @@ -13997,7 +14211,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.16", + "syn 2.0.18", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index eed878428d387..26f2a842111e0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -199,6 +199,7 @@ members = [ "primitives/core", "primitives/core/hashing", "primitives/core/hashing/proc-macro", + "primitives/crypto/ec-utils", "primitives/database", "primitives/debug-derive", "primitives/externalities", diff --git a/primitives/crypto/ec-utils/Cargo.toml b/primitives/crypto/ec-utils/Cargo.toml new file mode 100644 index 0000000000000..e8546254031ea --- /dev/null +++ b/primitives/crypto/ec-utils/Cargo.toml @@ -0,0 +1,61 @@ +[package] +name = "sp-crypto-ec-utils" +version = "0.4.0" +authors = ["Parity Technologies "] +edition = "2021" +license = "Apache-2.0" +homepage = "https://substrate.io" +repository = "https://github.com/paritytech/substrate/" + +[package.metadata.docs.rs] +targets = ["x86_64-unknown-linux-gnu"] + +[dependencies] +ark-serialize = { version = "0.4.2", default-features = false } +ark-ff = { version = "0.4.2", default-features = false } +ark-ec = { version = "0.4.2", default-features = false } +ark-std = { version = "0.4.0", default-features = false } +ark-bls12-377 = { version = "0.4.0", features = ["curve"], default-features = false } +ark-bls12-381 = { version = "0.4.0", features = ["curve"], default-features = false } +ark-bw6-761 = { version = "0.4.0", default-features = false } +ark-ed-on-bls12-381-bandersnatch = { version = "0.4.0", default-features = false } +ark-ed-on-bls12-377 = { version = "0.4.0", default-features = false } +sp-std = { version = "8.0.0", path = "../../std", default-features = false } +codec = { package = "parity-scale-codec", version = "3.5.0", default-features = false } +ark-scale = { version = "0.0.3", features = ["hazmat"], default-features = false } +sp-runtime-interface = { version = "17.0.0", default-features = false, path = "../../runtime-interface" } + +[dev-dependencies] +sp-io = { path = "../../io", default-features = false } +ark-algebra-test-templates = { version = "0.4.2", default-features = false } +sp-ark-models = { version = "0.4.0-beta", default-features = false } +sp-ark-bls12-377 = { version = "0.4.0-beta", default-features = false } +sp-ark-bls12-381 = { version = "0.4.0-beta", default-features = false } +sp-ark-bw6-761 = { version = "0.4.0-beta", default-features = false } +sp-ark-ed-on-bls12-377 = { version = "0.4.0-beta", default-features = false } +sp-ark-ed-on-bls12-381-bandersnatch = { version = "0.4.0-beta", default-features = false } + +[features] +default = [ "std" ] +std = [ + "ark-serialize/std", + "ark-ff/std", + "ark-ec/std", + "ark-std/std", + "ark-bls12-377/std", + "ark-bls12-381/std", + "ark-bw6-761/std", + "ark-ed-on-bls12-381-bandersnatch/std", + "ark-ed-on-bls12-377/std", + "sp-std/std", + "codec/std", + "ark-scale/std", + "sp-runtime-interface/std", + "sp-io/std", + "ark-algebra-test-templates/std", + "sp-ark-bls12-377/std", + "sp-ark-bls12-381/std", + "sp-ark-bw6-761/std", + "sp-ark-ed-on-bls12-377/std", + "sp-ark-ed-on-bls12-381-bandersnatch/std", +] diff --git a/primitives/crypto/ec-utils/src/bls12_377.rs b/primitives/crypto/ec-utils/src/bls12_377.rs new file mode 100644 index 0000000000000..9230479b3bec5 --- /dev/null +++ b/primitives/crypto/ec-utils/src/bls12_377.rs @@ -0,0 +1,103 @@ +// This file is part of Substrate. + +// Copyright (C) 2017-2022 Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//! Support functions for bls12_377 to improve the performance of +//! multi_miller_loop, final_exponentiation, msm's and projective +//! multiplications by host function calls + +use crate::utils::{ + final_exponentiation_generic, msm_sw_generic, mul_projective_generic, multi_miller_loop_generic, +}; +use ark_bls12_377::{g1, g2, Bls12_377}; +use sp_std::vec::Vec; + +/// Compute a multi miller loop through arkworks +pub fn multi_miller_loop(a: Vec, b: Vec) -> Result, ()> { + multi_miller_loop_generic::(a, b) +} + +/// Compute a final exponentiation through arkworks +pub fn final_exponentiation(target: Vec) -> Result, ()> { + final_exponentiation_generic::(target) +} + +/// Compute a multi scalar multiplication for short_weierstrass through +/// arkworks on G1. +pub fn msm_g1(bases: Vec, scalars: Vec) -> Result, ()> { + msm_sw_generic::(bases, scalars) +} + +/// Compute a multi scalar multiplication for short_weierstrass through +/// arkworks on G2. +pub fn msm_g2(bases: Vec, scalars: Vec) -> Result, ()> { + msm_sw_generic::(bases, scalars) +} + +/// Compute a projective scalar multiplication for short_weierstrass +/// through arkworks on G1. +pub fn mul_projective_g1(base: Vec, scalar: Vec) -> Result, ()> { + mul_projective_generic::(base, scalar) +} + +/// Compute a projective scalar multiplication for short_weierstrass +/// through arkworks on G2. +pub fn mul_projective_g2(base: Vec, scalar: Vec) -> Result, ()> { + mul_projective_generic::(base, scalar) +} + +#[cfg(test)] +mod tests { + use super::*; + use ark_algebra_test_templates::*; + use sp_ark_bls12_377::{ + Bls12_377 as Bls12_377Host, G1Projective as G1ProjectiveHost, + G2Projective as G2ProjectiveHost, HostFunctions, + }; + + #[derive(PartialEq, Eq)] + struct Host; + + impl HostFunctions for Host { + fn bls12_377_multi_miller_loop(a: Vec, b: Vec) -> Result, ()> { + crate::elliptic_curves::bls12_377_multi_miller_loop(a, b) + } + fn bls12_377_final_exponentiation(f12: Vec) -> Result, ()> { + crate::elliptic_curves::bls12_377_final_exponentiation(f12) + } + fn bls12_377_msm_g1(bases: Vec, bigints: Vec) -> Result, ()> { + crate::elliptic_curves::bls12_377_msm_g1(bases, bigints) + } + fn bls12_377_msm_g2(bases: Vec, bigints: Vec) -> Result, ()> { + crate::elliptic_curves::bls12_377_msm_g2(bases, bigints) + } + fn bls12_377_mul_projective_g1(base: Vec, scalar: Vec) -> Result, ()> { + crate::elliptic_curves::bls12_377_mul_projective_g1(base, scalar) + } + fn bls12_377_mul_projective_g2(base: Vec, scalar: Vec) -> Result, ()> { + crate::elliptic_curves::bls12_377_mul_projective_g2(base, scalar) + } + } + + type Bls12_377 = Bls12_377Host; + type G1Projective = G1ProjectiveHost; + type G2Projective = G2ProjectiveHost; + + test_group!(g1; G1Projective; sw); + test_group!(g2; G2Projective; sw); + test_group!(pairing_output; ark_ec::pairing::PairingOutput; msm); + test_pairing!(pairing; super::Bls12_377); +} diff --git a/primitives/crypto/ec-utils/src/bls12_381.rs b/primitives/crypto/ec-utils/src/bls12_381.rs new file mode 100644 index 0000000000000..6c707aa581458 --- /dev/null +++ b/primitives/crypto/ec-utils/src/bls12_381.rs @@ -0,0 +1,219 @@ +// This file is part of Substrate. + +// Copyright (C) 2017-2022 Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//! Support functions for bls12_381 to improve the performance of +//! multi_miller_loop, final_exponentiation, msm's and projective +//! multiplications by host function calls + +use crate::utils::{ + final_exponentiation_generic, msm_sw_generic, mul_projective_generic, multi_miller_loop_generic, +}; +use ark_bls12_381::{g1, g2, Bls12_381}; +use sp_std::vec::Vec; + +/// Compute a multi miller loop through arkworks +pub fn multi_miller_loop(a: Vec, b: Vec) -> Result, ()> { + multi_miller_loop_generic::(a, b) +} + +/// Compute a final exponentiation through arkworks +pub fn final_exponentiation(target: Vec) -> Result, ()> { + final_exponentiation_generic::(target) +} + +/// Compute a multi scalar multiplication for short_weierstrass through +/// arkworks on G1. +pub fn msm_g1(bases: Vec, scalars: Vec) -> Result, ()> { + msm_sw_generic::(bases, scalars) +} + +/// Compute a multi scalar multiplication for short_weierstrass through +/// arkworks on G2. +pub fn msm_g2(bases: Vec, scalars: Vec) -> Result, ()> { + msm_sw_generic::(bases, scalars) +} + +/// Compute a projective scalar multiplication for short_weierstrass +/// through arkworks on G1. +pub fn mul_projective_g1(base: Vec, scalar: Vec) -> Result, ()> { + mul_projective_generic::(base, scalar) +} + +/// Compute a projective scalar multiplication for short_weierstrass +/// through arkworks on G2. +pub fn mul_projective_g2(base: Vec, scalar: Vec) -> Result, ()> { + mul_projective_generic::(base, scalar) +} + +#[cfg(test)] +mod tests { + use super::*; + use ark_algebra_test_templates::*; + use ark_ec::{AffineRepr, CurveGroup, Group}; + use ark_ff::{fields::Field, One, Zero}; + use ark_serialize::{CanonicalDeserialize, CanonicalSerialize, Compress, Validate}; + use ark_std::{rand::Rng, test_rng, vec, UniformRand}; + use sp_ark_bls12_381::{ + fq::Fq, fq2::Fq2, fr::Fr, Bls12_381 as Bls12_381Host, G1Affine as G1AffineHost, + G1Projective as G1ProjectiveHost, G2Affine as G2AffineHost, + G2Projective as G2ProjectiveHost, HostFunctions, + }; + use sp_ark_models::pairing::PairingOutput; + + #[derive(PartialEq, Eq)] + struct Host; + + impl HostFunctions for Host { + fn bls12_381_multi_miller_loop(a: Vec, b: Vec) -> Result, ()> { + crate::elliptic_curves::bls12_381_multi_miller_loop(a, b) + } + fn bls12_381_final_exponentiation(f12: Vec) -> Result, ()> { + crate::elliptic_curves::bls12_381_final_exponentiation(f12) + } + fn bls12_381_msm_g1(bases: Vec, bigints: Vec) -> Result, ()> { + crate::elliptic_curves::bls12_381_msm_g1(bases, bigints) + } + fn bls12_381_msm_g2(bases: Vec, bigints: Vec) -> Result, ()> { + crate::elliptic_curves::bls12_381_msm_g2(bases, bigints) + } + fn bls12_381_mul_projective_g1(base: Vec, scalar: Vec) -> Result, ()> { + crate::elliptic_curves::bls12_381_mul_projective_g1(base, scalar) + } + fn bls12_381_mul_projective_g2(base: Vec, scalar: Vec) -> Result, ()> { + crate::elliptic_curves::bls12_381_mul_projective_g2(base, scalar) + } + } + + type Bls12_381 = Bls12_381Host; + type G1Projective = G1ProjectiveHost; + type G2Projective = G2ProjectiveHost; + type G1Affine = G1AffineHost; + type G2Affine = G2AffineHost; + + test_group!(g1; G1Projective; sw); + test_group!(g2; G2Projective; sw); + test_group!(pairing_output; PairingOutput; msm); + test_pairing!(ark_pairing; super::Bls12_381); + + #[test] + fn test_g1_endomorphism_beta() { + assert!(sp_ark_bls12_381::g1::BETA.pow([3u64]).is_one()); + } + + #[test] + fn test_g1_subgroup_membership_via_endomorphism() { + let mut rng = test_rng(); + let generator = G1Projective::rand(&mut rng).into_affine(); + assert!(generator.is_in_correct_subgroup_assuming_on_curve()); + } + + #[test] + fn test_g1_subgroup_non_membership_via_endomorphism() { + let mut rng = test_rng(); + loop { + let x = Fq::rand(&mut rng); + let greatest = rng.gen(); + + if let Some(p) = G1Affine::get_point_from_x_unchecked(x, greatest) { + if !::is_zero(&p.mul_bigint(Fr::characteristic())) { + assert!(!p.is_in_correct_subgroup_assuming_on_curve()); + return + } + } + } + } + + #[test] + fn test_g2_subgroup_membership_via_endomorphism() { + let mut rng = test_rng(); + let generator = G2Projective::rand(&mut rng).into_affine(); + assert!(generator.is_in_correct_subgroup_assuming_on_curve()); + } + + #[test] + fn test_g2_subgroup_non_membership_via_endomorphism() { + let mut rng = test_rng(); + loop { + let x = Fq2::rand(&mut rng); + let greatest = rng.gen(); + + if let Some(p) = G2Affine::get_point_from_x_unchecked(x, greatest) { + if !::is_zero(&p.mul_bigint(Fr::characteristic())) { + assert!(!p.is_in_correct_subgroup_assuming_on_curve()); + return + } + } + } + } + + // Test vectors and macro adapted from https://github.com/zkcrypto/bls12_381/blob/e224ad4ea1babfc582ccd751c2bf128611d10936/src/test-data/mod.rs + macro_rules! test_vectors { + ($projective:ident, $affine:ident, $compress:expr, $expected:ident) => { + let mut e = $projective::zero(); + + let mut v = vec![]; + { + let mut expected = $expected; + for _ in 0..1000 { + let e_affine = $affine::from(e); + let mut serialized = vec![0u8; e.serialized_size($compress)]; + e_affine.serialize_with_mode(serialized.as_mut_slice(), $compress).unwrap(); + v.extend_from_slice(&serialized[..]); + + let mut decoded = serialized; + let len_of_encoding = decoded.len(); + (&mut decoded[..]).copy_from_slice(&expected[0..len_of_encoding]); + expected = &expected[len_of_encoding..]; + let decoded = + $affine::deserialize_with_mode(&decoded[..], $compress, Validate::Yes) + .unwrap(); + assert_eq!(e_affine, decoded); + + e += &$projective::generator(); + } + } + + assert_eq!(&v[..], $expected); + }; + } + + #[test] + fn g1_compressed_valid_test_vectors() { + let bytes: &'static [u8] = include_bytes!("test-data/g1_compressed_valid_test_vectors.dat"); + test_vectors!(G1Projective, G1Affine, Compress::Yes, bytes); + } + + #[test] + fn g1_uncompressed_valid_test_vectors() { + let bytes: &'static [u8] = + include_bytes!("test-data/g1_uncompressed_valid_test_vectors.dat"); + test_vectors!(G1Projective, G1Affine, Compress::No, bytes); + } + + #[test] + fn g2_compressed_valid_test_vectors() { + let bytes: &'static [u8] = include_bytes!("test-data/g2_compressed_valid_test_vectors.dat"); + test_vectors!(G2Projective, G2Affine, Compress::Yes, bytes); + } + + #[test] + fn g2_uncompressed_valid_test_vectors() { + let bytes: &'static [u8] = + include_bytes!("test-data/g2_uncompressed_valid_test_vectors.dat"); + test_vectors!(G2Projective, G2Affine, Compress::No, bytes); + } +} diff --git a/primitives/crypto/ec-utils/src/bw6_761.rs b/primitives/crypto/ec-utils/src/bw6_761.rs new file mode 100644 index 0000000000000..2f3b4c3c9c9aa --- /dev/null +++ b/primitives/crypto/ec-utils/src/bw6_761.rs @@ -0,0 +1,103 @@ +// This file is part of Substrate. + +// Copyright (C) 2017-2022 Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//! Support functions for bw6_761 to improve the performance of +//! multi_miller_loop, final_exponentiation, msm's and projective +//! multiplications by host function calls. + +use crate::utils::{ + final_exponentiation_generic, msm_sw_generic, mul_projective_generic, multi_miller_loop_generic, +}; +use ark_bw6_761::{g1, g2, BW6_761}; +use sp_std::vec::Vec; + +/// Compute a multi miller loop through arkworks +pub fn multi_miller_loop(a: Vec, b: Vec) -> Result, ()> { + multi_miller_loop_generic::(a, b) +} + +/// Compute a final exponentiation through arkworks +pub fn final_exponentiation(target: Vec) -> Result, ()> { + final_exponentiation_generic::(target) +} + +/// Compute a multi scalar multiplication for short_weierstrass through +/// arkworks on G1. +pub fn msm_g1(bases: Vec, scalars: Vec) -> Result, ()> { + msm_sw_generic::(bases, scalars) +} + +/// Compute a multi scalar multiplication for short_weierstrass through +/// arkworks on G2. +pub fn msm_g2(bases: Vec, scalars: Vec) -> Result, ()> { + msm_sw_generic::(bases, scalars) +} + +/// Compute a projective scalar multiplication for short_weierstrass through +/// arkworks on G1. +pub fn mul_projective_g1(base: Vec, scalar: Vec) -> Result, ()> { + mul_projective_generic::(base, scalar) +} + +/// Compute a projective scalar multiplication for short_weierstrass through +/// arkworks on G2. +pub fn mul_projective_g2(base: Vec, scalar: Vec) -> Result, ()> { + mul_projective_generic::(base, scalar) +} + +#[cfg(test)] +mod tests { + use super::*; + use ark_algebra_test_templates::*; + use sp_ark_bw6_761::{ + G1Projective as G1ProjectiveHost, G2Projective as G2ProjectiveHost, HostFunctions, + BW6_761 as BW6_761Host, + }; + + #[derive(PartialEq, Eq)] + struct Host; + + impl HostFunctions for Host { + fn bw6_761_multi_miller_loop(a: Vec, b: Vec) -> Result, ()> { + crate::elliptic_curves::bw6_761_multi_miller_loop(a, b) + } + fn bw6_761_final_exponentiation(f12: Vec) -> Result, ()> { + crate::elliptic_curves::bw6_761_final_exponentiation(f12) + } + fn bw6_761_msm_g1(bases: Vec, bigints: Vec) -> Result, ()> { + crate::elliptic_curves::bw6_761_msm_g1(bases, bigints) + } + fn bw6_761_msm_g2(bases: Vec, bigints: Vec) -> Result, ()> { + crate::elliptic_curves::bw6_761_msm_g2(bases, bigints) + } + fn bw6_761_mul_projective_g1(base: Vec, scalar: Vec) -> Result, ()> { + crate::elliptic_curves::bw6_761_mul_projective_g1(base, scalar) + } + fn bw6_761_mul_projective_g2(base: Vec, scalar: Vec) -> Result, ()> { + crate::elliptic_curves::bw6_761_mul_projective_g2(base, scalar) + } + } + + type BW6_761 = BW6_761Host; + type G1Projective = G1ProjectiveHost; + type G2Projective = G2ProjectiveHost; + + test_group!(g1; G1Projective; sw); + test_group!(g2; G2Projective; sw); + test_group!(pairing_output; ark_ec::pairing::PairingOutput; msm); + test_pairing!(pairing; super::BW6_761); +} diff --git a/primitives/crypto/ec-utils/src/ed_on_bls12_377.rs b/primitives/crypto/ec-utils/src/ed_on_bls12_377.rs new file mode 100644 index 0000000000000..84a86286180f7 --- /dev/null +++ b/primitives/crypto/ec-utils/src/ed_on_bls12_377.rs @@ -0,0 +1,56 @@ +// This file is part of Substrate. + +// Copyright (C) 2017-2022 Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//! Support functions for ed_on_bls12_377 to improve the performance of +//! msm and projective multiplication by host function calls + +use crate::utils::{msm_te_generic, mul_projective_te_generic}; +use ark_ed_on_bls12_377::EdwardsConfig; +use sp_std::vec::Vec; + +/// Compute a multi scalar mulitplication for twisted_edwards through +/// arkworks. +pub fn msm(bases: Vec, scalars: Vec) -> Result, ()> { + msm_te_generic::(bases, scalars) +} + +/// Compute a projective scalar multiplication for twisted_edwards +/// through arkworks. +pub fn mul_projective(base: Vec, scalar: Vec) -> Result, ()> { + mul_projective_te_generic::(base, scalar) +} + +#[cfg(test)] +mod tests { + use super::*; + use ark_algebra_test_templates::*; + use sp_ark_ed_on_bls12_377::{EdwardsProjective as EdwardsProjectiveHost, HostFunctions}; + + struct Host {} + + impl HostFunctions for Host { + fn ed_on_bls12_377_msm(bases: Vec, scalars: Vec) -> Result, ()> { + crate::elliptic_curves::ed_on_bls12_377_msm(bases, scalars) + } + fn ed_on_bls12_377_mul_projective(base: Vec, scalar: Vec) -> Result, ()> { + crate::elliptic_curves::ed_on_bls12_377_mul_projective(base, scalar) + } + } + + type EdwardsProjective = EdwardsProjectiveHost; + test_group!(te; EdwardsProjective; te); +} diff --git a/primitives/crypto/ec-utils/src/ed_on_bls12_381_bandersnatch.rs b/primitives/crypto/ec-utils/src/ed_on_bls12_381_bandersnatch.rs new file mode 100644 index 0000000000000..72b68c3b47182 --- /dev/null +++ b/primitives/crypto/ec-utils/src/ed_on_bls12_381_bandersnatch.rs @@ -0,0 +1,94 @@ +// This file is part of Substrate. + +// Copyright (C) 2017-2022 Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//! Support functions for ed_on_bls12_381_bandersnatch to improve the +//! performance of msm' and projective multiplications by host function +//! calls. + +use crate::utils::{ + msm_sw_generic, msm_te_generic, mul_projective_generic, mul_projective_te_generic, +}; +use ark_ed_on_bls12_381_bandersnatch::BandersnatchConfig; +use sp_std::vec::Vec; + +/// Compute a multi scalar multiplication for short_weierstrass through +/// arkworks. +pub fn sw_msm(bases: Vec, scalars: Vec) -> Result, ()> { + msm_sw_generic::(bases, scalars) +} + +/// Compute a multi scalar mulitplication for twisted_edwards through +/// arkworks. +pub fn te_msm(bases: Vec, scalars: Vec) -> Result, ()> { + msm_te_generic::(bases, scalars) +} + +/// Compute a projective scalar multiplication for short_weierstrass +/// through arkworks. +pub fn sw_mul_projective(base: Vec, scalar: Vec) -> Result, ()> { + mul_projective_generic::(base, scalar) +} + +/// Compute a projective scalar multiplication for twisted_edwards +/// through arkworks. +pub fn te_mul_projective(base: Vec, scalar: Vec) -> Result, ()> { + mul_projective_te_generic::(base, scalar) +} + +#[cfg(test)] +mod tests { + use super::*; + use ark_algebra_test_templates::*; + use sp_ark_ed_on_bls12_381_bandersnatch::{ + EdwardsProjective as EdwardsProjectiveHost, HostFunctions, SWProjective as SWProjectiveHost, + }; + + pub struct Host {} + + impl HostFunctions for Host { + fn ed_on_bls12_381_bandersnatch_te_msm( + bases: Vec, + scalars: Vec, + ) -> Result, ()> { + crate::elliptic_curves::ed_on_bls12_381_bandersnatch_te_msm(bases, scalars) + } + fn ed_on_bls12_381_bandersnatch_sw_msm( + bases: Vec, + scalars: Vec, + ) -> Result, ()> { + crate::elliptic_curves::ed_on_bls12_381_bandersnatch_sw_msm(bases, scalars) + } + fn ed_on_bls12_381_bandersnatch_te_mul_projective( + base: Vec, + scalar: Vec, + ) -> Result, ()> { + crate::elliptic_curves::ed_on_bls12_381_bandersnatch_te_mul_projective(base, scalar) + } + fn ed_on_bls12_381_bandersnatch_sw_mul_projective( + base: Vec, + scalar: Vec, + ) -> Result, ()> { + crate::elliptic_curves::ed_on_bls12_381_bandersnatch_sw_mul_projective(base, scalar) + } + } + + type EdwardsProjective = EdwardsProjectiveHost; + type SWProjective = SWProjectiveHost; + + test_group!(sw; SWProjective; sw); + test_group!(te; EdwardsProjective; te); +} diff --git a/primitives/crypto/ec-utils/src/lib.rs b/primitives/crypto/ec-utils/src/lib.rs new file mode 100644 index 0000000000000..c1877dd5b5d72 --- /dev/null +++ b/primitives/crypto/ec-utils/src/lib.rs @@ -0,0 +1,264 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//! The main elliptic curves trait, allowing Substrate to call into host functions +//! for operations on elliptic curves. + +#![warn(missing_docs)] +#![cfg_attr(not(feature = "std"), no_std)] + +pub mod bls12_377; +pub mod bls12_381; +pub mod bw6_761; +pub mod ed_on_bls12_377; +pub mod ed_on_bls12_381_bandersnatch; +mod utils; + +use sp_runtime_interface::runtime_interface; + +/// Interfaces for working with elliptic curves related types from within the runtime. +/// All type are (de-)serialized through the wrapper types from the ark-scale trait, +/// with ark_scale::{ArkScale, ArkScaleProjective}; +#[runtime_interface] +pub trait EllipticCurves { + /// Compute a multi Miller loop for bls12_37 + /// Receives encoded: + /// a: ArkScale>> + /// b: ArkScale>> + /// Returns encoded: ArkScale>> + fn bls12_377_multi_miller_loop(a: Vec, b: Vec) -> Result, ()> { + bls12_377::multi_miller_loop(a, b) + } + + /// Compute a final exponentiation for bls12_377 + /// Receives encoded: ArkScale>> + /// Returns encoded: ArkScale>> + fn bls12_377_final_exponentiation(f12: Vec) -> Result, ()> { + bls12_377::final_exponentiation(f12) + } + + /// Compute a projective multiplication on G1 for bls12_377 + /// Receives encoded: + /// base: ArkScaleProjective + /// scalar: ArkScale<&[u64]> + /// Returns encoded: ArkScaleProjective + fn bls12_377_mul_projective_g1(base: Vec, scalar: Vec) -> Result, ()> { + bls12_377::mul_projective_g1(base, scalar) + } + + /// Compute a projective multiplication on G2 for bls12_377 + /// through arkworks on G2 + /// Receives encoded: + /// base: ArkScaleProjective + /// scalar: ArkScale<&[u64]> + /// Returns encoded: ArkScaleProjective + fn bls12_377_mul_projective_g2(base: Vec, scalar: Vec) -> Result, ()> { + bls12_377::mul_projective_g2(base, scalar) + } + + /// Compute a msm on G1 for bls12_377 + /// Receives encoded: + /// bases: ArkScale<&[ark_bls12_377::G1Affine]> + /// scalars: ArkScale<&[ark_bls12_377::Fr]> + /// Returns encoded: ArkScaleProjective + fn bls12_377_msm_g1(bases: Vec, scalars: Vec) -> Result, ()> { + bls12_377::msm_g1(bases, scalars) + } + + /// Compute a msm on G2 for bls12_377 + /// Receives encoded: + /// bases: ArkScale<&[ark_bls12_377::G2Affine]> + /// scalars: ArkScale<&[ark_bls12_377::Fr]> + /// Returns encoded: ArkScaleProjective + fn bls12_377_msm_g2(bases: Vec, scalars: Vec) -> Result, ()> { + bls12_377::msm_g2(bases, scalars) + } + + /// Compute a multi Miller loop on bls12_381 + /// Receives encoded: + /// a: ArkScale>> + /// b: ArkScale>> + /// Returns encoded: ArkScale>> + fn bls12_381_multi_miller_loop(a: Vec, b: Vec) -> Result, ()> { + bls12_381::multi_miller_loop(a, b) + } + + /// Compute a final exponentiation on bls12_381 + /// Receives encoded: ArkScale>> + /// Returns encoded:ArkScale>> + fn bls12_381_final_exponentiation(f12: Vec) -> Result, ()> { + bls12_381::final_exponentiation(f12) + } + + /// Compute a projective multiplication on G1 for bls12_381 + /// Receives encoded: + /// base: ArkScaleProjective + /// scalar: ArkScale<&[u64]> + /// Returns encoded: ArkScaleProjective + fn bls12_381_mul_projective_g1(base: Vec, scalar: Vec) -> Result, ()> { + bls12_381::mul_projective_g1(base, scalar) + } + + /// Compute a projective multiplication on G2 for bls12_381 + /// Receives encoded: + /// base: ArkScaleProjective + /// scalar: ArkScale<&[u64]> + /// Returns encoded: ArkScaleProjective + fn bls12_381_mul_projective_g2(base: Vec, scalar: Vec) -> Result, ()> { + bls12_381::mul_projective_g2(base, scalar) + } + + /// Compute a msm on G1 for bls12_381 + /// Receives encoded: + /// bases: ArkScale<&[ark_bls12_381::G1Affine]> + /// scalars: ArkScale<&[ark_bls12_381::Fr]> + /// Returns encoded: ArkScaleProjective + fn bls12_381_msm_g1(bases: Vec, scalars: Vec) -> Result, ()> { + bls12_381::msm_g1(bases, scalars) + } + + /// Compute a msm on G2 for bls12_381 + /// Receives encoded: + /// bases: ArkScale<&[ark_bls12_381::G2Affine]> + /// scalars: ArkScale<&[ark_bls12_381::Fr]> + /// Returns encoded: ArkScaleProjective + fn bls12_381_msm_g2(bases: Vec, scalars: Vec) -> Result, ()> { + bls12_381::msm_g2(bases, scalars) + } + + /// Compute a multi Miller loop on bw6_761 + /// Receives encoded: + /// a: ArkScale>> + /// b: ArkScale>> + /// Returns encoded: ArkScale>> + fn bw6_761_multi_miller_loop(a: Vec, b: Vec) -> Result, ()> { + bw6_761::multi_miller_loop(a, b) + } + + /// Compute a final exponentiation on bw6_761 + /// Receives encoded: ArkScale>> + /// Returns encoded: ArkScale>> + fn bw6_761_final_exponentiation(f12: Vec) -> Result, ()> { + bw6_761::final_exponentiation(f12) + } + + /// Compute a projective multiplication on G1 for bw6_761 + /// Receives encoded: + /// base: ArkScaleProjective + /// scalar: ArkScale<&[u64]> + /// Returns encoded: ArkScaleProjective + fn bw6_761_mul_projective_g1(base: Vec, scalar: Vec) -> Result, ()> { + bw6_761::mul_projective_g1(base, scalar) + } + + /// Compute a projective multiplication on G2 for bw6_761 + /// Receives encoded: + /// base: ArkScaleProjective + /// scalar: ArkScale<&[u64]> + /// Returns encoded: ArkScaleProjective + fn bw6_761_mul_projective_g2(base: Vec, scalar: Vec) -> Result, ()> { + bw6_761::mul_projective_g2(base, scalar) + } + + /// Compute a msm on G1 for bw6_761 + /// Receives encoded: + /// bases: ArkScale<&[ark_bw6_761::G1Affine]> + /// scalars: ArkScale<&[ark_bw6_761::Fr]> + /// Returns encoded: ArkScaleProjective + fn bw6_761_msm_g1(bases: Vec, bigints: Vec) -> Result, ()> { + bw6_761::msm_g1(bases, bigints) + } + + /// Compute a msm on G2 for bw6_761 + /// Receives encoded: + /// bases: ArkScale<&[ark_bw6_761::G2Affine]> + /// scalars: ArkScale<&[ark_bw6_761::Fr]> + /// Returns encoded: ArkScaleProjective + fn bw6_761_msm_g2(bases: Vec, bigints: Vec) -> Result, ()> { + bw6_761::msm_g2(bases, bigints) + } + + /// Compute projective multiplication on ed_on_bls12_377 + /// Receives encoded: + /// base: ArkScaleProjective + /// scalar: ArkScale<&[u64]> + /// Returns encoded: ArkScaleProjective + fn ed_on_bls12_377_mul_projective(base: Vec, scalar: Vec) -> Result, ()> { + ed_on_bls12_377::mul_projective(base, scalar) + } + + /// Compute msm on ed_on_bls12_377 + /// Receives encoded: + /// bases: ArkScale<&[ark_ed_on_bls12_377::EdwardsAffine]> + /// scalars: + /// ArkScale<&[ark_ed_on_bls12_377::Fr]> + /// Returns encoded: + /// ArkScaleProjective + fn ed_on_bls12_377_msm(bases: Vec, scalars: Vec) -> Result, ()> { + ed_on_bls12_377::msm(bases, scalars) + } + + /// Compute short weierstrass projective multiplication on ed_on_bls12_381_bandersnatch + /// Receives encoded: + /// base: ArkScaleProjective + /// scalar: ArkScale<&[u64]> + /// Returns encoded: ArkScaleProjective + fn ed_on_bls12_381_bandersnatch_sw_mul_projective( + base: Vec, + scalar: Vec, + ) -> Result, ()> { + ed_on_bls12_381_bandersnatch::sw_mul_projective(base, scalar) + } + + /// Compute twisted edwards projective multiplication on ed_on_bls12_381_bandersnatch + /// Receives encoded: + /// base: ArkScaleProjective + /// scalar: ArkScale<&[u64]> + /// Returns encoded: ArkScaleProjective + fn ed_on_bls12_381_bandersnatch_te_mul_projective( + base: Vec, + scalar: Vec, + ) -> Result, ()> { + ed_on_bls12_381_bandersnatch::te_mul_projective(base, scalar) + } + + /// Compute short weierstrass msm on ed_on_bls12_381_bandersnatch + /// Receives encoded: + /// bases: ArkScale<&[ark_ed_on_bls12_381_bandersnatch::SWAffine]> + /// scalars: ArkScale<&[ark_ed_on_bls12_381_bandersnatch::Fr]> + /// Returns encoded: + /// ArkScaleProjective + fn ed_on_bls12_381_bandersnatch_sw_msm( + bases: Vec, + scalars: Vec, + ) -> Result, ()> { + ed_on_bls12_381_bandersnatch::sw_msm(bases, scalars) + } + + /// Compute twisted edwards msm on ed_on_bls12_381_bandersnatch + /// Receives encoded: + /// base: ArkScaleProjective + /// scalars: ArkScale<&[ark_ed_on_bls12_381_bandersnatch::Fr]> + /// Returns encoded: + /// ArkScaleProjective + fn ed_on_bls12_381_bandersnatch_te_msm( + bases: Vec, + scalars: Vec, + ) -> Result, ()> { + ed_on_bls12_381_bandersnatch::te_msm(bases, scalars) + } +} diff --git a/primitives/crypto/ec-utils/src/test-data/g1_compressed_valid_test_vectors.dat b/primitives/crypto/ec-utils/src/test-data/g1_compressed_valid_test_vectors.dat new file mode 100644 index 0000000000000..ea8cd67652d13 Binary files /dev/null and b/primitives/crypto/ec-utils/src/test-data/g1_compressed_valid_test_vectors.dat differ diff --git a/primitives/crypto/ec-utils/src/test-data/g1_uncompressed_valid_test_vectors.dat b/primitives/crypto/ec-utils/src/test-data/g1_uncompressed_valid_test_vectors.dat new file mode 100644 index 0000000000000..86abfba945c7b Binary files /dev/null and b/primitives/crypto/ec-utils/src/test-data/g1_uncompressed_valid_test_vectors.dat differ diff --git a/primitives/crypto/ec-utils/src/test-data/g2_compressed_valid_test_vectors.dat b/primitives/crypto/ec-utils/src/test-data/g2_compressed_valid_test_vectors.dat new file mode 100644 index 0000000000000..a40bbe251d90e Binary files /dev/null and b/primitives/crypto/ec-utils/src/test-data/g2_compressed_valid_test_vectors.dat differ diff --git a/primitives/crypto/ec-utils/src/test-data/g2_uncompressed_valid_test_vectors.dat b/primitives/crypto/ec-utils/src/test-data/g2_uncompressed_valid_test_vectors.dat new file mode 100644 index 0000000000000..92e4bc528e893 Binary files /dev/null and b/primitives/crypto/ec-utils/src/test-data/g2_uncompressed_valid_test_vectors.dat differ diff --git a/primitives/crypto/ec-utils/src/utils.rs b/primitives/crypto/ec-utils/src/utils.rs new file mode 100644 index 0000000000000..5560d59211605 --- /dev/null +++ b/primitives/crypto/ec-utils/src/utils.rs @@ -0,0 +1,130 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//! The generic executions of the operations on arkworks elliptic curves +//! which get instantiatied by the corresponding curves. +use ark_ec::{ + pairing::{MillerLoopOutput, Pairing, PairingOutput}, + short_weierstrass, + short_weierstrass::SWCurveConfig, + twisted_edwards, + twisted_edwards::TECurveConfig, + CurveConfig, VariableBaseMSM, +}; +use ark_scale::hazmat::ArkScaleProjective; +use ark_std::vec::Vec; +use codec::{Decode, Encode}; + +const HOST_CALL: ark_scale::Usage = ark_scale::HOST_CALL; +type ArkScale = ark_scale::ArkScale; + +pub(crate) fn multi_miller_loop_generic( + g1: Vec, + g2: Vec, +) -> Result, ()> { + let g1 = ::G1Affine>> as Decode>::decode(&mut g1.as_slice()) + .map_err(|_| ())?; + let g2 = ::G2Affine>> as Decode>::decode(&mut g2.as_slice()) + .map_err(|_| ())?; + + let result = Curve::multi_miller_loop(g1.0, g2.0).0; + + let result: ArkScale<::TargetField> = result.into(); + Ok(result.encode()) +} + +pub(crate) fn final_exponentiation_generic(target: Vec) -> Result, ()> { + let target = + ::TargetField> as Decode>::decode(&mut target.as_slice()) + .map_err(|_| ())?; + + let result = Curve::final_exponentiation(MillerLoopOutput(target.0)).ok_or(())?; + + let result: ArkScale> = result.into(); + Ok(result.encode()) +} + +pub(crate) fn msm_sw_generic( + bases: Vec, + scalars: Vec, +) -> Result, ()> { + let bases = + >> as Decode>::decode(&mut bases.as_slice()) + .map_err(|_| ())?; + let scalars = ::ScalarField>> as Decode>::decode( + &mut scalars.as_slice(), + ) + .map_err(|_| ())?; + + let result = + as VariableBaseMSM>::msm(&bases.0, &scalars.0) + .map_err(|_| ())?; + + let result: ArkScaleProjective> = result.into(); + Ok(result.encode()) +} + +pub(crate) fn msm_te_generic( + bases: Vec, + scalars: Vec, +) -> Result, ()> { + let bases = + >> as Decode>::decode(&mut bases.as_slice()) + .map_err(|_| ())?; + let scalars = ::ScalarField>> as Decode>::decode( + &mut scalars.as_slice(), + ) + .map_err(|_| ())?; + + let result = as VariableBaseMSM>::msm(&bases.0, &scalars.0) + .map_err(|_| ())?; + + let result: ArkScaleProjective> = result.into(); + Ok(result.encode()) +} + +pub(crate) fn mul_projective_generic( + base: Vec, + scalar: Vec, +) -> Result, ()> { + let base = > as Decode>::decode( + &mut base.as_slice(), + ) + .map_err(|_| ())?; + let scalar = > as Decode>::decode(&mut scalar.as_slice()).map_err(|_| ())?; + + let result = ::mul_projective(&base.0, &scalar.0); + + let result: ArkScaleProjective> = result.into(); + Ok(result.encode()) +} + +pub(crate) fn mul_projective_te_generic( + base: Vec, + scalar: Vec, +) -> Result, ()> { + let base = > as Decode>::decode( + &mut base.as_slice(), + ) + .map_err(|_| ())?; + let scalar = > as Decode>::decode(&mut scalar.as_slice()).map_err(|_| ())?; + + let result = ::mul_projective(&base.0, &scalar.0); + + let result: ArkScaleProjective> = result.into(); + Ok(result.encode()) +}