lsquic_hkdf.h revision 5392f7a3
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-22] Section 5.2 */
6#define HSK_SALT_BUF "\x7f\xbc\xdb\x0e\x7c\x66\xbb\xe9\x19\x3a" \
7                     "\x96\xcd\x21\x51\x9e\xbd\x7a\x02\x64\x4a"
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