mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-07-11 04:37:21 +00:00
Introduce efficient Hash-based RNG streamer (#4169)
* Introduce efficient Hash-based RNG streamer * Loop in the case of being in bias space. * Fix tests * Minor cleanup
This commit is contained in:
committed by
Robert Habermeier
parent
9ead395bff
commit
70bc6eaed6
@@ -1026,7 +1026,14 @@ pub trait OpaqueKeys: Clone {
|
||||
}
|
||||
|
||||
/// Input that adds infinite number of zero after wrapped input.
|
||||
struct TrailingZeroInput<'a>(&'a [u8]);
|
||||
pub struct TrailingZeroInput<'a>(&'a [u8]);
|
||||
|
||||
impl<'a> TrailingZeroInput<'a> {
|
||||
/// Create a new instance from the given byte array.
|
||||
pub fn new(data: &'a [u8]) -> Self {
|
||||
Self(data)
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> codec::Input for TrailingZeroInput<'a> {
|
||||
fn remaining_len(&mut self) -> Result<Option<usize>, codec::Error> {
|
||||
|
||||
Reference in New Issue
Block a user