From 25445aa4dd4e68d12b6f3a82e89bf82e5617ea26 Mon Sep 17 00:00:00 2001 From: Yehonatan Cohen Scaly Date: Sun, 30 Apr 2023 15:48:31 +0300 Subject: [PATCH 01/11] tmp --- rust-toolchain | 1 + src/uint.rs | 22 ++++++++++++++++++++++ src/uint/convert.rs | 9 +++++++++ 3 files changed, 32 insertions(+) create mode 100644 rust-toolchain create mode 100644 src/uint/convert.rs diff --git a/rust-toolchain b/rust-toolchain new file mode 100644 index 000000000..07ade694b --- /dev/null +++ b/rust-toolchain @@ -0,0 +1 @@ +nightly \ No newline at end of file diff --git a/src/uint.rs b/src/uint.rs index 4dd22fa61..31fff1679 100644 --- a/src/uint.rs +++ b/src/uint.rs @@ -10,6 +10,8 @@ mod concat; #[macro_use] mod split; +#[macro_use] +mod convert; mod add; mod add_mod; @@ -409,6 +411,26 @@ impl_split! { (U8192, 8192) } +impl_convert! { + (U128, 128), + (U256, 256), + (U384, 384), + (U512, 512), + (U640, 640), + (U768, 768), + (U896, 896), + (U1024, 1024), + (U1280, 1280), + (U1536, 1536), + (U1792, 1792), + (U2048, 2048), + (U3072, 3072), + (U3584, 3584), + (U4096, 4096), + (U6144, 6144), + (U8192, 8192) +} + #[cfg(test)] mod tests { use crate::{Encoding, U128}; diff --git a/src/uint/convert.rs b/src/uint/convert.rs new file mode 100644 index 000000000..161819d73 --- /dev/null +++ b/src/uint/convert.rs @@ -0,0 +1,9 @@ +macro_rules! impl_convert { + ($from_name:ident, $to_name:ident, $from_bits:expr, $to_bits:expr) => { + impl $from_name { + pub fn to_$to_name -> $to_name { + todo!() + } + } + }; +} From 9d75ea712dd820d02613954b6e24064417b33d55 Mon Sep 17 00:00:00 2001 From: Yehonatan Cohen Scaly Date: Sun, 30 Apr 2023 18:17:42 +0300 Subject: [PATCH 02/11] tmp --- Cargo.lock | 7 +++++++ Cargo.toml | 1 + src/uint.rs | 35 ++++++++++++++++++----------------- src/uint/convert.rs | 17 +++++++++++------ 4 files changed, 37 insertions(+), 23 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 842f99b2e..2f1da4181 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -236,6 +236,7 @@ dependencies = [ "num-bigint", "num-integer", "num-traits", + "paste", "proptest", "rand_chacha", "rand_core", @@ -504,6 +505,12 @@ version = "6.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9b7820b9daea5457c9f21c69448905d723fbd21136ccf521748f23fd49e723ee" +[[package]] +name = "paste" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f746c4065a8fa3fe23974dd82f15431cc8d40779821001404d10d2e79ca7d79" + [[package]] name = "plotters" version = "0.3.4" diff --git a/Cargo.toml b/Cargo.toml index 525089032..2a68312a6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -18,6 +18,7 @@ rust-version = "1.65" [dependencies] subtle = { version = "2.4", default-features = false } +paste = "1.0.12" # optional dependencies der = { version = "0.7", optional = true, default-features = false } diff --git a/src/uint.rs b/src/uint.rs index 31fff1679..707d87b5c 100644 --- a/src/uint.rs +++ b/src/uint.rs @@ -413,24 +413,25 @@ impl_split! { impl_convert! { (U128, 128), - (U256, 256), - (U384, 384), - (U512, 512), - (U640, 640), - (U768, 768), - (U896, 896), - (U1024, 1024), - (U1280, 1280), - (U1536, 1536), - (U1792, 1792), - (U2048, 2048), - (U3072, 3072), - (U3584, 3584), - (U4096, 4096), - (U6144, 6144), - (U8192, 8192) + ( + (U256, 256), + (U384, 384), + (U512, 512), + (U640, 640), + (U768, 768), + (U896, 896), + (U1024, 1024), + (U1280, 1280), + (U1536, 1536), + (U1792, 1792), + (U2048, 2048), + (U3072, 3072), + (U3584, 3584), + (U4096, 4096), + (U6144, 6144), + (U8192, 8192) + ) } - #[cfg(test)] mod tests { use crate::{Encoding, U128}; diff --git a/src/uint/convert.rs b/src/uint/convert.rs index 161819d73..de353d93d 100644 --- a/src/uint/convert.rs +++ b/src/uint/convert.rs @@ -1,9 +1,14 @@ macro_rules! impl_convert { - ($from_name:ident, $to_name:ident, $from_bits:expr, $to_bits:expr) => { - impl $from_name { - pub fn to_$to_name -> $to_name { - todo!() - } + (($from_type:ident, $from_bits:expr), ($(($target_type:ident, $target_bits:expr)),+ $(,)?)) => { + impl $from_type { + $( + paste::paste! { + pub fn [](&self) -> $target_type { + let a = $target_bits; + unimplemented!() + } + } + )+ } - }; + }; } From 1e993dbd962f439cd1ffb42490ff58f9f21c8505 Mon Sep 17 00:00:00 2001 From: Yehonatan Cohen Scaly Date: Sun, 30 Apr 2023 18:33:18 +0300 Subject: [PATCH 03/11] conversions implemented --- src/uint.rs | 219 ++++++++++++++++++++++++++++++++++++++++++++ src/uint/convert.rs | 32 ++++++- 2 files changed, 247 insertions(+), 4 deletions(-) diff --git a/src/uint.rs b/src/uint.rs index 707d87b5c..f915d5a50 100644 --- a/src/uint.rs +++ b/src/uint.rs @@ -411,6 +411,29 @@ impl_split! { (U8192, 8192) } +impl_convert! { + (U64, 64), + ( + (U128, 128), + (U256, 256), + (U384, 384), + (U512, 512), + (U640, 640), + (U768, 768), + (U896, 896), + (U1024, 1024), + (U1280, 1280), + (U1536, 1536), + (U1792, 1792), + (U2048, 2048), + (U3072, 3072), + (U3584, 3584), + (U4096, 4096), + (U6144, 6144), + (U8192, 8192) + ) +} + impl_convert! { (U128, 128), ( @@ -432,6 +455,202 @@ impl_convert! { (U8192, 8192) ) } + +impl_convert! { + (U256, 256), + ( + (U384, 384), + (U512, 512), + (U640, 640), + (U768, 768), + (U896, 896), + (U1024, 1024), + (U1280, 1280), + (U1536, 1536), + (U1792, 1792), + (U2048, 2048), + (U3072, 3072), + (U3584, 3584), + (U4096, 4096), + (U6144, 6144), + (U8192, 8192) + ) +} + +impl_convert! { + (U384, 384), + ( + (U512, 512), + (U640, 640), + (U768, 768), + (U896, 896), + (U1024, 1024), + (U1280, 1280), + (U1536, 1536), + (U1792, 1792), + (U2048, 2048), + (U3072, 3072), + (U3584, 3584), + (U4096, 4096), + (U6144, 6144), + (U8192, 8192) + ) +} +impl_convert! { + (U512, 512), + ( + (U640, 640), + (U768, 768), + (U896, 896), + (U1024, 1024), + (U1280, 1280), + (U1536, 1536), + (U1792, 1792), + (U2048, 2048), + (U3072, 3072), + (U3584, 3584), + (U4096, 4096), + (U6144, 6144), + (U8192, 8192) + ) +} +impl_convert! { + (U640, 640), + ( + (U768, 768), + (U896, 896), + (U1024, 1024), + (U1280, 1280), + (U1536, 1536), + (U1792, 1792), + (U2048, 2048), + (U3072, 3072), + (U3584, 3584), + (U4096, 4096), + (U6144, 6144), + (U8192, 8192) + ) +} +impl_convert! { + (U768, 768), + ( + (U896, 896), + (U1024, 1024), + (U1280, 1280), + (U1536, 1536), + (U1792, 1792), + (U2048, 2048), + (U3072, 3072), + (U3584, 3584), + (U4096, 4096), + (U6144, 6144), + (U8192, 8192) + ) +} + +impl_convert! { + (U896, 896), + ( + (U1024, 1024), + (U1280, 1280), + (U1536, 1536), + (U1792, 1792), + (U2048, 2048), + (U3072, 3072), + (U3584, 3584), + (U4096, 4096), + (U6144, 6144), + (U8192, 8192) + ) +} + +impl_convert! { + (U1024, 1024), + ( + (U1280, 1280), + (U1536, 1536), + (U1792, 1792), + (U2048, 2048), + (U3072, 3072), + (U3584, 3584), + (U4096, 4096), + (U6144, 6144), + (U8192, 8192) + ) +} + +impl_convert! { + (U1280, 1280), + ( + (U1536, 1536), + (U1792, 1792), + (U2048, 2048), + (U3072, 3072), + (U3584, 3584), + (U4096, 4096), + (U6144, 6144), + (U8192, 8192) + ) +} + +impl_convert! { + (U1536, 1536), + ( + (U1792, 1792), + (U2048, 2048), + (U3072, 3072), + (U3584, 3584), + (U4096, 4096), + (U6144, 6144), + (U8192, 8192) + ) +} + +impl_convert! { + (U2048, 2048), + ( + (U3072, 3072), + (U3584, 3584), + (U4096, 4096), + (U6144, 6144), + (U8192, 8192) + ) +} + +impl_convert! { + (U3072, 3072), + ( + (U3584, 3584), + (U4096, 4096), + (U6144, 6144), + (U8192, 8192) + ) +} + +impl_convert! { + (U3584, 3584), + ( + (U4096, 4096), + (U6144, 6144), + (U8192, 8192) + ) +} + +impl_convert! { + (U4096, 4096), + ( + (U6144, 6144), + (U8192, 8192) + ) +} + +impl_convert! { + (U6144, 6144), + ( + (U8192, 8192) + ) +} + #[cfg(test)] mod tests { use crate::{Encoding, U128}; diff --git a/src/uint/convert.rs b/src/uint/convert.rs index de353d93d..b58607b64 100644 --- a/src/uint/convert.rs +++ b/src/uint/convert.rs @@ -1,14 +1,38 @@ macro_rules! impl_convert { - (($from_type:ident, $from_bits:expr), ($(($target_type:ident, $target_bits:expr)),+ $(,)?)) => { - impl $from_type { + (($source_type:ident, $source_bits:expr), ($(($target_type:ident, $target_bits:expr)),+ $(,)?)) => { + impl $source_type { $( paste::paste! { pub fn [](&self) -> $target_type { - let a = $target_bits; - unimplemented!() + let mut limbs = [Limb::ZERO; nlimbs!($target_bits)]; + let mut i = 0; + + while i < nlimbs!($source_bits) { + limbs[i] = self.limbs[i]; + i += 1; + } + + Uint { limbs } } } )+ } }; } + +#[cfg(test)] +mod tests { + use crate::{U128, U384, U64}; + + #[test] + fn concat_zero_equals_convert() { + let x = U64::from_u64(0x0011223344556677); + + assert_eq!(U64::ZERO.concat(&x), U128::from_u64(0x0011223344556677)); + } + + #[test] + fn converts_non_concatable_types() { + assert_eq!(U384::ONE, U128::ONE.to_u384()); + } +} From cecf1d36974c271a141ce16748f2f9d37d7c4312 Mon Sep 17 00:00:00 2001 From: Yehonatan Cohen Scaly Date: Sun, 30 Apr 2023 18:35:21 +0300 Subject: [PATCH 04/11] delete rust-toolchain --- rust-toolchain | 1 - 1 file changed, 1 deletion(-) delete mode 100644 rust-toolchain diff --git a/rust-toolchain b/rust-toolchain deleted file mode 100644 index 07ade694b..000000000 --- a/rust-toolchain +++ /dev/null @@ -1 +0,0 @@ -nightly \ No newline at end of file From f661aa6687774ef03d0c4191f97a1a469cfdcf8e Mon Sep 17 00:00:00 2001 From: Yehonatan Cohen Scaly Date: Sun, 30 Apr 2023 19:08:53 +0300 Subject: [PATCH 05/11] Switched to From instead of to_uxxx --- src/uint/convert.rs | 48 +++++++++++++++++++++++++++++---------------- 1 file changed, 31 insertions(+), 17 deletions(-) diff --git a/src/uint/convert.rs b/src/uint/convert.rs index b58607b64..406ccafea 100644 --- a/src/uint/convert.rs +++ b/src/uint/convert.rs @@ -1,22 +1,34 @@ macro_rules! impl_convert { (($source_type:ident, $source_bits:expr), ($(($target_type:ident, $target_bits:expr)),+ $(,)?)) => { - impl $source_type { - $( - paste::paste! { - pub fn [](&self) -> $target_type { - let mut limbs = [Limb::ZERO; nlimbs!($target_bits)]; - let mut i = 0; - - while i < nlimbs!($source_bits) { - limbs[i] = self.limbs[i]; - i += 1; - } - - Uint { limbs } + $( + impl From<$source_type> for $target_type { + fn from(x: $source_type) -> Self { + let mut limbs = [Limb::ZERO; nlimbs!($target_bits)]; + let mut i = 0; + + while i < nlimbs!($source_bits) { + limbs[i] = x.limbs[i]; + i += 1; } + + Uint { limbs } + } + } + + impl From<&$source_type> for $target_type { + fn from(x: &$source_type) -> Self { + let mut limbs = [Limb::ZERO; nlimbs!($target_bits)]; + let mut i = 0; + + while i < nlimbs!($source_bits) { + limbs[i] = x.limbs[i]; + i += 1; + } + + Uint { limbs } } - )+ - } + } + )+ }; } @@ -28,11 +40,13 @@ mod tests { fn concat_zero_equals_convert() { let x = U64::from_u64(0x0011223344556677); - assert_eq!(U64::ZERO.concat(&x), U128::from_u64(0x0011223344556677)); + assert_eq!(U128::from(&x), U128::from_u64(0x0011223344556677)); + assert_eq!(U128::from(x), U128::from_u64(0x0011223344556677)); } #[test] fn converts_non_concatable_types() { - assert_eq!(U384::ONE, U128::ONE.to_u384()); + assert_eq!(U384::ONE, U384::from(&U128::ONE)); + assert_eq!(U384::ONE, U384::from(U128::ONE)); } } From 8d6e0e8baec5d40879428db5da1182c20b9fee26 Mon Sep 17 00:00:00 2001 From: Yehonatan Cohen Scaly Date: Sun, 30 Apr 2023 19:10:43 +0300 Subject: [PATCH 06/11] Dropped `paste` dep --- Cargo.lock | 1064 ---------------------------------------------------- Cargo.toml | 1 - 2 files changed, 1065 deletions(-) delete mode 100644 Cargo.lock diff --git a/Cargo.lock b/Cargo.lock deleted file mode 100644 index 2f1da4181..000000000 --- a/Cargo.lock +++ /dev/null @@ -1,1064 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "anes" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b46cbb362ab8752921c97e041f5e366ee6297bd428a31275b9fcf1e380f7299" - -[[package]] -name = "atty" -version = "0.2.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" -dependencies = [ - "hermit-abi 0.1.19", - "libc", - "winapi", -] - -[[package]] -name = "autocfg" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" - -[[package]] -name = "base16ct" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" - -[[package]] -name = "bincode" -version = "1.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad" -dependencies = [ - "serde", -] - -[[package]] -name = "bit-set" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0700ddab506f33b20a03b13996eccd309a48e5ff77d0d95926aa0210fb4e95f1" -dependencies = [ - "bit-vec", -] - -[[package]] -name = "bit-vec" -version = "0.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" - -[[package]] -name = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - -[[package]] -name = "bumpalo" -version = "3.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d261e256854913907f67ed06efbc3338dfe6179796deefc1ff763fc1aee5535" - -[[package]] -name = "byteorder" -version = "1.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" - -[[package]] -name = "bytes" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be" - -[[package]] -name = "cast" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" - -[[package]] -name = "cc" -version = "1.0.79" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f" - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "ciborium" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0c137568cc60b904a7724001b35ce2630fd00d5d84805fbb608ab89509d788f" -dependencies = [ - "ciborium-io", - "ciborium-ll", - "serde", -] - -[[package]] -name = "ciborium-io" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "346de753af073cc87b52b2083a506b38ac176a44cfb05497b622e27be899b369" - -[[package]] -name = "ciborium-ll" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "213030a2b5a4e0c0892b6652260cf6ccac84827b83a85a534e178e3906c4cf1b" -dependencies = [ - "ciborium-io", - "half", -] - -[[package]] -name = "clap" -version = "3.2.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71655c45cb9845d3270c9d6df84ebe72b4dad3c2ba3f7023ad47c144e4e473a5" -dependencies = [ - "bitflags", - "clap_lex", - "indexmap", - "textwrap", -] - -[[package]] -name = "clap_lex" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2850f2f5a82cbf437dd5af4d49848fbdfc27c157c3d010345776f952765261c5" -dependencies = [ - "os_str_bytes", -] - -[[package]] -name = "criterion" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7c76e09c1aae2bc52b3d2f29e13c6572553b30c4aa1b8a49fd70de6412654cb" -dependencies = [ - "anes", - "atty", - "cast", - "ciborium", - "clap", - "criterion-plot", - "itertools", - "lazy_static", - "num-traits", - "oorandom", - "plotters", - "rayon", - "regex", - "serde", - "serde_derive", - "serde_json", - "tinytemplate", - "walkdir", -] - -[[package]] -name = "criterion-plot" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b50826342786a51a89e2da3a28f1c32b06e387201bc2d19791f622c673706b1" -dependencies = [ - "cast", - "itertools", -] - -[[package]] -name = "crossbeam-channel" -version = "0.5.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf2b3e8478797446514c91ef04bafcb59faba183e621ad488df88983cc14128c" -dependencies = [ - "cfg-if", - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-deque" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce6fd6f855243022dcecf8702fef0c297d4338e226845fe067f6341ad9fa0cef" -dependencies = [ - "cfg-if", - "crossbeam-epoch", - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-epoch" -version = "0.9.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46bd5f3f85273295a9d14aedfb86f6aadbff6d8f5295c4a9edb08e819dcf5695" -dependencies = [ - "autocfg", - "cfg-if", - "crossbeam-utils", - "memoffset", - "scopeguard", -] - -[[package]] -name = "crossbeam-utils" -version = "0.8.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c063cd8cc95f5c377ed0d4b49a4b21f632396ff690e8470c29b3359b346984b" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "crypto-bigint" -version = "0.5.2" -dependencies = [ - "bincode", - "criterion", - "der", - "generic-array", - "hex-literal", - "num-bigint", - "num-integer", - "num-traits", - "paste", - "proptest", - "rand_chacha", - "rand_core", - "rlp", - "serdect", - "subtle", - "zeroize", -] - -[[package]] -name = "der" -version = "0.7.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05e58dffcdcc8ee7b22f0c1f71a69243d7c2d9ad87b5a14361f2424a1565c219" - -[[package]] -name = "either" -version = "1.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fcaabb2fef8c910e7f4c7ce9f67a1283a1715879a7c230ca9d6d1ae31f16d91" - -[[package]] -name = "errno" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f639046355ee4f37944e44f60642c6f3a7efa3cf6b78c78a0d989a8ce6c396a1" -dependencies = [ - "errno-dragonfly", - "libc", - "winapi", -] - -[[package]] -name = "errno-dragonfly" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf" -dependencies = [ - "cc", - "libc", -] - -[[package]] -name = "fastrand" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e51093e27b0797c359783294ca4f0a911c270184cb10f85783b118614a1501be" -dependencies = [ - "instant", -] - -[[package]] -name = "fnv" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" - -[[package]] -name = "generic-array" -version = "0.14.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" -dependencies = [ - "typenum", - "version_check", -] - -[[package]] -name = "getrandom" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c05aeb6a22b8f62540c194aac980f2115af067bfe15a0734d7277a768d396b31" -dependencies = [ - "cfg-if", - "libc", - "wasi", -] - -[[package]] -name = "half" -version = "1.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eabb4a44450da02c90444cf74558da904edde8fb4e9035a9a6a4e15445af0bd7" - -[[package]] -name = "hashbrown" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" - -[[package]] -name = "hermit-abi" -version = "0.1.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" -dependencies = [ - "libc", -] - -[[package]] -name = "hermit-abi" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee512640fe35acbfb4bb779db6f0d80704c2cacfa2e39b601ef3e3f47d1ae4c7" -dependencies = [ - "libc", -] - -[[package]] -name = "hex-literal" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" - -[[package]] -name = "indexmap" -version = "1.9.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1885e79c1fc4b10f0e172c475f458b7f7b93061064d98c3293e98c5ba0c8b399" -dependencies = [ - "autocfg", - "hashbrown", -] - -[[package]] -name = "instant" -version = "0.1.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "io-lifetimes" -version = "1.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1abeb7a0dd0f8181267ff8adc397075586500b81b28a73e8a0208b00fc170fb3" -dependencies = [ - "libc", - "windows-sys 0.45.0", -] - -[[package]] -name = "itertools" -version = "0.10.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" -dependencies = [ - "either", -] - -[[package]] -name = "itoa" -version = "1.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fad582f4b9e86b6caa621cabeb0963332d92eea04729ab12892c2533951e6440" - -[[package]] -name = "js-sys" -version = "0.3.61" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "445dde2150c55e483f3d8416706b97ec8e8237c307e5b7b4b8dd15e6af2a0730" -dependencies = [ - "wasm-bindgen", -] - -[[package]] -name = "lazy_static" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" - -[[package]] -name = "libc" -version = "0.2.139" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "201de327520df007757c1f0adce6e827fe8562fbc28bfd9c15571c66ca1f5f79" - -[[package]] -name = "libm" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "348108ab3fba42ec82ff6e9564fc4ca0247bdccdc68dd8af9764bbc79c3c8ffb" - -[[package]] -name = "linux-raw-sys" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f051f77a7c8e6957c0696eac88f26b0117e54f52d3fc682ab19397a8812846a4" - -[[package]] -name = "log" -version = "0.4.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "memoffset" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d61c719bcfbcf5d62b3a09efa6088de8c54bc0bfcd3ea7ae39fcc186108b8de1" -dependencies = [ - "autocfg", -] - -[[package]] -name = "num-bigint" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f93ab6289c7b344a8a9f60f88d80aa20032336fe78da341afc91c8a2341fc75f" -dependencies = [ - "autocfg", - "num-integer", - "num-traits", -] - -[[package]] -name = "num-integer" -version = "0.1.45" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" -dependencies = [ - "autocfg", - "num-traits", -] - -[[package]] -name = "num-traits" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" -dependencies = [ - "autocfg", - "libm", -] - -[[package]] -name = "num_cpus" -version = "1.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fac9e2da13b5eb447a6ce3d392f23a29d8694bff781bf03a16cd9ac8697593b" -dependencies = [ - "hermit-abi 0.2.6", - "libc", -] - -[[package]] -name = "once_cell" -version = "1.17.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7e5500299e16ebb147ae15a00a942af264cf3688f47923b8fc2cd5858f23ad3" - -[[package]] -name = "oorandom" -version = "11.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ab1bc2a289d34bd04a330323ac98a1b4bc82c9d9fcb1e66b63caa84da26b575" - -[[package]] -name = "os_str_bytes" -version = "6.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b7820b9daea5457c9f21c69448905d723fbd21136ccf521748f23fd49e723ee" - -[[package]] -name = "paste" -version = "1.0.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f746c4065a8fa3fe23974dd82f15431cc8d40779821001404d10d2e79ca7d79" - -[[package]] -name = "plotters" -version = "0.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2538b639e642295546c50fcd545198c9d64ee2a38620a628724a3b266d5fbf97" -dependencies = [ - "num-traits", - "plotters-backend", - "plotters-svg", - "wasm-bindgen", - "web-sys", -] - -[[package]] -name = "plotters-backend" -version = "0.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "193228616381fecdc1224c62e96946dfbc73ff4384fba576e052ff8c1bea8142" - -[[package]] -name = "plotters-svg" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9a81d2759aae1dae668f783c308bc5c8ebd191ff4184aaa1b37f65a6ae5a56f" -dependencies = [ - "plotters-backend", -] - -[[package]] -name = "ppv-lite86" -version = "0.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" - -[[package]] -name = "proc-macro2" -version = "1.0.51" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d727cae5b39d21da60fa540906919ad737832fe0b1c165da3a34d6548c849d6" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "proptest" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29f1b898011ce9595050a68e60f90bad083ff2987a695a42357134c8381fba70" -dependencies = [ - "bit-set", - "bitflags", - "byteorder", - "lazy_static", - "num-traits", - "quick-error 2.0.1", - "rand", - "rand_chacha", - "rand_xorshift", - "regex-syntax", - "rusty-fork", - "tempfile", - "unarray", -] - -[[package]] -name = "quick-error" -version = "1.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" - -[[package]] -name = "quick-error" -version = "2.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a993555f31e5a609f617c12db6250dedcac1b0a85076912c436e6fc9b2c8e6a3" - -[[package]] -name = "quote" -version = "1.0.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8856d8364d252a14d474036ea1358d63c9e6965c8e5c1885c18f73d70bff9c7b" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "rand" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" -dependencies = [ - "libc", - "rand_chacha", - "rand_core", -] - -[[package]] -name = "rand_chacha" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" -dependencies = [ - "ppv-lite86", - "rand_core", -] - -[[package]] -name = "rand_core" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" -dependencies = [ - "getrandom", -] - -[[package]] -name = "rand_xorshift" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d25bf25ec5ae4a3f1b92f929810509a2f53d7dca2f50b794ff57e3face536c8f" -dependencies = [ - "rand_core", -] - -[[package]] -name = "rayon" -version = "1.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6db3a213adf02b3bcfd2d3846bb41cb22857d131789e01df434fb7e7bc0759b7" -dependencies = [ - "either", - "rayon-core", -] - -[[package]] -name = "rayon-core" -version = "1.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "356a0625f1954f730c0201cdab48611198dc6ce21f4acff55089b5a78e6e835b" -dependencies = [ - "crossbeam-channel", - "crossbeam-deque", - "crossbeam-utils", - "num_cpus", -] - -[[package]] -name = "redox_syscall" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" -dependencies = [ - "bitflags", -] - -[[package]] -name = "regex" -version = "1.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48aaa5748ba571fb95cd2c85c09f629215d3a6ece942baa100950af03a34f733" -dependencies = [ - "regex-syntax", -] - -[[package]] -name = "regex-syntax" -version = "0.6.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "456c603be3e8d448b072f410900c09faf164fbce2d480456f50eea6e25f9c848" - -[[package]] -name = "rlp" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb919243f34364b6bd2fc10ef797edbfa75f33c252e7998527479c6d6b47e1ec" -dependencies = [ - "bytes", - "rustc-hex", -] - -[[package]] -name = "rustc-hex" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e75f6a532d0fd9f7f13144f392b6ad56a32696bfcd9c78f797f16bbb6f072d6" - -[[package]] -name = "rustix" -version = "0.36.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f43abb88211988493c1abb44a70efa56ff0ce98f233b7b276146f1f3f7ba9644" -dependencies = [ - "bitflags", - "errno", - "io-lifetimes", - "libc", - "linux-raw-sys", - "windows-sys 0.45.0", -] - -[[package]] -name = "rusty-fork" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb3dcc6e454c328bb824492db107ab7c0ae8fcffe4ad210136ef014458c1bc4f" -dependencies = [ - "fnv", - "quick-error 1.2.3", - "tempfile", - "wait-timeout", -] - -[[package]] -name = "ryu" -version = "1.0.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b4b9743ed687d4b4bcedf9ff5eaa7398495ae14e61cba0a295704edbc7decde" - -[[package]] -name = "same-file" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" -dependencies = [ - "winapi-util", -] - -[[package]] -name = "scopeguard" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" - -[[package]] -name = "serde" -version = "1.0.152" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb7d1f0d3021d347a83e556fc4683dea2ea09d87bccdf88ff5c12545d89d5efb" -dependencies = [ - "serde_derive", -] - -[[package]] -name = "serde_derive" -version = "1.0.152" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af487d118eecd09402d70a5d72551860e788df87b464af30e5ea6a38c75c541e" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "serde_json" -version = "1.0.93" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cad406b69c91885b5107daf2c29572f6c8cdb3c66826821e286c533490c0bc76" -dependencies = [ - "itoa", - "ryu", - "serde", -] - -[[package]] -name = "serdect" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a84f14a19e9a014bb9f4512488d9829a68e04ecabffb0f9904cd1ace94598177" -dependencies = [ - "base16ct", - "serde", -] - -[[package]] -name = "subtle" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" - -[[package]] -name = "syn" -version = "1.0.109" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "tempfile" -version = "3.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af18f7ae1acd354b992402e9ec5864359d693cd8a79dcbef59f76891701c1e95" -dependencies = [ - "cfg-if", - "fastrand", - "redox_syscall", - "rustix", - "windows-sys 0.42.0", -] - -[[package]] -name = "textwrap" -version = "0.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "222a222a5bfe1bba4a77b45ec488a741b3cb8872e5e499451fd7d0129c9c7c3d" - -[[package]] -name = "tinytemplate" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be4d6b5f19ff7664e8c98d03e2139cb510db9b0a60b55f8e8709b689d939b6bc" -dependencies = [ - "serde", - "serde_json", -] - -[[package]] -name = "typenum" -version = "1.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" - -[[package]] -name = "unarray" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eaea85b334db583fe3274d12b4cd1880032beab409c0d774be044d4480ab9a94" - -[[package]] -name = "unicode-ident" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84a22b9f218b40614adcb3f4ff08b703773ad44fa9423e4e0d346d5db86e4ebc" - -[[package]] -name = "version_check" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" - -[[package]] -name = "wait-timeout" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f200f5b12eb75f8c1ed65abd4b2db8a6e1b138a20de009dacee265a2498f3f6" -dependencies = [ - "libc", -] - -[[package]] -name = "walkdir" -version = "2.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "808cf2735cd4b6866113f648b791c6adc5714537bc222d9347bb203386ffda56" -dependencies = [ - "same-file", - "winapi", - "winapi-util", -] - -[[package]] -name = "wasi" -version = "0.11.0+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" - -[[package]] -name = "wasm-bindgen" -version = "0.2.84" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31f8dcbc21f30d9b8f2ea926ecb58f6b91192c17e9d33594b3df58b2007ca53b" -dependencies = [ - "cfg-if", - "wasm-bindgen-macro", -] - -[[package]] -name = "wasm-bindgen-backend" -version = "0.2.84" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95ce90fd5bcc06af55a641a86428ee4229e44e07033963a2290a8e241607ccb9" -dependencies = [ - "bumpalo", - "log", - "once_cell", - "proc-macro2", - "quote", - "syn", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-macro" -version = "0.2.84" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c21f77c0bedc37fd5dc21f897894a5ca01e7bb159884559461862ae90c0b4c5" -dependencies = [ - "quote", - "wasm-bindgen-macro-support", -] - -[[package]] -name = "wasm-bindgen-macro-support" -version = "0.2.84" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2aff81306fcac3c7515ad4e177f521b5c9a15f2b08f4e32d823066102f35a5f6" -dependencies = [ - "proc-macro2", - "quote", - "syn", - "wasm-bindgen-backend", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-shared" -version = "0.2.84" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0046fef7e28c3804e5e38bfa31ea2a0f73905319b677e57ebe37e49358989b5d" - -[[package]] -name = "web-sys" -version = "0.3.61" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e33b99f4b23ba3eec1a53ac264e35a755f00e966e0065077d6027c0f575b0b97" -dependencies = [ - "js-sys", - "wasm-bindgen", -] - -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-util" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" -dependencies = [ - "winapi", -] - -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" - -[[package]] -name = "windows-sys" -version = "0.42.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" -dependencies = [ - "windows_aarch64_gnullvm", - "windows_aarch64_msvc", - "windows_i686_gnu", - "windows_i686_msvc", - "windows_x86_64_gnu", - "windows_x86_64_gnullvm", - "windows_x86_64_msvc", -] - -[[package]] -name = "windows-sys" -version = "0.45.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" -dependencies = [ - "windows-targets", -] - -[[package]] -name = "windows-targets" -version = "0.42.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e2522491fbfcd58cc84d47aeb2958948c4b8982e9a2d8a2a35bbaed431390e7" -dependencies = [ - "windows_aarch64_gnullvm", - "windows_aarch64_msvc", - "windows_i686_gnu", - "windows_i686_msvc", - "windows_x86_64_gnu", - "windows_x86_64_gnullvm", - "windows_x86_64_msvc", -] - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.42.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c9864e83243fdec7fc9c5444389dcbbfd258f745e7853198f365e3c4968a608" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.42.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c8b1b673ffc16c47a9ff48570a9d85e25d265735c503681332589af6253c6c7" - -[[package]] -name = "windows_i686_gnu" -version = "0.42.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de3887528ad530ba7bdbb1faa8275ec7a1155a45ffa57c37993960277145d640" - -[[package]] -name = "windows_i686_msvc" -version = "0.42.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf4d1122317eddd6ff351aa852118a2418ad4214e6613a50e0191f7004372605" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.42.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1040f221285e17ebccbc2591ffdc2d44ee1f9186324dd3e84e99ac68d699c45" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.42.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "628bfdf232daa22b0d64fdb62b09fcc36bb01f05a3939e20ab73aaf9470d0463" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.42.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "447660ad36a13288b1db4d4248e857b510e8c3a225c822ba4fb748c0aafecffd" - -[[package]] -name = "zeroize" -version = "1.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a0956f1ba7c7909bfb66c2e9e4124ab6f6482560f6628b5aaeba39207c9aad9" diff --git a/Cargo.toml b/Cargo.toml index 2a68312a6..525089032 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -18,7 +18,6 @@ rust-version = "1.65" [dependencies] subtle = { version = "2.4", default-features = false } -paste = "1.0.12" # optional dependencies der = { version = "0.7", optional = true, default-features = false } From 94622a4f0a558f4966efa7b87261e41034028395 Mon Sep 17 00:00:00 2001 From: Yehonatan Cohen Scaly Date: Sun, 30 Apr 2023 19:48:13 +0300 Subject: [PATCH 07/11] added Cargo.lock back --- Cargo.lock | 1131 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 1131 insertions(+) create mode 100644 Cargo.lock diff --git a/Cargo.lock b/Cargo.lock new file mode 100644 index 000000000..c21713d7e --- /dev/null +++ b/Cargo.lock @@ -0,0 +1,1131 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "anes" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b46cbb362ab8752921c97e041f5e366ee6297bd428a31275b9fcf1e380f7299" + +[[package]] +name = "atty" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" +dependencies = [ + "hermit-abi 0.1.19", + "libc", + "winapi", +] + +[[package]] +name = "autocfg" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" + +[[package]] +name = "base16ct" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" + +[[package]] +name = "bincode" +version = "1.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad" +dependencies = [ + "serde", +] + +[[package]] +name = "bit-set" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0700ddab506f33b20a03b13996eccd309a48e5ff77d0d95926aa0210fb4e95f1" +dependencies = [ + "bit-vec", +] + +[[package]] +name = "bit-vec" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "bumpalo" +version = "3.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b1ce199063694f33ffb7dd4e0ee620741495c32833cde5aa08f02a0bf96f0c8" + +[[package]] +name = "byteorder" +version = "1.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" + +[[package]] +name = "bytes" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be" + +[[package]] +name = "cast" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" + +[[package]] +name = "cc" +version = "1.0.79" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f" + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "ciborium" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0c137568cc60b904a7724001b35ce2630fd00d5d84805fbb608ab89509d788f" +dependencies = [ + "ciborium-io", + "ciborium-ll", + "serde", +] + +[[package]] +name = "ciborium-io" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "346de753af073cc87b52b2083a506b38ac176a44cfb05497b622e27be899b369" + +[[package]] +name = "ciborium-ll" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "213030a2b5a4e0c0892b6652260cf6ccac84827b83a85a534e178e3906c4cf1b" +dependencies = [ + "ciborium-io", + "half", +] + +[[package]] +name = "clap" +version = "3.2.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ea181bf566f71cb9a5d17a59e1871af638180a18fb0035c92ae62b705207123" +dependencies = [ + "bitflags", + "clap_lex", + "indexmap", + "textwrap", +] + +[[package]] +name = "clap_lex" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2850f2f5a82cbf437dd5af4d49848fbdfc27c157c3d010345776f952765261c5" +dependencies = [ + "os_str_bytes", +] + +[[package]] +name = "criterion" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7c76e09c1aae2bc52b3d2f29e13c6572553b30c4aa1b8a49fd70de6412654cb" +dependencies = [ + "anes", + "atty", + "cast", + "ciborium", + "clap", + "criterion-plot", + "itertools", + "lazy_static", + "num-traits", + "oorandom", + "plotters", + "rayon", + "regex", + "serde", + "serde_derive", + "serde_json", + "tinytemplate", + "walkdir", +] + +[[package]] +name = "criterion-plot" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b50826342786a51a89e2da3a28f1c32b06e387201bc2d19791f622c673706b1" +dependencies = [ + "cast", + "itertools", +] + +[[package]] +name = "crossbeam-channel" +version = "0.5.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a33c2bf77f2df06183c3aa30d1e96c0695a313d4f9c453cc3762a6db39f99200" +dependencies = [ + "cfg-if", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-deque" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce6fd6f855243022dcecf8702fef0c297d4338e226845fe067f6341ad9fa0cef" +dependencies = [ + "cfg-if", + "crossbeam-epoch", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.9.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46bd5f3f85273295a9d14aedfb86f6aadbff6d8f5295c4a9edb08e819dcf5695" +dependencies = [ + "autocfg", + "cfg-if", + "crossbeam-utils", + "memoffset", + "scopeguard", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c063cd8cc95f5c377ed0d4b49a4b21f632396ff690e8470c29b3359b346984b" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "crypto-bigint" +version = "0.5.2" +dependencies = [ + "bincode", + "criterion", + "der", + "generic-array", + "hex-literal", + "num-bigint", + "num-integer", + "num-traits", + "proptest", + "rand_chacha", + "rand_core", + "rlp", + "serdect", + "subtle", + "zeroize", +] + +[[package]] +name = "der" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05e58dffcdcc8ee7b22f0c1f71a69243d7c2d9ad87b5a14361f2424a1565c219" + +[[package]] +name = "either" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fcaabb2fef8c910e7f4c7ce9f67a1283a1715879a7c230ca9d6d1ae31f16d91" + +[[package]] +name = "errno" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4bcfec3a70f97c962c307b2d2c56e358cf1d00b558d74262b5f929ee8cc7e73a" +dependencies = [ + "errno-dragonfly", + "libc", + "windows-sys 0.48.0", +] + +[[package]] +name = "errno-dragonfly" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf" +dependencies = [ + "cc", + "libc", +] + +[[package]] +name = "fastrand" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e51093e27b0797c359783294ca4f0a911c270184cb10f85783b118614a1501be" +dependencies = [ + "instant", +] + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", +] + +[[package]] +name = "getrandom" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c85e1d9ab2eadba7e5040d4e09cbd6d072b76a557ad64e797c2cb9d4da21d7e4" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] + +[[package]] +name = "half" +version = "1.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eabb4a44450da02c90444cf74558da904edde8fb4e9035a9a6a4e15445af0bd7" + +[[package]] +name = "hashbrown" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" + +[[package]] +name = "hermit-abi" +version = "0.1.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" +dependencies = [ + "libc", +] + +[[package]] +name = "hermit-abi" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee512640fe35acbfb4bb779db6f0d80704c2cacfa2e39b601ef3e3f47d1ae4c7" +dependencies = [ + "libc", +] + +[[package]] +name = "hermit-abi" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fed44880c466736ef9a5c5b5facefb5ed0785676d0c02d612db14e54f0d84286" + +[[package]] +name = "hex-literal" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" + +[[package]] +name = "indexmap" +version = "1.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" +dependencies = [ + "autocfg", + "hashbrown", +] + +[[package]] +name = "instant" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "io-lifetimes" +version = "1.0.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c66c74d2ae7e79a5a8f7ac924adbe38ee42a859c6539ad869eb51f0b52dc220" +dependencies = [ + "hermit-abi 0.3.1", + "libc", + "windows-sys 0.48.0", +] + +[[package]] +name = "itertools" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +dependencies = [ + "either", +] + +[[package]] +name = "itoa" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "453ad9f582a441959e5f0d088b02ce04cfe8d51a8eaf077f12ac6d3e94164ca6" + +[[package]] +name = "js-sys" +version = "0.3.61" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "445dde2150c55e483f3d8416706b97ec8e8237c307e5b7b4b8dd15e6af2a0730" +dependencies = [ + "wasm-bindgen", +] + +[[package]] +name = "lazy_static" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" + +[[package]] +name = "libc" +version = "0.2.142" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a987beff54b60ffa6d51982e1aa1146bc42f19bd26be28b0586f252fccf5317" + +[[package]] +name = "libm" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "348108ab3fba42ec82ff6e9564fc4ca0247bdccdc68dd8af9764bbc79c3c8ffb" + +[[package]] +name = "linux-raw-sys" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b64f40e5e03e0d54f03845c8197d0291253cdbedfb1cb46b13c2c117554a9f4c" + +[[package]] +name = "log" +version = "0.4.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "memoffset" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d61c719bcfbcf5d62b3a09efa6088de8c54bc0bfcd3ea7ae39fcc186108b8de1" +dependencies = [ + "autocfg", +] + +[[package]] +name = "num-bigint" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f93ab6289c7b344a8a9f60f88d80aa20032336fe78da341afc91c8a2341fc75f" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-integer" +version = "0.1.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" +dependencies = [ + "autocfg", + "num-traits", +] + +[[package]] +name = "num-traits" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" +dependencies = [ + "autocfg", + "libm", +] + +[[package]] +name = "num_cpus" +version = "1.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fac9e2da13b5eb447a6ce3d392f23a29d8694bff781bf03a16cd9ac8697593b" +dependencies = [ + "hermit-abi 0.2.6", + "libc", +] + +[[package]] +name = "once_cell" +version = "1.17.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7e5500299e16ebb147ae15a00a942af264cf3688f47923b8fc2cd5858f23ad3" + +[[package]] +name = "oorandom" +version = "11.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ab1bc2a289d34bd04a330323ac98a1b4bc82c9d9fcb1e66b63caa84da26b575" + +[[package]] +name = "os_str_bytes" +version = "6.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ceedf44fb00f2d1984b0bc98102627ce622e083e49a5bacdb3e514fa4238e267" + +[[package]] +name = "plotters" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2538b639e642295546c50fcd545198c9d64ee2a38620a628724a3b266d5fbf97" +dependencies = [ + "num-traits", + "plotters-backend", + "plotters-svg", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "plotters-backend" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "193228616381fecdc1224c62e96946dfbc73ff4384fba576e052ff8c1bea8142" + +[[package]] +name = "plotters-svg" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9a81d2759aae1dae668f783c308bc5c8ebd191ff4184aaa1b37f65a6ae5a56f" +dependencies = [ + "plotters-backend", +] + +[[package]] +name = "ppv-lite86" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" + +[[package]] +name = "proc-macro2" +version = "1.0.56" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b63bdb0cd06f1f4dedf69b254734f9b45af66e4a031e42a7480257d9898b435" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "proptest" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29f1b898011ce9595050a68e60f90bad083ff2987a695a42357134c8381fba70" +dependencies = [ + "bit-set", + "bitflags", + "byteorder", + "lazy_static", + "num-traits", + "quick-error 2.0.1", + "rand", + "rand_chacha", + "rand_xorshift", + "regex-syntax 0.6.29", + "rusty-fork", + "tempfile", + "unarray", +] + +[[package]] +name = "quick-error" +version = "1.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" + +[[package]] +name = "quick-error" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a993555f31e5a609f617c12db6250dedcac1b0a85076912c436e6fc9b2c8e6a3" + +[[package]] +name = "quote" +version = "1.0.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4424af4bf778aae2051a77b60283332f386554255d722233d09fbfc7e30da2fc" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha", + "rand_core", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom", +] + +[[package]] +name = "rand_xorshift" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d25bf25ec5ae4a3f1b92f929810509a2f53d7dca2f50b794ff57e3face536c8f" +dependencies = [ + "rand_core", +] + +[[package]] +name = "rayon" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d2df5196e37bcc87abebc0053e20787d73847bb33134a69841207dd0a47f03b" +dependencies = [ + "either", + "rayon-core", +] + +[[package]] +name = "rayon-core" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b8f95bd6966f5c87776639160a66bd8ab9895d9d4ab01ddba9fc60661aebe8d" +dependencies = [ + "crossbeam-channel", + "crossbeam-deque", + "crossbeam-utils", + "num_cpus", +] + +[[package]] +name = "redox_syscall" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" +dependencies = [ + "bitflags", +] + +[[package]] +name = "regex" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af83e617f331cc6ae2da5443c602dfa5af81e517212d9d611a5b3ba1777b5370" +dependencies = [ + "regex-syntax 0.7.1", +] + +[[package]] +name = "regex-syntax" +version = "0.6.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" + +[[package]] +name = "regex-syntax" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5996294f19bd3aae0453a862ad728f60e6600695733dd5df01da90c54363a3c" + +[[package]] +name = "rlp" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb919243f34364b6bd2fc10ef797edbfa75f33c252e7998527479c6d6b47e1ec" +dependencies = [ + "bytes", + "rustc-hex", +] + +[[package]] +name = "rustc-hex" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e75f6a532d0fd9f7f13144f392b6ad56a32696bfcd9c78f797f16bbb6f072d6" + +[[package]] +name = "rustix" +version = "0.37.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8bbfc1d1c7c40c01715f47d71444744a81669ca84e8b63e25a55e169b1f86433" +dependencies = [ + "bitflags", + "errno", + "io-lifetimes", + "libc", + "linux-raw-sys", + "windows-sys 0.48.0", +] + +[[package]] +name = "rusty-fork" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb3dcc6e454c328bb824492db107ab7c0ae8fcffe4ad210136ef014458c1bc4f" +dependencies = [ + "fnv", + "quick-error 1.2.3", + "tempfile", + "wait-timeout", +] + +[[package]] +name = "ryu" +version = "1.0.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f91339c0467de62360649f8d3e185ca8de4224ff281f66000de5eb2a77a79041" + +[[package]] +name = "same-file" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "scopeguard" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" + +[[package]] +name = "serde" +version = "1.0.160" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb2f3770c8bce3bcda7e149193a069a0f4365bda1fa5cd88e03bca26afc1216c" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.160" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "291a097c63d8497e00160b166a967a4a79c64f3facdd01cbd7502231688d77df" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.15", +] + +[[package]] +name = "serde_json" +version = "1.0.96" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "057d394a50403bcac12672b2b18fb387ab6d289d957dab67dd201875391e52f1" +dependencies = [ + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "serdect" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a84f14a19e9a014bb9f4512488d9829a68e04ecabffb0f9904cd1ace94598177" +dependencies = [ + "base16ct", + "serde", +] + +[[package]] +name = "subtle" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" + +[[package]] +name = "syn" +version = "1.0.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "2.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a34fcf3e8b60f57e6a14301a2e916d323af98b0ea63c599441eec8558660c822" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "tempfile" +version = "3.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9fbec84f381d5795b08656e4912bec604d162bff9291d6189a78f4c8ab87998" +dependencies = [ + "cfg-if", + "fastrand", + "redox_syscall", + "rustix", + "windows-sys 0.45.0", +] + +[[package]] +name = "textwrap" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "222a222a5bfe1bba4a77b45ec488a741b3cb8872e5e499451fd7d0129c9c7c3d" + +[[package]] +name = "tinytemplate" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be4d6b5f19ff7664e8c98d03e2139cb510db9b0a60b55f8e8709b689d939b6bc" +dependencies = [ + "serde", + "serde_json", +] + +[[package]] +name = "typenum" +version = "1.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" + +[[package]] +name = "unarray" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eaea85b334db583fe3274d12b4cd1880032beab409c0d774be044d4480ab9a94" + +[[package]] +name = "unicode-ident" +version = "1.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5464a87b239f13a63a501f2701565754bae92d243d4bb7eb12f6d57d2269bf4" + +[[package]] +name = "version_check" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" + +[[package]] +name = "wait-timeout" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f200f5b12eb75f8c1ed65abd4b2db8a6e1b138a20de009dacee265a2498f3f6" +dependencies = [ + "libc", +] + +[[package]] +name = "walkdir" +version = "2.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36df944cda56c7d8d8b7496af378e6b16de9284591917d307c9b4d313c44e698" +dependencies = [ + "same-file", + "winapi-util", +] + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + +[[package]] +name = "wasm-bindgen" +version = "0.2.84" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31f8dcbc21f30d9b8f2ea926ecb58f6b91192c17e9d33594b3df58b2007ca53b" +dependencies = [ + "cfg-if", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.84" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95ce90fd5bcc06af55a641a86428ee4229e44e07033963a2290a8e241607ccb9" +dependencies = [ + "bumpalo", + "log", + "once_cell", + "proc-macro2", + "quote", + "syn 1.0.109", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.84" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c21f77c0bedc37fd5dc21f897894a5ca01e7bb159884559461862ae90c0b4c5" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.84" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2aff81306fcac3c7515ad4e177f521b5c9a15f2b08f4e32d823066102f35a5f6" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.84" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0046fef7e28c3804e5e38bfa31ea2a0f73905319b677e57ebe37e49358989b5d" + +[[package]] +name = "web-sys" +version = "0.3.61" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e33b99f4b23ba3eec1a53ac264e35a755f00e966e0065077d6027c0f575b0b97" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-util" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" +dependencies = [ + "winapi", +] + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "windows-sys" +version = "0.45.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" +dependencies = [ + "windows-targets 0.42.2", +] + +[[package]] +name = "windows-sys" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +dependencies = [ + "windows-targets 0.48.0", +] + +[[package]] +name = "windows-targets" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" +dependencies = [ + "windows_aarch64_gnullvm 0.42.2", + "windows_aarch64_msvc 0.42.2", + "windows_i686_gnu 0.42.2", + "windows_i686_msvc 0.42.2", + "windows_x86_64_gnu 0.42.2", + "windows_x86_64_gnullvm 0.42.2", + "windows_x86_64_msvc 0.42.2", +] + +[[package]] +name = "windows-targets" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b1eb6f0cd7c80c79759c929114ef071b87354ce476d9d94271031c0497adfd5" +dependencies = [ + "windows_aarch64_gnullvm 0.48.0", + "windows_aarch64_msvc 0.48.0", + "windows_i686_gnu 0.48.0", + "windows_i686_msvc 0.48.0", + "windows_x86_64_gnu 0.48.0", + "windows_x86_64_gnullvm 0.48.0", + "windows_x86_64_msvc 0.48.0", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3" + +[[package]] +name = "windows_i686_gnu" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" + +[[package]] +name = "windows_i686_gnu" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241" + +[[package]] +name = "windows_i686_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" + +[[package]] +name = "windows_i686_msvc" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" + +[[package]] +name = "zeroize" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a0956f1ba7c7909bfb66c2e9e4124ab6f6482560f6628b5aaeba39207c9aad9" From 443998f0c39f3995be98cb59dd2fecd605c1e9e3 Mon Sep 17 00:00:00 2001 From: Yehonatan Cohen Scaly Date: Sun, 7 May 2023 16:24:14 +0300 Subject: [PATCH 08/11] feature-gated --- Cargo.toml | 1 + src/uint.rs | 245 +-------------------- src/uint/convert.rs | 52 ----- src/uint/extra_trait_impls/convert.rs | 302 ++++++++++++++++++++++++++ 4 files changed, 306 insertions(+), 294 deletions(-) delete mode 100644 src/uint/convert.rs create mode 100644 src/uint/extra_trait_impls/convert.rs diff --git a/Cargo.toml b/Cargo.toml index 525089032..c35b3f39c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -43,6 +43,7 @@ default = ["rand"] alloc = [] rand = ["rand_core/std"] serde = ["dep:serdect"] +extra-trait-impls = [] [package.metadata.docs.rs] all-features = true diff --git a/src/uint.rs b/src/uint.rs index f915d5a50..9c9a4c6d0 100644 --- a/src/uint.rs +++ b/src/uint.rs @@ -10,8 +10,6 @@ mod concat; #[macro_use] mod split; -#[macro_use] -mod convert; mod add; mod add_mod; @@ -46,6 +44,9 @@ mod array; #[cfg(feature = "rand_core")] mod rand; +#[cfg(feature = "extra-trait-impls")] +mod extra_trait_impls; + use crate::{Bounded, Concat, Encoding, Integer, Limb, Split, Word, Zero}; use core::fmt; use subtle::{Choice, ConditionallySelectable}; @@ -411,246 +412,6 @@ impl_split! { (U8192, 8192) } -impl_convert! { - (U64, 64), - ( - (U128, 128), - (U256, 256), - (U384, 384), - (U512, 512), - (U640, 640), - (U768, 768), - (U896, 896), - (U1024, 1024), - (U1280, 1280), - (U1536, 1536), - (U1792, 1792), - (U2048, 2048), - (U3072, 3072), - (U3584, 3584), - (U4096, 4096), - (U6144, 6144), - (U8192, 8192) - ) -} - -impl_convert! { - (U128, 128), - ( - (U256, 256), - (U384, 384), - (U512, 512), - (U640, 640), - (U768, 768), - (U896, 896), - (U1024, 1024), - (U1280, 1280), - (U1536, 1536), - (U1792, 1792), - (U2048, 2048), - (U3072, 3072), - (U3584, 3584), - (U4096, 4096), - (U6144, 6144), - (U8192, 8192) - ) -} - -impl_convert! { - (U256, 256), - ( - (U384, 384), - (U512, 512), - (U640, 640), - (U768, 768), - (U896, 896), - (U1024, 1024), - (U1280, 1280), - (U1536, 1536), - (U1792, 1792), - (U2048, 2048), - (U3072, 3072), - (U3584, 3584), - (U4096, 4096), - (U6144, 6144), - (U8192, 8192) - ) -} - -impl_convert! { - (U384, 384), - ( - (U512, 512), - (U640, 640), - (U768, 768), - (U896, 896), - (U1024, 1024), - (U1280, 1280), - (U1536, 1536), - (U1792, 1792), - (U2048, 2048), - (U3072, 3072), - (U3584, 3584), - (U4096, 4096), - (U6144, 6144), - (U8192, 8192) - ) -} -impl_convert! { - (U512, 512), - ( - (U640, 640), - (U768, 768), - (U896, 896), - (U1024, 1024), - (U1280, 1280), - (U1536, 1536), - (U1792, 1792), - (U2048, 2048), - (U3072, 3072), - (U3584, 3584), - (U4096, 4096), - (U6144, 6144), - (U8192, 8192) - ) -} -impl_convert! { - (U640, 640), - ( - (U768, 768), - (U896, 896), - (U1024, 1024), - (U1280, 1280), - (U1536, 1536), - (U1792, 1792), - (U2048, 2048), - (U3072, 3072), - (U3584, 3584), - (U4096, 4096), - (U6144, 6144), - (U8192, 8192) - ) -} -impl_convert! { - (U768, 768), - ( - (U896, 896), - (U1024, 1024), - (U1280, 1280), - (U1536, 1536), - (U1792, 1792), - (U2048, 2048), - (U3072, 3072), - (U3584, 3584), - (U4096, 4096), - (U6144, 6144), - (U8192, 8192) - ) -} - -impl_convert! { - (U896, 896), - ( - (U1024, 1024), - (U1280, 1280), - (U1536, 1536), - (U1792, 1792), - (U2048, 2048), - (U3072, 3072), - (U3584, 3584), - (U4096, 4096), - (U6144, 6144), - (U8192, 8192) - ) -} - -impl_convert! { - (U1024, 1024), - ( - (U1280, 1280), - (U1536, 1536), - (U1792, 1792), - (U2048, 2048), - (U3072, 3072), - (U3584, 3584), - (U4096, 4096), - (U6144, 6144), - (U8192, 8192) - ) -} - -impl_convert! { - (U1280, 1280), - ( - (U1536, 1536), - (U1792, 1792), - (U2048, 2048), - (U3072, 3072), - (U3584, 3584), - (U4096, 4096), - (U6144, 6144), - (U8192, 8192) - ) -} - -impl_convert! { - (U1536, 1536), - ( - (U1792, 1792), - (U2048, 2048), - (U3072, 3072), - (U3584, 3584), - (U4096, 4096), - (U6144, 6144), - (U8192, 8192) - ) -} - -impl_convert! { - (U2048, 2048), - ( - (U3072, 3072), - (U3584, 3584), - (U4096, 4096), - (U6144, 6144), - (U8192, 8192) - ) -} - -impl_convert! { - (U3072, 3072), - ( - (U3584, 3584), - (U4096, 4096), - (U6144, 6144), - (U8192, 8192) - ) -} - -impl_convert! { - (U3584, 3584), - ( - (U4096, 4096), - (U6144, 6144), - (U8192, 8192) - ) -} - -impl_convert! { - (U4096, 4096), - ( - (U6144, 6144), - (U8192, 8192) - ) -} - -impl_convert! { - (U6144, 6144), - ( - (U8192, 8192) - ) -} - #[cfg(test)] mod tests { use crate::{Encoding, U128}; diff --git a/src/uint/convert.rs b/src/uint/convert.rs deleted file mode 100644 index 406ccafea..000000000 --- a/src/uint/convert.rs +++ /dev/null @@ -1,52 +0,0 @@ -macro_rules! impl_convert { - (($source_type:ident, $source_bits:expr), ($(($target_type:ident, $target_bits:expr)),+ $(,)?)) => { - $( - impl From<$source_type> for $target_type { - fn from(x: $source_type) -> Self { - let mut limbs = [Limb::ZERO; nlimbs!($target_bits)]; - let mut i = 0; - - while i < nlimbs!($source_bits) { - limbs[i] = x.limbs[i]; - i += 1; - } - - Uint { limbs } - } - } - - impl From<&$source_type> for $target_type { - fn from(x: &$source_type) -> Self { - let mut limbs = [Limb::ZERO; nlimbs!($target_bits)]; - let mut i = 0; - - while i < nlimbs!($source_bits) { - limbs[i] = x.limbs[i]; - i += 1; - } - - Uint { limbs } - } - } - )+ - }; -} - -#[cfg(test)] -mod tests { - use crate::{U128, U384, U64}; - - #[test] - fn concat_zero_equals_convert() { - let x = U64::from_u64(0x0011223344556677); - - assert_eq!(U128::from(&x), U128::from_u64(0x0011223344556677)); - assert_eq!(U128::from(x), U128::from_u64(0x0011223344556677)); - } - - #[test] - fn converts_non_concatable_types() { - assert_eq!(U384::ONE, U384::from(&U128::ONE)); - assert_eq!(U384::ONE, U384::from(U128::ONE)); - } -} diff --git a/src/uint/extra_trait_impls/convert.rs b/src/uint/extra_trait_impls/convert.rs new file mode 100644 index 000000000..234ce0316 --- /dev/null +++ b/src/uint/extra_trait_impls/convert.rs @@ -0,0 +1,302 @@ +use crate::{ + Uint, U1024, U128, U1280, U1536, U1792, U192, U2048, U256, U3072, U320, U3584, U384, U4096, + U448, U512, U576, U6144, U64, U640, U768, U8192, U896, +}; + +use crate::Limb; + +macro_rules! impl_convert { + (($source_type:ident, $source_bits:expr), ($(($target_type:ident, $target_bits:expr)),+ $(,)?)) => { + $( + impl From<$source_type> for $target_type { + fn from(x: $source_type) -> Self { + let mut limbs = [Limb::ZERO; nlimbs!($target_bits)]; + let mut i = 0; + + while i < nlimbs!($source_bits) { + limbs[i] = x.limbs[i]; + i += 1; + } + + Uint { limbs } + } + } + + impl From<&$source_type> for $target_type { + fn from(x: &$source_type) -> Self { + let mut limbs = [Limb::ZERO; nlimbs!($target_bits)]; + let mut i = 0; + + while i < nlimbs!($source_bits) { + limbs[i] = x.limbs[i]; + i += 1; + } + + Uint { limbs } + } + } + )+ + }; +} + +impl_convert! { + (U64, 64), + ( + (U128, 128), + (U256, 256), + (U384, 384), + (U512, 512), + (U640, 640), + (U768, 768), + (U896, 896), + (U1024, 1024), + (U1280, 1280), + (U1536, 1536), + (U1792, 1792), + (U2048, 2048), + (U3072, 3072), + (U3584, 3584), + (U4096, 4096), + (U6144, 6144), + (U8192, 8192) + ) +} + +impl_convert! { + (U128, 128), + ( + (U256, 256), + (U384, 384), + (U512, 512), + (U640, 640), + (U768, 768), + (U896, 896), + (U1024, 1024), + (U1280, 1280), + (U1536, 1536), + (U1792, 1792), + (U2048, 2048), + (U3072, 3072), + (U3584, 3584), + (U4096, 4096), + (U6144, 6144), + (U8192, 8192) + ) +} + +impl_convert! { + (U256, 256), + ( + (U384, 384), + (U512, 512), + (U640, 640), + (U768, 768), + (U896, 896), + (U1024, 1024), + (U1280, 1280), + (U1536, 1536), + (U1792, 1792), + (U2048, 2048), + (U3072, 3072), + (U3584, 3584), + (U4096, 4096), + (U6144, 6144), + (U8192, 8192) + ) +} + +impl_convert! { + (U384, 384), + ( + (U512, 512), + (U640, 640), + (U768, 768), + (U896, 896), + (U1024, 1024), + (U1280, 1280), + (U1536, 1536), + (U1792, 1792), + (U2048, 2048), + (U3072, 3072), + (U3584, 3584), + (U4096, 4096), + (U6144, 6144), + (U8192, 8192) + ) +} + +impl_convert! { + (U512, 512), + ( + (U640, 640), + (U768, 768), + (U896, 896), + (U1024, 1024), + (U1280, 1280), + (U1536, 1536), + (U1792, 1792), + (U2048, 2048), + (U3072, 3072), + (U3584, 3584), + (U4096, 4096), + (U6144, 6144), + (U8192, 8192) + ) +} + +impl_convert! { + (U640, 640), + ( + (U768, 768), + (U896, 896), + (U1024, 1024), + (U1280, 1280), + (U1536, 1536), + (U1792, 1792), + (U2048, 2048), + (U3072, 3072), + (U3584, 3584), + (U4096, 4096), + (U6144, 6144), + (U8192, 8192) + ) +} + +impl_convert! { + (U768, 768), + ( + (U896, 896), + (U1024, 1024), + (U1280, 1280), + (U1536, 1536), + (U1792, 1792), + (U2048, 2048), + (U3072, 3072), + (U3584, 3584), + (U4096, 4096), + (U6144, 6144), + (U8192, 8192) + ) +} + +impl_convert! { + (U896, 896), + ( + (U1024, 1024), + (U1280, 1280), + (U1536, 1536), + (U1792, 1792), + (U2048, 2048), + (U3072, 3072), + (U3584, 3584), + (U4096, 4096), + (U6144, 6144), + (U8192, 8192) + ) +} + +impl_convert! { + (U1024, 1024), + ( + (U1280, 1280), + (U1536, 1536), + (U1792, 1792), + (U2048, 2048), + (U3072, 3072), + (U3584, 3584), + (U4096, 4096), + (U6144, 6144), + (U8192, 8192) + ) +} + +impl_convert! { + (U1280, 1280), + ( + (U1536, 1536), + (U1792, 1792), + (U2048, 2048), + (U3072, 3072), + (U3584, 3584), + (U4096, 4096), + (U6144, 6144), + (U8192, 8192) + ) +} + +impl_convert! { + (U1536, 1536), + ( + (U1792, 1792), + (U2048, 2048), + (U3072, 3072), + (U3584, 3584), + (U4096, 4096), + (U6144, 6144), + (U8192, 8192) + ) +} + +impl_convert! { + (U2048, 2048), + ( + (U3072, 3072), + (U3584, 3584), + (U4096, 4096), + (U6144, 6144), + (U8192, 8192) + ) +} + +impl_convert! { + (U3072, 3072), + ( + (U3584, 3584), + (U4096, 4096), + (U6144, 6144), + (U8192, 8192) + ) +} + +impl_convert! { + (U3584, 3584), + ( + (U4096, 4096), + (U6144, 6144), + (U8192, 8192) + ) +} + +impl_convert! { + (U4096, 4096), + ( + (U6144, 6144), + (U8192, 8192) + ) +} + +impl_convert! { + (U6144, 6144), + ( + (U8192, 8192) + ) +} + +#[cfg(test)] +mod tests { + use crate::{U128, U384, U64}; + + #[test] + fn concat_zero_equals_convert() { + let x = U64::from_u64(0x0011223344556677); + + assert_eq!(U128::from(&x), U128::from_u64(0x0011223344556677)); + assert_eq!(U128::from(x), U128::from_u64(0x0011223344556677)); + } + + #[test] + fn converts_non_concatable_types() { + assert_eq!(U384::ONE, U384::from(&U128::ONE)); + assert_eq!(U384::ONE, U384::from(U128::ONE)); + } +} From d2e7bfa0dac8648515305d7af3d2b874f69c7b75 Mon Sep 17 00:00:00 2001 From: Yehonatan Cohen Scaly Date: Sun, 7 May 2023 16:26:20 +0300 Subject: [PATCH 09/11] Add missing file --- src/uint/extra_trait_impls.rs | 1 + 1 file changed, 1 insertion(+) create mode 100644 src/uint/extra_trait_impls.rs diff --git a/src/uint/extra_trait_impls.rs b/src/uint/extra_trait_impls.rs new file mode 100644 index 000000000..bb13da4f1 --- /dev/null +++ b/src/uint/extra_trait_impls.rs @@ -0,0 +1 @@ +mod convert; From 58189f48249bad0b95a032dae657c037e6cbf8ee Mon Sep 17 00:00:00 2001 From: Yehonatan Cohen Scaly Date: Sun, 7 May 2023 16:35:20 +0300 Subject: [PATCH 10/11] Add missing types for convert --- src/uint/extra_trait_impls/convert.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/uint/extra_trait_impls/convert.rs b/src/uint/extra_trait_impls/convert.rs index 234ce0316..dfddd6845 100644 --- a/src/uint/extra_trait_impls/convert.rs +++ b/src/uint/extra_trait_impls/convert.rs @@ -43,8 +43,11 @@ impl_convert! { (U64, 64), ( (U128, 128), + (U192, 192), (U256, 256), + (U320, 320), (U384, 384), + (U448, 448), (U512, 512), (U640, 640), (U768, 768), @@ -65,9 +68,13 @@ impl_convert! { impl_convert! { (U128, 128), ( + (U192, 192), (U256, 256), + (U320, 320), (U384, 384), + (U448, 448), (U512, 512), + (U576, 576), (U640, 640), (U768, 768), (U896, 896), @@ -87,8 +94,11 @@ impl_convert! { impl_convert! { (U256, 256), ( + (U320, 320), (U384, 384), + (U448, 448), (U512, 512), + (U576, 576), (U640, 640), (U768, 768), (U896, 896), @@ -108,7 +118,9 @@ impl_convert! { impl_convert! { (U384, 384), ( + (U448, 448), (U512, 512), + (U576, 576), (U640, 640), (U768, 768), (U896, 896), @@ -128,6 +140,7 @@ impl_convert! { impl_convert! { (U512, 512), ( + (U576, 576), (U640, 640), (U768, 768), (U896, 896), From 71f8a1a9c76c815f189bec3ce7a1bee0852b486c Mon Sep 17 00:00:00 2001 From: Yehonatan Cohen Scaly Date: Sun, 7 May 2023 16:45:44 +0300 Subject: [PATCH 11/11] Add missing convert types macro invocations --- src/uint/extra_trait_impls/convert.rs | 88 +++++++++++++++++++++++++++ 1 file changed, 88 insertions(+) diff --git a/src/uint/extra_trait_impls/convert.rs b/src/uint/extra_trait_impls/convert.rs index dfddd6845..701fabc9f 100644 --- a/src/uint/extra_trait_impls/convert.rs +++ b/src/uint/extra_trait_impls/convert.rs @@ -91,6 +91,31 @@ impl_convert! { ) } +impl_convert! { + (U192, 192), + ( + (U256, 256), + (U320, 320), + (U384, 384), + (U448, 448), + (U512, 512), + (U576, 576), + (U640, 640), + (U768, 768), + (U896, 896), + (U1024, 1024), + (U1280, 1280), + (U1536, 1536), + (U1792, 1792), + (U2048, 2048), + (U3072, 3072), + (U3584, 3584), + (U4096, 4096), + (U6144, 6144), + (U8192, 8192) + ) +} + impl_convert! { (U256, 256), ( @@ -115,6 +140,29 @@ impl_convert! { ) } +impl_convert! { + (U320, 320), + ( + (U384, 384), + (U448, 448), + (U512, 512), + (U576, 576), + (U640, 640), + (U768, 768), + (U896, 896), + (U1024, 1024), + (U1280, 1280), + (U1536, 1536), + (U1792, 1792), + (U2048, 2048), + (U3072, 3072), + (U3584, 3584), + (U4096, 4096), + (U6144, 6144), + (U8192, 8192) + ) +} + impl_convert! { (U384, 384), ( @@ -137,6 +185,27 @@ impl_convert! { ) } +impl_convert! { + (U448, 448), + ( + (U512, 512), + (U576, 576), + (U640, 640), + (U768, 768), + (U896, 896), + (U1024, 1024), + (U1280, 1280), + (U1536, 1536), + (U1792, 1792), + (U2048, 2048), + (U3072, 3072), + (U3584, 3584), + (U4096, 4096), + (U6144, 6144), + (U8192, 8192) + ) +} + impl_convert! { (U512, 512), ( @@ -157,6 +226,25 @@ impl_convert! { ) } +impl_convert! { + (U576, 576), + ( + (U640, 640), + (U768, 768), + (U896, 896), + (U1024, 1024), + (U1280, 1280), + (U1536, 1536), + (U1792, 1792), + (U2048, 2048), + (U3072, 3072), + (U3584, 3584), + (U4096, 4096), + (U6144, 6144), + (U8192, 8192) + ) +} + impl_convert! { (U640, 640), (