pub trait XOF:
Stream
+ Write
+ Read {
// Required methods
fn reseed(&mut self);
fn clone(&self) -> Box<dyn XOF>;
}Expand description
An XOF is an extendable output function, which is a cryptographic
primitive that can take arbitrary input in the same way a hash
function does, and then create a stream of output, up to a limit
determined by the size of the internal state of the hash function
the underlies the XOF.
When [xor_key_stream()] is called with zeros for the source, an XOF
also acts as a PRNG. If it is seeded with an appropriate amount
of keying material, it is a cryptographically secure source of random
bits.
XOF implements io::Write which absorbs more data into the hash’s state.
It should throw an error if called after [read()]. Use [reseed()] to reset the xof
into a state where more data can be absorbed via io::Write.
XOF implements io::Read which reads more output from the hash.
It returns a value n != 0 if EOF has been reached.
XOF implements Stream, so that callers can use [xor_key_stream]
to encrypt/decrypt data. The key stream is read from the XOF using
the io::Read trait. If [read()] returns an error, then [xor_key_stream]
will panic.