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

Function seal_ticket

src/pq.rs:253–260  ·  view source on GitHub ↗

Seal a resumption ticket under a ticket key.

(tk: &TicketKey, ticket_nonce: &[u8; TICKET_NONCE_SIZE], ticket_plain: &[u8])

Source from the content-addressed store, hash-verified

251
252/// Seal a resumption ticket under a ticket key.
253pub fn seal_ticket(tk: &TicketKey, ticket_nonce: &[u8; TICKET_NONCE_SIZE], ticket_plain: &[u8]) -> Vec<u8> {
254 let sealed = tk.key.seal_raw(ticket_nonce, ticket_plain);
255 let mut ticket = Vec::with_capacity(TICKET_KEY_ID_SIZE + TICKET_NONCE_SIZE + sealed.len());
256 ticket.extend_from_slice(&tk.id);
257 ticket.extend_from_slice(ticket_nonce);
258 ticket.extend_from_slice(&sealed);
259 ticket
260}
261
262/// Open a resumption ticket. Returns the recovered ticket plaintext, or an
263/// error on any failure (the caller MUST silently drop the query).

Callers 2

appendix3_vectorsFunction · 0.85
decrypt_pq_ciphertextFunction · 0.85

Calls 1

seal_rawMethod · 0.80

Tested by 1

appendix3_vectorsFunction · 0.68