Derive the server-wide ticket key from the provider signing key, so it is stable across restarts without being persisted.
(provider_sk: &[u8])
| 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. |