]>
git.ipfire.org Git - thirdparty/openssl.git/blob - include/internal/quic_record_util.h
cc103505c4147ca5a90b0d397d96ca66d3639841
2 * Copyright 2022 The OpenSSL Project Authors. All Rights Reserved.
4 * Licensed under the Apache License 2.0 (the "License"). You may not use
5 * this file except in compliance with the License. You can obtain a copy
6 * in the file LICENSE in the source distribution or at
7 * https://www.openssl.org/source/license.html
10 #ifndef OSSL_QUIC_RECORD_UTIL_H
11 # define OSSL_QUIC_RECORD_UTIL_H
13 # include <openssl/ssl.h>
16 * QUIC Key Derivation Utilities
17 * =============================
20 /* HKDF-Extract(salt, IKM) (RFC 5869) */
21 int ossl_quic_hkdf_extract(OSSL_LIB_CTX
*libctx
,
24 const unsigned char *salt
, size_t salt_len
,
25 const unsigned char *ikm
, size_t ikm_len
,
26 unsigned char *out
, size_t out_len
);
29 * QUIC Record Layer Ciphersuite Info
30 * ==================================
33 /* Available QUIC Record Layer (QRL) ciphersuites. */
34 # define QRL_SUITE_AES128GCM 1 /* SHA256 */
35 # define QRL_SUITE_AES256GCM 2 /* SHA384 */
36 # define QRL_SUITE_CHACHA20POLY1305 3 /* SHA256 */
38 /* Returns cipher name in bytes or NULL if suite ID is invalid. */
39 const char *ossl_qrl_get_suite_cipher_name(uint32_t suite_id
);
41 /* Returns hash function name in bytes or NULL if suite ID is invalid. */
42 const char *ossl_qrl_get_suite_md_name(uint32_t suite_id
);
44 /* Returns secret length in bytes or 0 if suite ID is invalid. */
45 uint32_t ossl_qrl_get_suite_secret_len(uint32_t suite_id
);
47 /* Returns key length in bytes or 0 if suite ID is invalid. */
48 uint32_t ossl_qrl_get_suite_cipher_key_len(uint32_t suite_id
);
50 /* Returns IV length in bytes or 0 if suite ID is invalid. */
51 uint32_t ossl_qrl_get_suite_cipher_iv_len(uint32_t suite_id
);
53 /* Returns AEAD auth tag length in bytes or 0 if suite ID is invalid. */
54 uint32_t ossl_qrl_get_suite_cipher_tag_len(uint32_t suite_id
);
56 /* Returns a QUIC_HDR_PROT_CIPHER_* value or 0 if suite ID is invalid. */
57 uint32_t ossl_qrl_get_suite_hdr_prot_cipher_id(uint32_t suite_id
);
59 /* Returns header protection key length in bytes or 0 if suite ID is invalid. */
60 uint32_t ossl_qrl_get_suite_hdr_prot_key_len(uint32_t suite_id
);