2019-03-01 01:19:05 +00:00
|
|
|
//! Provides list-shuffling functions matching the Ethereum 2.0 specification.
|
|
|
|
//!
|
|
|
|
//! See
|
2020-02-10 23:19:36 +00:00
|
|
|
//! [compute_shuffled_index](https://github.com/ethereum/eth2.0-specs/blob/v0.10.1/specs/phase0/beacon-chain.md#compute_shuffled_index)
|
2019-03-01 01:19:05 +00:00
|
|
|
//! for specifications.
|
|
|
|
//!
|
|
|
|
//! There are two functions exported by this crate:
|
|
|
|
//!
|
2019-10-29 01:07:12 +00:00
|
|
|
//! - `compute_shuffled_index`: given a single index, computes the index resulting from a shuffle.
|
2019-03-01 01:19:05 +00:00
|
|
|
//! Runs in less time than it takes to run `shuffle_list`.
|
|
|
|
//! - `shuffle_list`: shuffles an entire list in-place. Runs in less time than it takes to run
|
2019-10-29 01:07:12 +00:00
|
|
|
//! `compute_shuffled_index` on each index.
|
2019-03-01 01:19:05 +00:00
|
|
|
//!
|
2019-10-29 01:07:12 +00:00
|
|
|
//! In general, use `compute_shuffled_index` to calculate the shuffling of a small subset of a much
|
2019-03-01 01:19:05 +00:00
|
|
|
//! larger list (~250x larger is a good guide, but solid figures yet to be calculated).
|
|
|
|
|
2019-10-29 01:07:12 +00:00
|
|
|
mod compute_shuffled_index;
|
2019-03-01 01:19:05 +00:00
|
|
|
mod shuffle_list;
|
|
|
|
|
2019-10-29 01:07:12 +00:00
|
|
|
pub use compute_shuffled_index::compute_shuffled_index;
|
2019-03-01 01:19:05 +00:00
|
|
|
pub use shuffle_list::shuffle_list;
|
2020-02-24 22:00:09 +00:00
|
|
|
|
|
|
|
type Hash256 = ethereum_types::H256;
|