From 11aaa454567e1dbbb9ddd7dfbe666e9a2a93a8de Mon Sep 17 00:00:00 2001 From: Hatter Jiang Date: Sat, 26 Aug 2023 02:23:18 +0800 Subject: [PATCH] feat: update dependencies --- __crypto/secretshare/Cargo.lock | 86 +++++++++++++------------------- __crypto/secretshare/Cargo.toml | 2 +- __crypto/secretshare/src/main.rs | 4 +- 3 files changed, 38 insertions(+), 54 deletions(-) diff --git a/__crypto/secretshare/Cargo.lock b/__crypto/secretshare/Cargo.lock index 09d71b1..ed1bfe3 100644 --- a/__crypto/secretshare/Cargo.lock +++ b/__crypto/secretshare/Cargo.lock @@ -2,18 +2,18 @@ # It is not intended for manual editing. version = 3 +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + [[package]] name = "crc24" version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fd121741cf3eb82c08dd3023eb55bf2665e5f60ec20f89760cf836ae4562e6a0" -[[package]] -name = "fuchsia-cprng" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba" - [[package]] name = "getopts" version = "0.2.21" @@ -23,6 +23,17 @@ dependencies = [ "unicode-width", ] +[[package]] +name = "getrandom" +version = "0.2.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] + [[package]] name = "libc" version = "0.2.147" @@ -30,50 +41,39 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" [[package]] -name = "rand" -version = "0.3.23" +name = "ppv-lite86" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64ac302d8f83c0c1974bf758f6b041c6c8ada916fbb44a609158ca8b064cc76c" -dependencies = [ - "libc", - "rand 0.4.6", -] +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" [[package]] name = "rand" -version = "0.4.6" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "552840b97013b1a26992c11eac34bdd778e464601a4c2054b5f0bff7c6761293" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" dependencies = [ - "fuchsia-cprng", "libc", - "rand_core 0.3.1", - "rdrand", - "winapi", + "rand_chacha", + "rand_core", ] [[package]] -name = "rand_core" +name = "rand_chacha" version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a6fdeb83b075e8266dcc8762c22776f6877a63111121f5f8c7411e5be7eed4b" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" dependencies = [ - "rand_core 0.4.2", + "ppv-lite86", + "rand_core", ] [[package]] name = "rand_core" -version = "0.4.2" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c33a3c44ca05fa6f1807d8e6743f3824e8509beca625669633be0acbdf509dc" - -[[package]] -name = "rdrand" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "678054eb77286b51581ba43620cc911abf02758c91f93f479767aed0f90458b2" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" dependencies = [ - "rand_core 0.3.1", + "getrandom", ] [[package]] @@ -88,7 +88,7 @@ version = "0.1.6" dependencies = [ "crc24", "getopts", - "rand 0.3.23", + "rand", "rustc-serialize", ] @@ -99,23 +99,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b" [[package]] -name = "winapi" -version = "0.3.9" +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" 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-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" diff --git a/__crypto/secretshare/Cargo.toml b/__crypto/secretshare/Cargo.toml index 4669c52..cfafd2e 100644 --- a/__crypto/secretshare/Cargo.toml +++ b/__crypto/secretshare/Cargo.toml @@ -11,7 +11,7 @@ edition = "2021" getopts = "0.2" rustc-serialize = "0.3" crc24 = "0.1" -rand = "0.3" +rand = "0.8" [profile.release] opt-level = "z" diff --git a/__crypto/secretshare/src/main.rs b/__crypto/secretshare/src/main.rs index 903644e..77a91f5 100644 --- a/__crypto/secretshare/src/main.rs +++ b/__crypto/secretshare/src/main.rs @@ -8,7 +8,7 @@ use std::iter::repeat; use std::num; use getopts::Options; -use rand::{OsRng, Rng}; +use rand::RngCore; use rustc_serialize::base64::{self, FromBase64, ToBase64}; use gf256::Gf256; @@ -121,7 +121,7 @@ fn secret_share(src: &[u8], k: u8, n: u8) -> io::Result>> { } let mut col_in = new_vec(k as usize, 0u8); let mut col_out = Vec::with_capacity(n as usize); - let mut osrng = OsRng::new()?; + let mut osrng = rand::thread_rng(); for (c, &s) in src.iter().enumerate() { col_in[0] = s; osrng.fill_bytes(&mut col_in[1..]);