Skip to content

Commit

Permalink
use c2-chacha for stable, runtime-dispatched SIMD
Browse files Browse the repository at this point in the history
Performance:
gen_bytes_chacha20: 254 MB/s -> 603 MB/s [on a Xeon L5630 (SSE4.1)]

Minor version bump:
the only breaking change is that no-std builds now require
default-features=false (std is required by default for runtime cpu
detection; no_std builds will use the best implementation supported by
the target-features/target-cpu enabled at compile time)

New functionality:
ChaChaXRng is parameterized by round count at compile time. Convenient
aliases for the typical 20/12/8 round implementations exposed. ChaChaRng
is aliased to ChaCha20Rng for backward compatibility.

Closes #667
  • Loading branch information
kazcw committed Apr 30, 2019
1 parent d998742 commit c9f4e2b
Show file tree
Hide file tree
Showing 4 changed files with 223 additions and 249 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ average = "0.9.2"
# Only for benches:
rand_xoshiro = { path = "rand_xoshiro", version = "0.1" }
rand_isaac = { path = "rand_isaac", version = "0.1" }
rand_chacha = { path = "rand_chacha", version = "0.1" }
rand_chacha = { path = "rand_chacha", version = "0.2" }
rand_xorshift = { path = "rand_xorshift", version = "0.1" }
rand_distr = { path = "rand_distr", version = "0.1" }

Expand Down
10 changes: 8 additions & 2 deletions rand_chacha/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "rand_chacha"
version = "0.1.1"
authors = ["The Rand Project Developers", "The Rust Project Developers"]
version = "0.2.0"
authors = ["The Rand Project Developers", "The Rust Project Developers", "The CryptoCorrosion Contributors"]
license = "MIT/Apache-2.0"
readme = "README.md"
repository = "https://github.com/rust-random/rand"
Expand All @@ -19,7 +19,13 @@ travis-ci = { repository = "rust-random/rand" }
appveyor = { repository = "rust-random/rand" }

[dependencies]
generic-array = "0.13"
rand_core = { path = "../rand_core", version = "0.4" }
c2-chacha = { version = "0.2", default-features = false }

[build-dependencies]
autocfg = "0.1"

[features]
default = ["std"]
std = ["c2-chacha/std"]
Loading

0 comments on commit c9f4e2b

Please sign in to comment.