lsquic_hkdf.h revision 4051ae3a
17d09751dSDmitri Tikhonov/* Copyright (c) 2017 - 2020 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 */
104051ae3aSDmitri Tikhonov#define HSK_SALT ((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")
135392f7a3SLiteSpeed Tech#define HSK_SALT_SZ (sizeof(HSK_SALT_BUF) - 1)
145392f7a3SLiteSpeed Tech
155392f7a3SLiteSpeed Tech#define CLIENT_LABEL "client in"
165392f7a3SLiteSpeed Tech#define CLIENT_LABEL_SZ (sizeof(CLIENT_LABEL) - 1)
175392f7a3SLiteSpeed Tech#define SERVER_LABEL "server in"
185392f7a3SLiteSpeed Tech#define SERVER_LABEL_SZ (sizeof(SERVER_LABEL) - 1)
195392f7a3SLiteSpeed Tech
205392f7a3SLiteSpeed Techvoid
215392f7a3SLiteSpeed Techlsquic_qhkdf_expand (const struct env_md_st *, const unsigned char *secret,
225392f7a3SLiteSpeed Tech            unsigned secret_len, const char *label, uint8_t label_len,
235392f7a3SLiteSpeed Tech            unsigned char *out, uint16_t out_len);
245392f7a3SLiteSpeed Tech
255392f7a3SLiteSpeed Tech#endif
26