Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename rand_hc128 crate to rand_hc #636

Merged
merged 1 commit into from Oct 30, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 4 additions & 4 deletions .travis.yml
Expand Up @@ -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)"
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions Cargo.toml
Expand Up @@ -29,15 +29,15 @@ 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 }
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 }

Expand Down
4 changes: 2 additions & 2 deletions appveyor.yml
Expand Up @@ -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
4 changes: 2 additions & 2 deletions benches/generators.rs
Expand Up @@ -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;

Expand All @@ -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;

Expand Down
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions rand_hc128/Cargo.toml → 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
"""
Expand Down
File renamed without changes.
File renamed without changes.
16 changes: 8 additions & 8 deletions rand_hc128/README.md → 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.
Expand All @@ -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)

Expand All @@ -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
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion rand_hc128/src/lib.rs → rand_hc/src/lib.rs
Expand Up @@ -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)]
Expand Down
2 changes: 1 addition & 1 deletion rand_isaac/src/isaac.rs
Expand Up @@ -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)]
Expand Down
2 changes: 1 addition & 1 deletion rand_isaac/src/isaac64.rs
Expand Up @@ -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)]
Expand Down
12 changes: 6 additions & 6 deletions src/deprecated.rs
Expand Up @@ -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;
Expand Down Expand Up @@ -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)]
Expand All @@ -196,14 +196,14 @@ impl RngCore for Hc128Rng {
}

impl SeedableRng for Hc128Rng {
type Seed = <rand_hc128::Hc128Rng as SeedableRng>::Seed;
type Seed = <rand_hc::Hc128Rng as SeedableRng>::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<R: RngCore>(rng: R) -> Result<Self, Error> {
rand_hc128::Hc128Rng::from_rng(rng).map(Hc128Rng)
rand_hc::Hc128Rng::from_rng(rng).map(Hc128Rng)
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion src/prng/mod.rs
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/rngs/adapter/reseeding.rs
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/rngs/std.rs
Expand Up @@ -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
Expand All @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions src/rngs/thread.rs
Expand Up @@ -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`:
//
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion utils/ci/script.sh
Expand Up @@ -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
Expand Down