mbed TLS v2.16.6
hkdf.h
Go to the documentation of this file.
1 
9 /*
10  * Copyright (C) 2016-2019, ARM Limited, All Rights Reserved
11  * SPDX-License-Identifier: GPL-2.0
12  *
13  * This program is free software; you can redistribute it and/or modify
14  * it under the terms of the GNU General Public License as published by
15  * the Free Software Foundation; either version 2 of the License, or
16  * (at your option) any later version.
17  *
18  * This program is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21  * GNU General Public License for more details.
22  *
23  * You should have received a copy of the GNU General Public License along
24  * with this program; if not, write to the Free Software Foundation, Inc.,
25  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
26  *
27  * This file is part of mbed TLS (https://tls.mbed.org)
28  */
29 #ifndef MBEDTLS_HKDF_H
30 #define MBEDTLS_HKDF_H
31 
32 #if !defined(MBEDTLS_CONFIG_FILE)
33 #include "config.h"
34 #else
35 #include MBEDTLS_CONFIG_FILE
36 #endif
37 
38 #include "md.h"
39 
44 #define MBEDTLS_ERR_HKDF_BAD_INPUT_DATA -0x5F80
45 /* \} name */
46 
47 #ifdef __cplusplus
48 extern "C" {
49 #endif
50 
75 int mbedtls_hkdf( const mbedtls_md_info_t *md, const unsigned char *salt,
76  size_t salt_len, const unsigned char *ikm, size_t ikm_len,
77  const unsigned char *info, size_t info_len,
78  unsigned char *okm, size_t okm_len );
79 
105  const unsigned char *salt, size_t salt_len,
106  const unsigned char *ikm, size_t ikm_len,
107  unsigned char *prk );
108 
135 int mbedtls_hkdf_expand( const mbedtls_md_info_t *md, const unsigned char *prk,
136  size_t prk_len, const unsigned char *info,
137  size_t info_len, unsigned char *okm, size_t okm_len );
138 
139 #ifdef __cplusplus
140 }
141 #endif
142 
143 #endif /* hkdf.h */
int mbedtls_hkdf(const mbedtls_md_info_t *md, const unsigned char *salt, size_t salt_len, const unsigned char *ikm, size_t ikm_len, const unsigned char *info, size_t info_len, unsigned char *okm, size_t okm_len)
This is the HMAC-based Extract-and-Expand Key Derivation Function (HKDF).
Configuration options (set of defines)
int mbedtls_hkdf_expand(const mbedtls_md_info_t *md, const unsigned char *prk, size_t prk_len, const unsigned char *info, size_t info_len, unsigned char *okm, size_t okm_len)
Expand the supplied prk into several additional pseudorandom keys, which is the output of the HKDF...
int mbedtls_hkdf_extract(const mbedtls_md_info_t *md, const unsigned char *salt, size_t salt_len, const unsigned char *ikm, size_t ikm_len, unsigned char *prk)
Take the input keying material ikm and extract from it a fixed-length pseudorandom key prk...
This file contains the generic message-digest wrapper.
struct mbedtls_md_info_t mbedtls_md_info_t
Definition: md.h:82
#define md
Definition: compat-1.3.h:1990