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

Method derive

src/pq.rs:192–200  ·  view source on GitHub ↗

Derive the server-wide ticket key from the provider signing key, so it is stable across restarts without being persisted.

(provider_sk: &[u8])

Source from the content-addressed store, hash-verified

190 /// Derive the server-wide ticket key from the provider signing key, so it
191 /// is stable across restarts without being persisted.
192 pub fn derive(provider_sk: &[u8]) -> Self {
193 let mut input = Vec::with_capacity(25 + provider_sk.len());
194 input.extend_from_slice(b"DNSCrypt-PQ-ticket-key-v1");
195 input.extend_from_slice(provider_sk);
196 TicketKey {
197 id: [0x00, 0x00, 0x00, 0x01],
198 key: SharedKey::from_bytes(sha256(&input)),
199 }
200 }
201}
202
203/// The plaintext sealed inside a resumption ticket.

Callers

nothing calls this directly

Calls 1

sha256Function · 0.85

Tested by

no test coverage detected