Trait prio::vdaf::xof::Xof

source ·
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§

source

type SeedStream: RngCore + Sized

The type of stream produced by this XOF.

Required Methods§

source

fn init(seed_bytes: &[u8; SEED_SIZE], dst: &[u8]) -> Self

Construct an instance of Xof with the given seed.

source

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.

source

fn into_seed_stream(self) -> Self::SeedStream

Finalize the XOF state, producing a seed stream.

Provided Methods§

source

fn into_seed(self) -> Seed<SEED_SIZE>

Finalize the XOF state, producing a seed.

source

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.

Implementors§