pub enum PrfAlgorithm {
HmacSha256,
HmacSha384,
HmacSha512,
}Expand description
PRF algorithm
Variants§
Implementations§
Source§impl PrfAlgorithm
impl PrfAlgorithm
Sourcepub fn output_len(self) -> usize
pub fn output_len(self) -> usize
Get PRF output length in bytes
Sourcepub fn prf_plus(self, key: &[u8], seed: &[u8], output_len: usize) -> Vec<u8> ⓘ
pub fn prf_plus(self, key: &[u8], seed: &[u8], output_len: usize) -> Vec<u8> ⓘ
Compute prf+ (key expansion function)
Defined in RFC 7296 Section 2.13:
prf+ (K,S) = T1 | T2 | T3 | T4 | ...
where:
T1 = prf (K, S | 0x01)
T2 = prf (K, T1 | S | 0x02)
T3 = prf (K, T2 | S | 0x03)
T4 = prf (K, T3 | S | 0x04)
...§Arguments
key- PRF keyseed- Seed data (S)output_len- Desired output length in bytes
§Returns
Returns expanded key material
Trait Implementations§
Source§impl Clone for PrfAlgorithm
impl Clone for PrfAlgorithm
impl Copy for PrfAlgorithm
Source§impl Debug for PrfAlgorithm
impl Debug for PrfAlgorithm
impl Eq for PrfAlgorithm
Source§impl PartialEq for PrfAlgorithm
impl PartialEq for PrfAlgorithm
impl StructuralPartialEq for PrfAlgorithm
Auto Trait Implementations§
impl Freeze for PrfAlgorithm
impl RefUnwindSafe for PrfAlgorithm
impl Send for PrfAlgorithm
impl Sync for PrfAlgorithm
impl Unpin for PrfAlgorithm
impl UnsafeUnpin for PrfAlgorithm
impl UnwindSafe for PrfAlgorithm
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more