pub trait PseudoRandomFunction<'a> {
type KeyHandle;
type PrfOutputSize: ArrayLength<u8> + ToInt<usize>;
type Error;
// Required methods
fn init(
&mut self,
key: &'a dyn PseudoRandomFunctionKey<KeyHandle = Self::KeyHandle>,
) -> Result<(), Self::Error>;
fn update(&mut self, msg: &[u8]) -> Result<(), Self::Error>;
fn finish(&mut self, out: &mut [u8]) -> Result<usize, Self::Error>;
}
Expand description
Defines how the KBKDF crate will interact with PRFs This allows the user of this crate to provide their own implementation of a PRF, however, only SP800-108 specified PRFs are allowed in the approved mode of operation. Given that, this crate cannot test for that and assumes that the user is using an approved PRF.
Required Associated Types§
Sourcetype PrfOutputSize: ArrayLength<u8> + ToInt<usize>
type PrfOutputSize: ArrayLength<u8> + ToInt<usize>
The PRF output size