lsquic_hkdf.h revision 92f6e17b
1/* Copyright (c) 2017 - 2019 LiteSpeed Technologies Inc.  See LICENSE. */
2#ifndef LSQUIC_HKDF_H
3#define LSQUIC_HKDF_H 1
4
5/* [draft-ietf-quic-tls-23] Section 5.2 */
6#define HSK_SALT_BUF "\xc3\xee\xf7\x12\xc7\x2e\xbb\x5a\x11\xa7" \
7                     "\xd2\x43\x2b\xb4\x63\x65\xbe\xf9\xf5\x02"
8#define HSK_SALT ((unsigned char *) HSK_SALT_BUF)
9#define HSK_SALT_SZ (sizeof(HSK_SALT_BUF) - 1)
10
11#define CLIENT_LABEL "client in"
12#define CLIENT_LABEL_SZ (sizeof(CLIENT_LABEL) - 1)
13#define SERVER_LABEL "server in"
14#define SERVER_LABEL_SZ (sizeof(SERVER_LABEL) - 1)
15
16void
17lsquic_qhkdf_expand (const struct env_md_st *, const unsigned char *secret,
18            unsigned secret_len, const char *label, uint8_t label_len,
19            unsigned char *out, uint16_t out_len);
20
21#endif
22