MCPcopy Create free account
hub / github.com/DNSCrypt/encrypted-dns-server / hkdf_sha256

Function hkdf_sha256

src/pq.rs:57–75  ·  view source on GitHub ↗
(salt: &[u8], ikm: &[u8], info: &[u8], out: &mut [u8])

Source from the content-addressed store, hash-verified

55}
56
57pub 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.

Callers 3

derive_shared_keyFunction · 0.85
resume_secretFunction · 0.85
resumed_shared_keyFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected