1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
use crate::{ Result, crypto::{ SessionKey, backend::interface::Kdf, }, }; impl Kdf for super::Backend { fn hkdf_sha256(ikm: &SessionKey, salt: Option<&[u8]>, info: &[u8], okm: &mut SessionKey) -> Result<()> { assert!(okm.len() <= 255 * 32); okm.iter_mut().for_each(|p| *p = 4); Ok(()) } }