(salt: &[u8], ikm: &[u8], info: &[u8], out: &mut [u8])
| 55 | } |
| 56 | |
| 57 | pub fn hkdf_sha256(salt: &[u8], ikm: &[u8], info: &[u8], out: &mut [u8]) { |
| 58 | let mut prk = [0u8; crypto_kdf_hkdf_sha256_KEYBYTES as usize]; |
| 59 | unsafe { |
| 60 | crypto_kdf_hkdf_sha256_extract( |
| 61 | prk.as_mut_ptr(), |
| 62 | salt.as_ptr(), |
| 63 | salt.len() as _, |
| 64 | ikm.as_ptr(), |
| 65 | ikm.len() as _, |
| 66 | ); |
| 67 | crypto_kdf_hkdf_sha256_expand( |
| 68 | out.as_mut_ptr(), |
| 69 | out.len() as _, |
| 70 | info.as_ptr() as *const c_char, |
| 71 | info.len() as _, |
| 72 | prk.as_ptr(), |
| 73 | ); |
| 74 | } |
| 75 | } |
| 76 | |
| 77 | /// An X-Wing key pair, stored as its 32-byte secret seed. The decapsulation |
| 78 | /// key is derived from the seed on demand. |
no outgoing calls
no test coverage detected