ReactOS 0.4.15-dev-7953-g1f49173
hkdf.h
Go to the documentation of this file.
1
9/*
10 * Copyright The Mbed TLS Contributors
11 * SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
12 *
13 * This file is provided under the Apache License 2.0, or the
14 * GNU General Public License v2.0 or later.
15 *
16 * **********
17 * Apache License 2.0:
18 *
19 * Licensed under the Apache License, Version 2.0 (the "License"); you may
20 * not use this file except in compliance with the License.
21 * You may obtain a copy of the License at
22 *
23 * http://www.apache.org/licenses/LICENSE-2.0
24 *
25 * Unless required by applicable law or agreed to in writing, software
26 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
27 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
28 * See the License for the specific language governing permissions and
29 * limitations under the License.
30 *
31 * **********
32 *
33 * **********
34 * GNU General Public License v2.0 or later:
35 *
36 * This program is free software; you can redistribute it and/or modify
37 * it under the terms of the GNU General Public License as published by
38 * the Free Software Foundation; either version 2 of the License, or
39 * (at your option) any later version.
40 *
41 * This program is distributed in the hope that it will be useful,
42 * but WITHOUT ANY WARRANTY; without even the implied warranty of
43 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
44 * GNU General Public License for more details.
45 *
46 * You should have received a copy of the GNU General Public License along
47 * with this program; if not, write to the Free Software Foundation, Inc.,
48 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
49 *
50 * **********
51 */
52#ifndef MBEDTLS_HKDF_H
53#define MBEDTLS_HKDF_H
54
55#if !defined(MBEDTLS_CONFIG_FILE)
56#include "config.h"
57#else
58#include MBEDTLS_CONFIG_FILE
59#endif
60
61#include "md.h"
62
67#define MBEDTLS_ERR_HKDF_BAD_INPUT_DATA -0x5F80
68/* \} name */
69
70#ifdef __cplusplus
71extern "C" {
72#endif
73
98int mbedtls_hkdf( const mbedtls_md_info_t *md, const unsigned char *salt,
99 size_t salt_len, const unsigned char *ikm, size_t ikm_len,
100 const unsigned char *info, size_t info_len,
101 unsigned char *okm, size_t okm_len );
102
128 const unsigned char *salt, size_t salt_len,
129 const unsigned char *ikm, size_t ikm_len,
130 unsigned char *prk );
131
158int mbedtls_hkdf_expand( const mbedtls_md_info_t *md, const unsigned char *prk,
159 size_t prk_len, const unsigned char *info,
160 size_t info_len, unsigned char *okm, size_t okm_len );
161
162#ifdef __cplusplus
163}
164#endif
165
166#endif /* hkdf.h */
#define md
Definition: compat-1.3.h:2013
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.
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).
This file contains the generic message-digest wrapper.