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

Function ticket_plain

src/pq.rs:205–223  ·  view source on GitHub ↗
(
    resume_secret: &[u8; 32],
    es_version: &[u8; 2],
    client_magic: &[u8; 8],
    serial: &[u8; 4],
    ts_end: &[u8; 4],
    ticket_expiry: u32,
    profile_extension_hash: &[u8; 32],
)

Source from the content-addressed store, hash-verified

203/// The plaintext sealed inside a resumption ticket.
204#[allow(clippy::too_many_arguments)]
205pub fn ticket_plain(
206 resume_secret: &[u8; 32],
207 es_version: &[u8; 2],
208 client_magic: &[u8; 8],
209 serial: &[u8; 4],
210 ts_end: &[u8; 4],
211 ticket_expiry: u32,
212 profile_extension_hash: &[u8; 32],
213) -> Vec<u8> {
214 let mut tp = Vec::with_capacity(32 + 2 + 8 + 4 + 4 + 4 + 32);
215 tp.extend_from_slice(resume_secret);
216 tp.extend_from_slice(es_version);
217 tp.extend_from_slice(client_magic);
218 tp.extend_from_slice(serial);
219 tp.extend_from_slice(ts_end);
220 tp.extend_from_slice(&ticket_expiry.to_be_bytes());
221 tp.extend_from_slice(profile_extension_hash);
222 tp
223}
224
225/// The fields recovered from an opened ticket.
226pub struct TicketFields {

Callers 2

appendix3_vectorsFunction · 0.85
decrypt_pq_ciphertextFunction · 0.85

Calls

no outgoing calls

Tested by 1

appendix3_vectorsFunction · 0.68