-
Notifications
You must be signed in to change notification settings - Fork 432
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
Crate refactor #161
Closed
Closed
Crate refactor #161
Changes from 30 commits
Commits
Show all changes
302 commits
Select commit
Hold shift + click to select a range
21de6ae
Add no_std support by conditionally disabling many features
dhardy 212e04e
Integer ranges: reject fewer samples
dhardy e386895
Add SimpleRand (example) and improve Rand doc
dhardy 88f73e0
Fix Rand doc and rename dist var to distr
dhardy 69681f6
Merge remote-tracking branch 'origin/master'
dhardy 3a4ace5
Fix benchmarks; add ChaCha and LogNormal benchmarks
dhardy 96c2a42
Revise benchmarks into three separate ones; add comparators
dhardy dc8c1f4
Benches: add missing file from prev. commit
dhardy 21a4375
Move thread_local stuff to new module. Tweaks for no_std.
dhardy 404e282
Require Rng: Debug
dhardy 68bb549
Make thread_rng use OsRng by default and allow override
dhardy d2b9f8e
Add ConstRng type; improve set_thread_rng doc
dhardy adbbd9d
Replace ConstantRng in uniform tests with ConstRng
dhardy 2511b27
Add fn new() -> Self for Rngs; remove weak_rng()
dhardy cde9f58
Add Sample trait
dhardy 28972a1
Add Sample::iter wrapper; add AsciiWordChar distribution
dhardy fe990d9
Update Sample doc
dhardy a8b2871
Add size_hint() to Iterator impls
dhardy 57efe7e
Remove distributions::range*::range functions, rename new_range → range
dhardy 697b83e
Add no_std build test to travis; fix no_std build
dhardy ecc8a38
Add 128-bit integer support to range types
dhardy 831553c
Add range benchmarks
dhardy 18e8dab
Remove unnecessary mutability
dhardy e73622f
Update travis and appveyor: require Rust 1.18, don't test rand-derive
dhardy de24228
Remove next_u8 and next_u16 functions from Rng
dhardy cca68bb
Remove Rng: Debug requirement
dhardy 2a59377
Add CryptoError; make RNG::new return Result<Self, CryptoError>; rena…
dhardy a3f5bf1
Remove useless impl
dhardy 1f1db33
range2: enable Range::new(low, high); remove convenience function
dhardy db93780
Fix benchmarks
dhardy b7edfdb
Higher precision for floats in range [0,1)
fadc260
Make ranges preserve precision
3c800b1
Use optimized float conversions in ziggurat
ca7b10f
Move `FloatConversions` to a new module
1dbf23d
Add a few extra benchmarks
ac33b28
Add a changelog
ed637de
Merge pull request #3 from pitdicker/changelog
dhardy e8b06db
Merge pull request #1 from pitdicker/master
dhardy a2b2196
Fix no_std build
dhardy eb162fe
Remove SeedableRng impl for StdRng
dhardy d6f4831
Rng: fix to LE, fix missing next_u128 in wrappers, improve fill_bytes…
dhardy 0ca5c4e
no_std: fix "unused import" warnings
dhardy e4a7fcd
Merge remote-tracking branch 'origin'
dhardy 04e326d
Include gen_bytes_* generator benchmarks; use macros
dhardy 0cd5539
Replace fill_bytes code with @newpavlov's code
dhardy e177594
Use macro in distributions bench to reduce source size
dhardy 81821a6
Move open/closed/uniform 01 benchs from misc to distributions; use bl…
dhardy 2e26002
Simplify OsRng impls: only impl next_* once & use minimal ReadRng impl
dhardy 0fc565e
misc benchmark: clean up unneeded imports
dhardy fa4eb5b
Add FromRng and NewRng
dhardy 31f964e
Add benchmarks for ranges of i8, i16 and i32
8906c29
Optimise fill_bytes impls for ChaCha and Isaac RNGs
dhardy 0a97209
Rename CryptoError → Error; add Result<T> using the prior error type
dhardy a07bcdf
Replace fill_bytes with try_fill returning Result<()>
dhardy 07b222b
Move Rng and other core bits to rand_core crate
dhardy b8873f7
Rename FromRng → SeedFromRng and NewRng → NewSeeded
dhardy 10f794f
Add rand_core/README.md
dhardy ec29f80
Fix i128_support for sub crate
dhardy ad973f1
Add notes on testing to README
dhardy 95a16c3
Replace ReseedWithDefault with ReseedWithNew using NewSeeded
dhardy ec7e6bf
Split isaac into 3 modules
4747665
Refactor isaac.rs
90c094d
Remove set_thread_rng/set_new_thread_rng; revert thread_rng to reseed…
dhardy 0ee54b1
Add MockAddRng to rand_core; remove all other mock RNGs
dhardy dd1241a
Add rand_core::impls module; remove all default impls of Rng functions
dhardy 14d0561
Add some extra documentation
2cb9acd
Fix OsRng for other platforms (hopefully)
dhardy 37faeb5
Merge remote-tracking branch 'pitdicker/isaac-rewrite'
dhardy da1ff46
rand_core: improve a few comments/doc
dhardy 67b22bd
rand_core: update Cargo.toml
dhardy ec70309
rand_core: add impl<R: Rng> Rng for &mut R
dhardy d8b8474
Allow sampling from a closed integer range
7edd06b
Remove range.rs
96503f7
Replace range with range2
86de12b
Remove `reseed` from `SeedableRng`
97ab178
Merge pull request #2 from pitdicker/range_int
dhardy dfdf89c
Merge pull request #6 from pitdicker/no_reseeding
dhardy e3784ab
Fix FlatMap::size_hint (thanks @bluss)
dhardy 250aa65
Merge remote-tracking branch 'origin/master'
dhardy 496c0fc
Fix i128_support in range.rs
pitdicker a6528a3
Add initialization benchmarks
pitdicker 08ac750
Clean up ISAAC tests
pitdicker 2e714f2
Remove `range2` from benchmarks
pitdicker adcd8e5
Add `new_from_u64` to `IsaacRng` and `Isaac64Rng`
pitdicker 849f01a
Add Error type and ErrorKind
pitdicker dbbe143
Add back `fill_bytes`
pitdicker 019d9c1
Improve error handeling of `ReadRng`
pitdicker 44ef65f
Remove default implementation from `try_fill`
pitdicker a4e9885
Merge pull request #7 from pitdicker/error_enum
dhardy d511022
Merge pull request #14 from pitdicker/fix_i128_support
dhardy 130b64c
Simplify isaac init code
pitdicker 58350a9
Merge branch 'master' into isaac_init
pitdicker bf53631
Merge pull request #5 from pitdicker/isaac_init
dhardy ebec6c7
rand-core: add CryptoRng trait
dhardy 6712a3a
Remove `Copy` trait from ChaCha
pitdicker e513aaa
Custom Debug implementation for ChaCha and Xorshift
pitdicker fdf4017
Implement Debug for TreadRng
pitdicker 37f7450
Remove Debug bound from ReadRng
pitdicker b5556c6
Make `OsRng` Debug use `imp::OsRng` Debug
pitdicker 6edac27
Merge pull request #16 from pitdicker/common_traits
dhardy 47bdc03
Fix unaligned cast in `impl_uint_from_fill`
pitdicker b9d9987
Drop support for PNaCL
pitdicker 32e325c
from_rng: remove explicit ref; rely on impl rule
dhardy 2679dbd
Merge remote-tracking branch 'dhardy/master'
dhardy c4eb96c
Move mock module from rand_core to rand
dhardy 819a282
Merge pull request #19 from pitdicker/drop_pnacl
dhardy 0b1ac0f
Use fill_bytes(..) instead of try_fill(..).unwrap()
dhardy 9a4e2e7
Merge pull request #20 from pitdicker/fill_from_next
dhardy 07e1d58
Implement `JitterRng`, based on `jitterentropy-library`.
pitdicker 6e40910
Relicensing permission
pitdicker 8ff9394
Revise error type (copy from error_details branch)
dhardy f4a43f7
Revise handling in os and read modules
dhardy 442caee
Reseeding: handle/forward failures from source RNG
dhardy 49e9bb0
Provide statistics function
pitdicker ed358de
Make the number of entropy colelction rounds variable
pitdicker c57aa1a
Address review comments
pitdicker bd60937
Merge pull request #34 from dhardy/err2
dhardy 908fda4
Fix: Error::new(_, _, None) was not usable
dhardy e6b224d
Merge branch 'master' into reseeding
dhardy 6302f53
Fix Debug/Clone support of mock and reseeding RNGs as per #13
dhardy 89f0430
Reseeding: cleaner code
dhardy fdb09d4
Update travis build scripts
dhardy 3bf4680
Implicit error handling (#25)
dhardy 585b738
OsRng: return NotReady if not initialised yet (linux getrandom)
dhardy 508f22c
Implicit handling: use local counter
dhardy 4b8371f
Reseeding: limit retries for transient errors
dhardy 3b7666c
Merge branch 'master' into reseeding
dhardy d387570
Split gen_usize_* benchmarks into gen_u32_* and gen_u64_*
dhardy 6e9c1ab
Rejig ChaCha and Isaac construction tests
dhardy ae365ef
Add true_bytes tests for ChaCha and Isaac; fix 2 bugs in fill_bytes i…
dhardy fd2660b
Isaac64: add test for true 32-bit values
dhardy ab79378
Merge pull request #42 from dhardy/true_bytes
dhardy c8a8f86
Merge pull request #35 from dhardy/reseeding
dhardy d67864a
Add `rand_core::impl::fill_via_u*_chunks`
pitdicker d7b014c
Convert ChaCha to use `fill_via_u32_chunks`
pitdicker f92a347
Fill `isaac` backwards, and use `fill_via_u32_chunks`
pitdicker 707c3e1
Fill `isaac64` backwards, and use `fill_via_u32_chunks`
pitdicker 415ef6f
Improve performance of `isaac64::next_u32`.
pitdicker c218f7a
Add CI based on `trust`
pitdicker 701679c
Merge pull request #44 from pitdicker/ci
dhardy 0bdb1c3
Remove complex indexing, use a bool.
pitdicker 5f4bedf
Add test for alternating between `next_u64` and `next_u32`
pitdicker 69d940f
Improve documentation
pitdicker fe822c0
Merge pull request #45 from pitdicker/isaac_optim
dhardy 08dc010
Merge remote-tracking branch 'upstream/master' into jitter_rng
pitdicker 500b574
Implicit handling: max wait 1 minute if not ready; extra doc
dhardy 7f3c9b0
Fix `no_std` errors
pitdicker d92451a
JitterRng: reduce error-handling code
dhardy 14136e7
Fix `no_std` errors
pitdicker 8971695
Travis: test on a bare-metal target
dhardy 6701189
Crate dependencies: set default-features = false
dhardy 2486226
Include ziggurat_tables.py
pitdicker 35f0cd7
Cargo: make std feature optional and transitive
dhardy 32ea1d2
Travis: adjust build targets
dhardy 026b50e
OsRng: squelch warnings about ununsed code on some targets
dhardy c74cb3f
Travis: fix build script for no_std
dhardy 065baa7
Move ziggurat_tables.py out of source tree
dhardy 96ec26c
Merge branch 'err_implicit_handling'
dhardy 8b62a03
Merge branch 'master' into no_std
dhardy 7adefa0
Merge most of branch 'no_std', minus no_std build
dhardy 82e18c6
Enable all thumb* targets
dhardy 137fe01
Use nightly for bare-metal targets
dhardy ae45ffe
Merge branch 'master' into jitter_rng
dhardy fe3486b
Merge remote-tracking branch 'pitdicker/jitter_rng' into jitter_rng
dhardy afce69d
Fix link to documentaion
vks 4fff5af
Make libc dep optional (use with std only)
dhardy 1e84e50
Add cat_rng tool
dhardy 38e5d8d
JitterRng: reduce FACTOR to 3 to avoid overflow
dhardy aafcba8
JitterRng: allow users to set number of rounds; cache timer test result
dhardy 82d9731
Merge branch 'master' into jitter_rng
dhardy 9d8021b
JitterRng: fix benchmark
dhardy b4746c8
NewSeeded: use JitterRng fallback
dhardy 95c0b35
Merge pull request #51 from vks/patch-1
dhardy bd4c793
CI: move ci to utils/ci
dhardy cf211f9
CI: show status of my branch in readme
dhardy 2821328
Cargo: don't use libc at all if no_std
dhardy 53ab77e
JitterRng: remove unused stuff for no_std
dhardy 8be4f63
Cargo: do not use std by default in rand_core
dhardy a41c055
Merge branch 'master' into no_std
dhardy eca5e36
JitterRng::timer_stats: do not run example
dhardy bcde73a
Merge branch 'master' into no_std
dhardy e472682
Workaround #55: don't run nightly tests on darwin
dhardy 442e7a7
Disable FreeBSD nightly too
dhardy e7335be
Merge pull request #56 from dhardy/jitter-bench-darwin
dhardy 0ccaa6b
Fix `JitterRng` on Mac OS
pitdicker 03ff2d6
Merge pull request #57 from pitdicker/jitterrng_apple
dhardy 2a38131
Merge branch 'master' into new_seeded
dhardy 17e08de
Workaround #55: don't run nightly tests on darwin
dhardy 05d0449
Disable FreeBSD nightly too
dhardy db99fda
Fix `JitterRng` on Mac OS
pitdicker 8b0d1ad
Merge pull request #54 from dhardy/new_seeded
dhardy cc437de
MockAddRng: remove templating
dhardy e621639
SeaHash, seeding via hash, SeadableRng::Seed
dhardy e87b0a7
Fix JitterRng on Windows
pitdicker 9eca335
Merge pull request #63 from pitdicker/jitter_windows
dhardy 7897515
Merge commit 'e621639834e23bc1b4c8454d58cd90fb2f8da27e'
dhardy 697d88a
Remove from_hashable code
dhardy c03c211
Merge rust-lang-nursery/master into dhardy/master
dhardy eae85e2
Rename new_with_cause → with_cause
dhardy c826587
Benchmarks: add f32 open/closed/half-open distr tests
dhardy b8fb05c
Merge branch 'master' into dh-master
dhardy 51a27e1
Add alloc feature; enables seq code
dhardy 43267f7
Use a sign test for bools
pitdicker c8c720e
Ignore the 3 least significant bits for the ziggurat layer
pitdicker 3f22ddd
Use widening multiply instead of modulus in RangeInt
pitdicker 68edc9f
Add a few extra distr benchmarks
pitdicker 173c2b4
Benchmark constructing and sampling from a range
pitdicker 51cc0ed
Merge pull request #68 from pitdicker/avoid_low_bits
dhardy 5e492e5
Merge branch 'master' into dh-master
dhardy 888c5d2
Cherry-pick 243e1ea: Add rand_core::le module, switch SeedableRng::Se…
dhardy ada83bd
Fix rand_core::le test on convert_slice_64
dhardy 5a7dbb0
Add sample_single to Range
pitdicker 4d832a7
Use mask to reduce range in ascii_word_char
pitdicker 4e79c06
Improve documentation of range module
dhardy 259281e
Select "SimpleRand" over generic "Rand" for backwards compatibility
dhardy 1913e08
Add a default implementation for sample_single
pitdicker 6249973
Merge remote-tracking branch 'upstream/master' into range_single_sample
pitdicker 4ebd21f
Merge pull request #69 from pitdicker/range_single_sample
dhardy af4f3f9
Fix tests: use Sample not Rand
dhardy 9d236da
Replace uniform, codepoint and ascii_word_char functions with distrib…
dhardy e90e9eb
Merge changes from #69 (sample_single)
dhardy fe40af0
Don't assume usize is 4 or 8 bytes
dhardy de17011
Merge pull request #71 from dhardy/simple-rand
dhardy e18d489
Add HC-128 RNG
pitdicker 0ac7b86
impl CryptoRng for Hc128Rng
pitdicker b9f7123
Add test for `fill_bytes`
pitdicker 5741e16
Rename AsciiWordChar to AlphanumericChar
pitdicker a0deb78
Optimize Codepoint distribution
pitdicker e3c8ca1
Merge pull request #75 from pitdicker/char_distrs
dhardy 4058522
Merge branch 'master' into dh-master
dhardy f58b2f1
Merge: reorder use/mod declarations
dhardy 4e088f1
Fix comment
dhardy 729644c
Remove log dependency; make i128_support transitive
dhardy eaeee11
Merge pull request #74 from pitdicker/hc-128
dhardy 4f1deb7
Restrict Seed type
dhardy 92831f3
Replace `convert_slice_{32,64}` with `read_u{32,64}_into`
pitdicker cc6da7a
Fold from_rng into SeedableRng
pitdicker 5d9acdc
Merge pull request #77 from pitdicker/blockrng
dhardy e9359ac
Fix sealed implementation of SeedRestriction to prevent extension
dhardy 945e8ff
Make u128 range use widening multiply
pitdicker 4ea098b
Restrict the seed type to a few more array sizes
pitdicker 45ace88
Merge pull request #80 from pitdicker/seed_sizes
dhardy 1f9ce3a
Merge pull request #79 from pitdicker/range_128
dhardy 402e673
Add benchmarks for `ReseedingRng`
pitdicker 4d10328
Improve performance of `ReseedingRng`
pitdicker 07717bc
Simplify reseeding erro logic
pitdicker 8990da2
Add rand_core::le::test_read unit test
dhardy 14f02a2
Benchmark reseeding HC-128 instead of Xorshift
pitdicker d5d9c75
Merge pull request #76 from pitdicker/reseeding_perf
dhardy a4ff5d7
Merge in upstream
dhardy File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
println!("{}", x)