From 136350ac69cf855b766bd270fe7abcc5d776382a Mon Sep 17 00:00:00 2001 From: Nikita Masych Date: Fri, 29 Nov 2024 17:52:39 +0200 Subject: [PATCH] feat: using std as features --- Cargo.lock | 120 +++++++++++++---------------------------------------- Cargo.toml | 16 +++++-- src/lib.rs | 2 +- 3 files changed, 43 insertions(+), 95 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e245e09..e3ffcd7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,7 +1,6 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -# This file is automatically @valid by Cargo. -version = 3 +version = 4 [[package]] name = "ahash" @@ -75,31 +74,6 @@ dependencies = [ "tiny-keccak", ] -[[package]] -name = "crossbeam-deque" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" -dependencies = [ - "crossbeam-epoch", - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-epoch" -version = "0.9.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" -dependencies = [ - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-utils" -version = "0.8.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" - [[package]] name = "crunchy" version = "0.2.2" @@ -183,7 +157,7 @@ checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.89", ] [[package]] @@ -248,15 +222,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" dependencies = [ "ahash", - "rayon", "serde", ] [[package]] name = "hashbrown" -version = "0.15.1" +version = "0.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a9bfc1af68b1726ea47d3d5109de126281def866b33970e10fbab11b5dafab3" +checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" [[package]] name = "heck" @@ -277,7 +250,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "707907fe3c25f5424cce2cb7e1cbcafee6bdbe735ca90ef77c29e84591e5b9da" dependencies = [ "equivalent", - "hashbrown 0.15.1", + "hashbrown 0.15.2", ] [[package]] @@ -310,9 +283,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.162" +version = "0.2.167" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18d287de67fe55fd7e1581fe933d965a5a9477b38e949cfa9f8574ef01506398" +checksum = "09d6582e104315a817dff97f75133544b2e094ee22447d2acf4a74e189ba06fc" [[package]] name = "log" @@ -422,7 +395,7 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "plonky2" version = "1.0.0" -source = "git+https://github.com/distributed-lab/plonky2?branch=stable#fa0e0591592cfa214d92aeebe500b07ae3410c3b" +source = "git+https://github.com/distributed-lab/plonky2?branch=stable#0088a5b472148faafd8df10c43cbbb70b17e2409" dependencies = [ "ahash", "anyhow", @@ -436,11 +409,9 @@ dependencies = [ "plonky2_maybe_rayon", "plonky2_util", "rand", - "rand_chacha", "serde", "static_assertions", "unroll", - "web-time", ] [[package]] @@ -455,7 +426,7 @@ dependencies = [ [[package]] name = "plonky2_field" version = "1.0.0" -source = "git+https://github.com/distributed-lab/plonky2?branch=stable#fa0e0591592cfa214d92aeebe500b07ae3410c3b" +source = "git+https://github.com/distributed-lab/plonky2?branch=stable#0088a5b472148faafd8df10c43cbbb70b17e2409" dependencies = [ "anyhow", "itertools", @@ -470,15 +441,12 @@ dependencies = [ [[package]] name = "plonky2_maybe_rayon" version = "1.0.0" -source = "git+https://github.com/distributed-lab/plonky2?branch=stable#fa0e0591592cfa214d92aeebe500b07ae3410c3b" -dependencies = [ - "rayon", -] +source = "git+https://github.com/distributed-lab/plonky2?branch=stable#0088a5b472148faafd8df10c43cbbb70b17e2409" [[package]] name = "plonky2_util" version = "1.0.0" -source = "git+https://github.com/distributed-lab/plonky2?branch=stable#fa0e0591592cfa214d92aeebe500b07ae3410c3b" +source = "git+https://github.com/distributed-lab/plonky2?branch=stable#0088a5b472148faafd8df10c43cbbb70b17e2409" [[package]] name = "ppv-lite86" @@ -510,9 +478,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.89" +version = "1.0.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f139b0662de085916d1fb67d2b4169d1addddda1919e696f3252b740b629986e" +checksum = "37d3544b3f2748c54e147655edb5025752e2303145b5aefb3c3ea2c78b973bb0" dependencies = [ "unicode-ident", ] @@ -556,26 +524,6 @@ dependencies = [ "getrandom", ] -[[package]] -name = "rayon" -version = "1.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" -dependencies = [ - "either", - "rayon-core", -] - -[[package]] -name = "rayon-core" -version = "1.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" -dependencies = [ - "crossbeam-deque", - "crossbeam-utils", -] - [[package]] name = "regex" version = "1.11.1" @@ -590,9 +538,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.8" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "368758f23274712b504848e9d5a6f010445cc8b87a7cdb4d7cbee666c1288da3" +checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" dependencies = [ "aho-corasick", "memchr", @@ -637,7 +585,7 @@ dependencies = [ "regex", "relative-path", "rustc_version", - "syn 2.0.87", + "syn 2.0.89", "unicode-ident", ] @@ -658,22 +606,22 @@ checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" [[package]] name = "serde" -version = "1.0.214" +version = "1.0.215" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f55c3193aca71c12ad7890f1785d2b73e1b9f63a0bbc353c08ef26fe03fc56b5" +checksum = "6513c1ad0b11a9376da888e3e0baa0077f1aed55c17f50e7b2397136129fb88f" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.214" +version = "1.0.215" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de523f781f095e28fa605cdce0f8307e451cc0fd14e2eb4cd2e98a355b147766" +checksum = "ad1e866f866923f252f05c889987993144fb74e722403468a4ebd70c3cd756c0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.89", ] [[package]] @@ -703,7 +651,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.89", ] [[package]] @@ -725,9 +673,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.87" +version = "2.0.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25aa4ce346d03a6dcd68dd8b4010bcb74e54e62c90c573f394c46eae99aba32d" +checksum = "44d46482f1c1c87acd84dea20c1bf5ebff4c757009ed6bf19cfd36fb10e92c4e" dependencies = [ "proc-macro2", "quote", @@ -774,9 +722,9 @@ dependencies = [ [[package]] name = "unicode-ident" -version = "1.0.13" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e91b56cd4cadaeb79bbf1a5645f6b4f8dc5bde8834ad5894a8db35fda9efa1fe" +checksum = "adb9e6ca4f869e1180728b7950e35922a7fc6397f7b641499e8f3ef06e50dc83" [[package]] name = "unroll" @@ -822,7 +770,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.89", "wasm-bindgen-shared", ] @@ -844,7 +792,7 @@ checksum = "26c6ab57572f7a24a4985830b120de1594465e5d500f24afe89e16b4e833ef68" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.89", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -855,16 +803,6 @@ version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "65fc09f10666a9f147042251e0dda9c18f166ff7de300607007e96bdebc1068d" -[[package]] -name = "web-time" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a6580f308b1fad9207618087a65c04e7a10bc77e02c8e84e9b00dd4b12fa0bb" -dependencies = [ - "js-sys", - "wasm-bindgen", -] - [[package]] name = "winnow" version = "0.6.20" @@ -892,5 +830,5 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.89", ] diff --git a/Cargo.toml b/Cargo.toml index 4b9ab0d..0145684 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,9 +10,19 @@ documentation = "https://distributed-lab.github.io/plonky2-verifier/" authors = ["Distributed Lab"] keywords = ["crypto", "no-std", "blockchain", "cryptography"] +resolver = "2" + [dependencies] -plonky2 = { git = "https://github.com/distributed-lab/plonky2", branch = "stable"} -snafu = "0.8.5" +plonky2 = { git = "https://github.com/distributed-lab/plonky2", branch = "stable", default-features = false} + +snafu = { version = "0.8.5", default-features = false } [dev-dependencies] -rstest = "0.23.0" \ No newline at end of file +rstest = "0.23.0" + +[features] +default = ["std"] +std = [ + "plonky2/std", + "snafu/std", +] \ No newline at end of file diff --git a/src/lib.rs b/src/lib.rs index dc9b685..cb6859a 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,4 +1,4 @@ -#![no_std] +#![cfg_attr(not(feature = "std"), no_std)] #![doc = include_str!("../README.md")] #![deny(missing_docs)]