pub trait XofReader {
// Required method
fn read(&mut self, buffer: &mut [u8]);
// Provided method
fn read_boxed(&mut self, n: usize) -> Box<[u8]> { ... }
}
Expand description
Trait for reader types which are used to extract extendable output from a XOF (extendable-output function) result.
Required Methods§
Provided Methods§
Sourcefn read_boxed(&mut self, n: usize) -> Box<[u8]>
Available on crate feature alloc
only.
fn read_boxed(&mut self, n: usize) -> Box<[u8]>
alloc
only.Read output into a boxed slice of the specified size.
Can be called an unlimited number of times in combination with read
.
Box<[u8]>
is used instead of Vec<u8>
to save stack space, since
they have size of 2 and 3 words respectively.