lsquic_hkdf.h revision 5392f7a3
15392f7a3SLiteSpeed Tech/* Copyright (c) 2017 - 2019 LiteSpeed Technologies Inc.  See LICENSE. */
25392f7a3SLiteSpeed Tech#ifndef LSQUIC_HKDF_H
35392f7a3SLiteSpeed Tech#define LSQUIC_HKDF_H 1
45392f7a3SLiteSpeed Tech
55392f7a3SLiteSpeed Tech/* [draft-ietf-quic-tls-22] Section 5.2 */
65392f7a3SLiteSpeed Tech#define HSK_SALT_BUF "\x7f\xbc\xdb\x0e\x7c\x66\xbb\xe9\x19\x3a" \
75392f7a3SLiteSpeed Tech                     "\x96\xcd\x21\x51\x9e\xbd\x7a\x02\x64\x4a"
85392f7a3SLiteSpeed Tech#define HSK_SALT ((unsigned char *) HSK_SALT_BUF)
95392f7a3SLiteSpeed Tech#define HSK_SALT_SZ (sizeof(HSK_SALT_BUF) - 1)
105392f7a3SLiteSpeed Tech
115392f7a3SLiteSpeed Tech#define CLIENT_LABEL "client in"
125392f7a3SLiteSpeed Tech#define CLIENT_LABEL_SZ (sizeof(CLIENT_LABEL) - 1)
135392f7a3SLiteSpeed Tech#define SERVER_LABEL "server in"
145392f7a3SLiteSpeed Tech#define SERVER_LABEL_SZ (sizeof(SERVER_LABEL) - 1)
155392f7a3SLiteSpeed Tech
165392f7a3SLiteSpeed Techvoid
175392f7a3SLiteSpeed Techlsquic_qhkdf_expand (const struct env_md_st *, const unsigned char *secret,
185392f7a3SLiteSpeed Tech            unsigned secret_len, const char *label, uint8_t label_len,
195392f7a3SLiteSpeed Tech            unsigned char *out, uint16_t out_len);
205392f7a3SLiteSpeed Tech
215392f7a3SLiteSpeed Tech#endif
22