From 8350ac6afb2d678b74581000a6aafe1994b72231 Mon Sep 17 00:00:00 2001 From: Daniel Mueller Date: Wed, 16 Jan 2019 17:26:30 -0800 Subject: Update nitrokey crate to 0.3.3 This change updates the nitrokey crate to version 0.3.3. Along with that change we update rand to 0.6.4 because rand 0.6.1 does not yet contain a publicly accessible rand_os. Note that we no longer require all crates in rand's workspace, but only rand_os and rand_core, which is a significant reduction in the number of lines of code compiled. Import subrepo nitrokey/:nitrokey at 7cf747d56ddc0b7eeedc3caf36dcc909907a171c Import subrepo rand/:rand at 4336232dda03323634b10ec72ddf27914aebc3a2 --- rand/src/deprecated.rs | 79 ++++---------------------------------------------- 1 file changed, 6 insertions(+), 73 deletions(-) (limited to 'rand/src/deprecated.rs') diff --git a/rand/src/deprecated.rs b/rand/src/deprecated.rs index 985ae61..88eb09f 100644 --- a/rand/src/deprecated.rs +++ b/rand/src/deprecated.rs @@ -151,12 +151,12 @@ impl SeedableRng for ChaChaRng { } impl ChaChaRng { - #[cfg(rust_1_26)] + #[cfg(all(rustc_1_26, not(target_os = "emscripten")))] pub fn get_word_pos(&self) -> u128 { self.0.get_word_pos() } - #[cfg(rust_1_26)] + #[cfg(all(rustc_1_26, not(target_os = "emscripten")))] pub fn set_word_pos(&mut self, word_offset: u128) { self.0.set_word_pos(word_offset) } @@ -291,45 +291,12 @@ impl SeedableRng for StdRng { impl CryptoRng for StdRng {} -#[cfg(all(feature="std", - any(target_os = "linux", target_os = "android", - target_os = "netbsd", - target_os = "dragonfly", - target_os = "haiku", - target_os = "emscripten", - target_os = "solaris", - target_os = "cloudabi", - target_os = "macos", target_os = "ios", - target_os = "freebsd", - target_os = "openbsd", target_os = "bitrig", - target_os = "redox", - target_os = "fuchsia", - windows, - all(target_arch = "wasm32", feature = "stdweb"), - all(target_arch = "wasm32", feature = "wasm-bindgen"), -)))] +#[cfg(feature="rand_os")] #[derive(Clone, Debug)] #[deprecated(since="0.6.0", note="import with rand::rngs::OsRng instead")] pub struct OsRng(rngs::OsRng); -#[cfg(all(feature="std", - any(target_os = "linux", target_os = "android", - target_os = "netbsd", - target_os = "dragonfly", - target_os = "haiku", - target_os = "emscripten", - target_os = "solaris", - target_os = "cloudabi", - target_os = "macos", target_os = "ios", - target_os = "freebsd", - target_os = "openbsd", target_os = "bitrig", - target_os = "redox", - target_os = "fuchsia", - windows, - all(target_arch = "wasm32", feature = "stdweb"), - all(target_arch = "wasm32", feature = "wasm-bindgen"), -)))] -#[cfg(feature="std")] +#[cfg(feature="rand_os")] impl RngCore for OsRng { #[inline(always)] fn next_u32(&mut self) -> u32 { @@ -352,48 +319,14 @@ impl RngCore for OsRng { } } -#[cfg(all(feature="std", - any(target_os = "linux", target_os = "android", - target_os = "netbsd", - target_os = "dragonfly", - target_os = "haiku", - target_os = "emscripten", - target_os = "solaris", - target_os = "cloudabi", - target_os = "macos", target_os = "ios", - target_os = "freebsd", - target_os = "openbsd", target_os = "bitrig", - target_os = "redox", - target_os = "fuchsia", - windows, - all(target_arch = "wasm32", feature = "stdweb"), - all(target_arch = "wasm32", feature = "wasm-bindgen"), -)))] -#[cfg(feature="std")] +#[cfg(feature="rand_os")] impl OsRng { pub fn new() -> Result { rngs::OsRng::new().map(OsRng) } } -#[cfg(all(feature="std", - any(target_os = "linux", target_os = "android", - target_os = "netbsd", - target_os = "dragonfly", - target_os = "haiku", - target_os = "emscripten", - target_os = "solaris", - target_os = "cloudabi", - target_os = "macos", target_os = "ios", - target_os = "freebsd", - target_os = "openbsd", target_os = "bitrig", - target_os = "redox", - target_os = "fuchsia", - windows, - all(target_arch = "wasm32", feature = "stdweb"), - all(target_arch = "wasm32", feature = "wasm-bindgen"), -)))] -#[cfg(feature="std")] +#[cfg(feature="rand_os")] impl CryptoRng for OsRng {} -- cgit v1.2.1