lsquic_hkdf.h revision 26e8f082
106b2a236SDmitri Tikhonov/* Copyright (c) 2017 - 2021 LiteSpeed Technologies Inc.  See LICENSE. */
25392f7a3SLiteSpeed Tech#ifndef LSQUIC_HKDF_H
35392f7a3SLiteSpeed Tech#define LSQUIC_HKDF_H 1
45392f7a3SLiteSpeed Tech
592f6e17bSDmitri Tikhonov/* [draft-ietf-quic-tls-23] Section 5.2 */
692f6e17bSDmitri Tikhonov#define HSK_SALT_BUF "\xc3\xee\xf7\x12\xc7\x2e\xbb\x5a\x11\xa7" \
792f6e17bSDmitri Tikhonov                     "\xd2\x43\x2b\xb4\x63\x65\xbe\xf9\xf5\x02"
84051ae3aSDmitri Tikhonov#define HSK_SALT_PRE29 ((unsigned char *) HSK_SALT_BUF)
94051ae3aSDmitri Tikhonov/* [draft-ietf-quic-tls-29] Section 5.2 */
1026e8f082SDmitri Tikhonov#define HSK_SALT_PRE33 ((unsigned char *) \
114051ae3aSDmitri Tikhonov                     "\xaf\xbf\xec\x28\x99\x93\xd2\x4c\x9e\x97" \
124051ae3aSDmitri Tikhonov                     "\x86\xf1\x9c\x61\x11\xe0\x43\x90\xa8\x99")
1326e8f082SDmitri Tikhonov/* [draft-ietf-quic-tls-33] Section 5.2 */
1426e8f082SDmitri Tikhonov#define HSK_SALT ((unsigned char *) \
1526e8f082SDmitri Tikhonov                     "\x38\x76\x2c\xf7\xf5\x59\x34\xb3\x4d\x17" \
1626e8f082SDmitri Tikhonov                     "\x9a\xe6\xa4\xc8\x0c\xad\xcc\xbb\x7f\x0a")
175392f7a3SLiteSpeed Tech#define HSK_SALT_SZ (sizeof(HSK_SALT_BUF) - 1)
185392f7a3SLiteSpeed Tech
195392f7a3SLiteSpeed Tech#define CLIENT_LABEL "client in"
205392f7a3SLiteSpeed Tech#define CLIENT_LABEL_SZ (sizeof(CLIENT_LABEL) - 1)
215392f7a3SLiteSpeed Tech#define SERVER_LABEL "server in"
225392f7a3SLiteSpeed Tech#define SERVER_LABEL_SZ (sizeof(SERVER_LABEL) - 1)
235392f7a3SLiteSpeed Tech
245392f7a3SLiteSpeed Techvoid
255392f7a3SLiteSpeed Techlsquic_qhkdf_expand (const struct env_md_st *, const unsigned char *secret,
265392f7a3SLiteSpeed Tech            unsigned secret_len, const char *label, uint8_t label_len,
275392f7a3SLiteSpeed Tech            unsigned char *out, uint16_t out_len);
285392f7a3SLiteSpeed Tech
295392f7a3SLiteSpeed Tech#endif
30