pub trait Xof<const SEED_SIZE: usize>: Clone + Debug {
type SeedStream: RngCore + Sized;
// Required methods
fn init(seed_bytes: &[u8; SEED_SIZE], dst: &[u8]) -> Self;
fn update(&mut self, data: &[u8]);
fn into_seed_stream(self) -> Self::SeedStream;
// Provided methods
fn into_seed(self) -> Seed<SEED_SIZE> { ... }
fn seed_stream(
seed: &Seed<SEED_SIZE>,
dst: &[u8],
binder: &[u8]
) -> Self::SeedStream { ... }
}
Expand description
An extendable output function (XOF) with the interface specified in [draft-irtf-cfrg-vdaf-08].
Required Associated Types§
sourcetype SeedStream: RngCore + Sized
type SeedStream: RngCore + Sized
The type of stream produced by this XOF.
Required Methods§
sourcefn init(seed_bytes: &[u8; SEED_SIZE], dst: &[u8]) -> Self
fn init(seed_bytes: &[u8; SEED_SIZE], dst: &[u8]) -> Self
Construct an instance of Xof
with the given seed.
sourcefn update(&mut self, data: &[u8])
fn update(&mut self, data: &[u8])
Update the XOF state by passing in the next fragment of the info string. The final info string is assembled from the concatenation of sequence of fragments passed to this method.
sourcefn into_seed_stream(self) -> Self::SeedStream
fn into_seed_stream(self) -> Self::SeedStream
Finalize the XOF state, producing a seed stream.
Provided Methods§
sourcefn seed_stream(
seed: &Seed<SEED_SIZE>,
dst: &[u8],
binder: &[u8]
) -> Self::SeedStream
fn seed_stream( seed: &Seed<SEED_SIZE>, dst: &[u8], binder: &[u8] ) -> Self::SeedStream
Construct a seed stream from the given seed and info string.
Object Safety§
This trait is not object safe.