diff --git a/.travis.yml b/.travis.yml index 35b7824a702..2f0bb79b8f2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -72,7 +72,7 @@ matrix: # TODO: cannot test rand_pcg due to explicit dependency on i128 - cargo test --manifest-path rand_xorshift/Cargo.toml --features=serde1 - cargo test --manifest-path rand_chacha/Cargo.toml - - cargo test --manifest-path rand_hc128/Cargo.toml + - cargo test --manifest-path rand_hc/Cargo.toml - rust: stable env: DESCRIPTION="stable Rust release, macOS, iOS (cross-compile only)" @@ -91,7 +91,7 @@ matrix: - cargo test --manifest-path rand_pcg/Cargo.toml --features=serde1 - cargo test --manifest-path rand_xorshift/Cargo.toml --features=serde1 - cargo test --manifest-path rand_chacha/Cargo.toml - - cargo test --manifest-path rand_hc128/Cargo.toml + - cargo test --manifest-path rand_hc/Cargo.toml - cargo build --target=aarch64-apple-ios - rust: beta @@ -116,7 +116,7 @@ matrix: - cargo test --manifest-path rand_pcg/Cargo.toml --features=serde1 - cargo test --manifest-path rand_xorshift/Cargo.toml --features=serde1 - cargo test --manifest-path rand_chacha/Cargo.toml - - cargo test --manifest-path rand_hc128/Cargo.toml + - cargo test --manifest-path rand_hc/Cargo.toml # remove cached documentation, otherwise files from previous PRs can get included - rm -rf target/doc - cargo doc --no-deps --all --all-features @@ -199,7 +199,7 @@ script: - cargo test --manifest-path rand_pcg/Cargo.toml --features=serde1 - cargo test --manifest-path rand_xorshift/Cargo.toml --features=serde1 - cargo test --manifest-path rand_chacha/Cargo.toml - - cargo test --manifest-path rand_hc128/Cargo.toml + - cargo test --manifest-path rand_hc/Cargo.toml after_script: set +e diff --git a/Cargo.toml b/Cargo.toml index d24db6386e5..14ef71a6029 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -29,7 +29,7 @@ simd_support = ["packed_simd"] # enables SIMD support serde1 = ["rand_core/serde1", "rand_isaac/serde1", "rand_xorshift/serde1"] # enables serialization for PRNGs [workspace] -members = ["rand_core", "rand_isaac", "rand_chacha", "rand_hc128", "rand_pcg", "rand_xorshift"] +members = ["rand_core", "rand_isaac", "rand_chacha", "rand_hc", "rand_pcg", "rand_xorshift"] [dependencies] rand_core = { path = "rand_core", version = "0.3", default-features = false } @@ -37,7 +37,7 @@ rand_pcg = { path = "rand_pcg", version = "0.1" } # only for deprecations and benches: rand_isaac = { path = "rand_isaac", version = "0.1" } rand_chacha = { path = "rand_chacha", version = "0.1" } -rand_hc128 = { path = "rand_hc128", version = "0.1" } +rand_hc = { path = "rand_hc", version = "0.1" } rand_xorshift = { path = "rand_xorshift", version = "0.1" } log = { version = "0.4", optional = true } diff --git a/appveyor.yml b/appveyor.yml index 67c972e91e6..a0e518eef42 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -42,11 +42,11 @@ test_script: - cargo test --package rand_isaac --features=serde1 - cargo test --package rand_xorshift --features=serde1 - cargo test --package rand_chacha - - cargo test --package rand_hc128 + - cargo test --package rand_hc - cargo test --manifest-path rand_core/Cargo.toml - cargo test --manifest-path rand_core/Cargo.toml --no-default-features --features=alloc - cargo test --manifest-path rand_isaac/Cargo.toml --features=serde1 - cargo test --manifest-path rand_pcg/Cargo.toml --features=serde1 - cargo test --manifest-path rand_xorshift/Cargo.toml --features=serde1 - cargo test --manifest-path rand_chacha/Cargo.toml - - cargo test --manifest-path rand_hc128/Cargo.toml + - cargo test --manifest-path rand_hc/Cargo.toml diff --git a/benches/generators.rs b/benches/generators.rs index 608c64eac01..a12b5a6d563 100644 --- a/benches/generators.rs +++ b/benches/generators.rs @@ -12,7 +12,7 @@ extern crate test; extern crate rand; extern crate rand_isaac; extern crate rand_chacha; -extern crate rand_hc128; +extern crate rand_hc; extern crate rand_pcg; extern crate rand_xorshift; @@ -27,7 +27,7 @@ use rand::rngs::adapter::ReseedingRng; use rand::rngs::{OsRng, JitterRng, EntropyRng}; use rand_isaac::{IsaacRng, Isaac64Rng}; use rand_chacha::ChaChaRng; -use rand_hc128::{Hc128Rng, Hc128Core}; +use rand_hc::{Hc128Rng, Hc128Core}; use rand_pcg::{Lcg64Xsh32, Mcg128Xsl64}; use rand_xorshift::XorShiftRng; diff --git a/rand_hc128/CHANGELOG.md b/rand_hc/CHANGELOG.md similarity index 100% rename from rand_hc128/CHANGELOG.md rename to rand_hc/CHANGELOG.md diff --git a/rand_hc128/COPYRIGHT b/rand_hc/COPYRIGHT similarity index 100% rename from rand_hc128/COPYRIGHT rename to rand_hc/COPYRIGHT diff --git a/rand_hc128/Cargo.toml b/rand_hc/Cargo.toml similarity index 83% rename from rand_hc128/Cargo.toml rename to rand_hc/Cargo.toml index 855c4bebf55..7e08bf41d34 100644 --- a/rand_hc128/Cargo.toml +++ b/rand_hc/Cargo.toml @@ -1,12 +1,12 @@ [package] -name = "rand_hc128" +name = "rand_hc" version = "0.1.0" # NB: When modifying, also modify html_root_url in lib.rs authors = ["The Rand Project Developers"] license = "MIT/Apache-2.0" readme = "README.md" repository = "https://github.com/rust-random/rand" -documentation = "https://docs.rs/rand_hc128" -homepage = "https://crates.io/crates/rand_hc128" +documentation = "https://docs.rs/rand_hc" +homepage = "https://crates.io/crates/rand_hc" description = """ HC128 random number generator """ diff --git a/rand_hc128/LICENSE-APACHE b/rand_hc/LICENSE-APACHE similarity index 100% rename from rand_hc128/LICENSE-APACHE rename to rand_hc/LICENSE-APACHE diff --git a/rand_hc128/LICENSE-MIT b/rand_hc/LICENSE-MIT similarity index 100% rename from rand_hc128/LICENSE-MIT rename to rand_hc/LICENSE-MIT diff --git a/rand_hc128/README.md b/rand_hc/README.md similarity index 67% rename from rand_hc128/README.md rename to rand_hc/README.md index b8475404ea5..9c1f5e1229b 100644 --- a/rand_hc128/README.md +++ b/rand_hc/README.md @@ -1,11 +1,11 @@ -# rand_hc128 +# rand_hc [![Build Status](https://travis-ci.org/rust-random/rand.svg)](https://travis-ci.org/rust-random/rand) [![Build Status](https://ci.appveyor.com/api/projects/status/github/rust-random/rand?svg=true)](https://ci.appveyor.com/project/rust-random/rand) -[![Latest version](https://img.shields.io/crates/v/rand_hc128.svg)](https://crates.io/crates/rand_hc128) -[![Documentation](https://docs.rs/rand_hc128/badge.svg)](https://docs.rs/rand_hc128) +[![Latest version](https://img.shields.io/crates/v/rand_hc.svg)](https://crates.io/crates/rand_hc) +[![Documentation](https://docs.rs/rand_hc/badge.svg)](https://docs.rs/rand_hc) [![Minimum rustc version](https://img.shields.io/badge/rustc-1.22+-yellow.svg)](https://github.com/rust-random/rand#rust-version-requirements) -[![License](https://img.shields.io/crates/l/rand_hc128.svg)](https://github.com/rust-random/rand/tree/master/rand_hc128#license) +[![License](https://img.shields.io/crates/l/rand_hc.svg)](https://github.com/rust-random/rand/tree/master/rand_hc#license) A cryptographically secure random number generator that uses the HC-128 algorithm. @@ -15,8 +15,8 @@ RNG. It is selected as one of the "stream ciphers suitable for widespread adoption" by eSTREAM[^2]. Documentation: -[master branch](https://rust-random.github.io/rand/rand_hc128/index.html), -[by release](https://docs.rs/rand_hc128) +[master branch](https://rust-random.github.io/rand/rand_hc/index.html), +[by release](https://docs.rs/rand_hc) [Changelog](CHANGELOG.md) @@ -31,13 +31,13 @@ Documentation: ## Crate Features -`rand_hc128` is `no_std` compatible. It does not require any functionality +`rand_hc` is `no_std` compatible. It does not require any functionality outside of the `core` lib, thus there are no features to configure. # License -`rand_hc128` is distributed under the terms of both the MIT license and the +`rand_hc` is distributed under the terms of both the MIT license and the Apache License (Version 2.0). See [LICENSE-APACHE](LICENSE-APACHE) and [LICENSE-MIT](LICENSE-MIT), and diff --git a/rand_hc128/src/hc128.rs b/rand_hc/src/hc128.rs similarity index 100% rename from rand_hc128/src/hc128.rs rename to rand_hc/src/hc128.rs diff --git a/rand_hc128/src/lib.rs b/rand_hc/src/lib.rs similarity index 92% rename from rand_hc128/src/lib.rs rename to rand_hc/src/lib.rs index 80419fc65d2..15ca34ebe0a 100644 --- a/rand_hc128/src/lib.rs +++ b/rand_hc/src/lib.rs @@ -10,7 +10,7 @@ #![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk.png", html_favicon_url = "https://www.rust-lang.org/favicon.ico", - html_root_url = "https://docs.rs/rand_hc128/0.1.0")] + html_root_url = "https://docs.rs/rand_hc/0.1.0")] #![deny(missing_docs)] #![deny(missing_debug_implementations)] diff --git a/rand_isaac/src/isaac.rs b/rand_isaac/src/isaac.rs index 98bdd2bef57..2bfdd943509 100644 --- a/rand_isaac/src/isaac.rs +++ b/rand_isaac/src/isaac.rs @@ -86,7 +86,7 @@ const RAND_SIZE: usize = 1 << RAND_SIZE_LEN; /// [^3]: Jean-Philippe Aumasson, [*On the pseudo-random generator ISAAC*]( /// https://eprint.iacr.org/2006/438) /// -/// [`Hc128Rng`]: ../../rand_hc128/struct.Hc128Rng.html +/// [`Hc128Rng`]: ../../rand_hc/struct.Hc128Rng.html /// [`BlockRng`]: ../../rand_core/block/struct.BlockRng.html /// [`RngCore`]: ../../rand_core/trait.RngCore.html #[derive(Clone, Debug)] diff --git a/rand_isaac/src/isaac64.rs b/rand_isaac/src/isaac64.rs index d5353008d23..2712762ab32 100644 --- a/rand_isaac/src/isaac64.rs +++ b/rand_isaac/src/isaac64.rs @@ -76,7 +76,7 @@ const RAND_SIZE: usize = 1 << RAND_SIZE_LEN; /// http://burtleburtle.net/bob/rand/isaac.html) /// /// [`IsaacRng`]: ../isaac/struct.IsaacRng.html -/// [`Hc128Rng`]: ../../rand_hc128/struct.Hc128Rng.html +/// [`Hc128Rng`]: ../../rand_hc/struct.Hc128Rng.html /// [`BlockRng64`]: ../../rand_core/block/struct.BlockRng64.html /// [`RngCore`]: ../../rand_core/trait.RngCore.html #[derive(Clone, Debug)] diff --git a/src/deprecated.rs b/src/deprecated.rs index 5b2482abaa9..985ae61e04b 100644 --- a/src/deprecated.rs +++ b/src/deprecated.rs @@ -15,7 +15,7 @@ use {RngCore, CryptoRng, SeedableRng, Error}; use rand_core::block::BlockRngCore; use rand_isaac; use rand_chacha; -use rand_hc128; +use rand_hc; #[cfg(feature="std")] use std::io::Read; @@ -170,8 +170,8 @@ impl CryptoRng for ChaChaRng {} #[derive(Clone, Debug)] -#[deprecated(since="0.6.0", note="import from rand_hc128 crate instead")] -pub struct Hc128Rng(rand_hc128::Hc128Rng); +#[deprecated(since="0.6.0", note="import from rand_hc crate instead")] +pub struct Hc128Rng(rand_hc::Hc128Rng); impl RngCore for Hc128Rng { #[inline(always)] @@ -196,14 +196,14 @@ impl RngCore for Hc128Rng { } impl SeedableRng for Hc128Rng { - type Seed = ::Seed; + type Seed = ::Seed; fn from_seed(seed: Self::Seed) -> Self { - Hc128Rng(rand_hc128::Hc128Rng::from_seed(seed)) + Hc128Rng(rand_hc::Hc128Rng::from_seed(seed)) } fn from_rng(rng: R) -> Result { - rand_hc128::Hc128Rng::from_rng(rng).map(Hc128Rng) + rand_hc::Hc128Rng::from_rng(rng).map(Hc128Rng) } } diff --git a/src/lib.rs b/src/lib.rs index 122724e7071..54badc0dea9 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -244,7 +244,7 @@ extern crate wasm_bindgen; extern crate rand_core; extern crate rand_isaac; // only for deprecations extern crate rand_chacha; // only for deprecations -extern crate rand_hc128; +extern crate rand_hc; extern crate rand_pcg; extern crate rand_xorshift; diff --git a/src/prng/mod.rs b/src/prng/mod.rs index 672b1264a6b..238c25ef55b 100644 --- a/src/prng/mod.rs +++ b/src/prng/mod.rs @@ -301,7 +301,7 @@ //! [`Pcg64Mcg`]: ../../rand_pcg/type.Pcg64Mcg.html //! [`XorShiftRng`]: ../../rand_xorshift/struct.XorShiftRng.html //! [`ChaChaRng`]: ../../rand_chacha/struct.ChaChaRng.html -//! [`Hc128Rng`]: ../../rand_hc128/struct.Hc128Rng.html +//! [`Hc128Rng`]: ../../rand_hc/struct.Hc128Rng.html //! [`IsaacRng`]: ../../rand_isaac/isaac/struct.IsaacRng.html //! [`Isaac64Rng`]: ../../rand_isaac/isaac64/struct.Isaac64Rng.html //! [`ThreadRng`]: ../rngs/struct.ThreadRng.html diff --git a/src/rngs/adapter/reseeding.rs b/src/rngs/adapter/reseeding.rs index 03e5b2c903d..016afab381c 100644 --- a/src/rngs/adapter/reseeding.rs +++ b/src/rngs/adapter/reseeding.rs @@ -80,7 +80,7 @@ use rand_core::block::{BlockRngCore, BlockRng}; /// ``` /// /// [`ChaChaCore`]: ../../../rand_chacha/struct.ChaChaCore.html -/// [`Hc128Core`]: ../../../rand_hc128/struct.Hc128Core.html +/// [`Hc128Core`]: ../../../rand_hc/struct.Hc128Core.html /// [`BlockRngCore`]: ../../../rand_core/block/trait.BlockRngCore.html /// [`ReseedingRng::new`]: struct.ReseedingRng.html#method.new /// [`reseed()`]: struct.ReseedingRng.html#method.reseed diff --git a/src/rngs/std.rs b/src/rngs/std.rs index ac52387107d..ce1658b1fea 100644 --- a/src/rngs/std.rs +++ b/src/rngs/std.rs @@ -9,7 +9,7 @@ //! The standard RNG use {RngCore, CryptoRng, Error, SeedableRng}; -use rand_hc128::Hc128Rng; +use rand_hc::Hc128Rng; /// The standard RNG. The PRNG algorithm in `StdRng` is chosen to be efficient /// on the current platform, to be statistically strong and unpredictable @@ -23,7 +23,7 @@ use rand_hc128::Hc128Rng; /// produce different output depending on the architecture. If you require /// reproducible output, use a named RNG, for example [`ChaChaRng`]. /// -/// [HC-128]: ../../rand_hc128/struct.Hc128Rng.html +/// [HC-128]: ../../rand_hc/struct.Hc128Rng.html /// [`ChaChaRng`]: ../../rand_chacha/struct.ChaChaRng.html #[derive(Clone, Debug)] pub struct StdRng(Hc128Rng); diff --git a/src/rngs/thread.rs b/src/rngs/thread.rs index 1b84489be4f..ff772e3989c 100644 --- a/src/rngs/thread.rs +++ b/src/rngs/thread.rs @@ -13,7 +13,7 @@ use std::cell::UnsafeCell; use {RngCore, CryptoRng, SeedableRng, Error}; use rngs::adapter::ReseedingRng; use rngs::EntropyRng; -use rand_hc128::Hc128Core; +use rand_hc::Hc128Core; // Rationale for using `UnsafeCell` in `ThreadRng`: // @@ -68,7 +68,7 @@ const THREAD_RNG_RESEED_THRESHOLD: u64 = 32*1024*1024; // 32 MiB /// [`ReseedingRng`]: adapter/struct.ReseedingRng.html /// [`StdRng`]: struct.StdRng.html /// [`EntropyRng`]: struct.EntropyRng.html -/// [HC-128]: ../../rand_hc128/struct.Hc128Rng.html +/// [HC-128]: ../../rand_hc/struct.Hc128Rng.html #[derive(Clone, Debug)] pub struct ThreadRng { // use of raw pointer implies type is neither Send nor Sync diff --git a/utils/ci/script.sh b/utils/ci/script.sh index fd85645cd5e..33786f618f8 100644 --- a/utils/ci/script.sh +++ b/utils/ci/script.sh @@ -13,7 +13,7 @@ main() { cross test --target $TARGET --manifest-path rand_pcg/Cargo.toml --features=serde1 cross test --target $TARGET --manifest-path rand_xorshift/Cargo.toml --features=serde1 cross test --target $TARGET --manifest-path rand_chacha/Cargo.toml - cross test --target $TARGET --manifest-path rand_hc128/Cargo.toml + cross test --target $TARGET --manifest-path rand_hc/Cargo.toml } # we don't run the "test phase" when doing deploys