Leancrypto 1.7.2
Post-Quantum Cryptographic Library
lc_kdf_dpi.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2022 - 2026, Stephan Mueller <smueller@chronox.de>
3 *
4 * License: see LICENSE file in root directory
5 *
6 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
7 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
8 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ALL OF
9 * WHICH ARE HEREBY DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE
10 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
11 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
12 * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
13 * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
14 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
15 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
16 * USE OF THIS SOFTWARE, EVEN IF NOT ADVISED OF THE POSSIBILITY OF SUCH
17 * DAMAGE.
18 */
19
20#ifndef LC_KDF_DPI_H
21#define LC_KDF_DPI_H
22
23#include "ext_headers.h"
24#include "lc_hash.h"
25#include "lc_hmac.h"
26#include "lc_status.h"
27
28#ifdef __cplusplus
29extern "C" {
30#endif
31
47int lc_kdf_dpi_init(struct lc_hmac_ctx *hmac_ctx, const uint8_t *key,
48 size_t keylen);
49
66int lc_kdf_dpi_generate(struct lc_hmac_ctx *hmac_ctx, const uint8_t *label,
67 size_t labellen, uint8_t *dst, size_t dlen);
68
85int lc_kdf_dpi(const struct lc_hash *hash, const uint8_t *key, size_t keylen,
86 const uint8_t *label, size_t labellen, uint8_t *dst,
87 size_t dlen);
88
98
99#ifdef __cplusplus
100}
101#endif
102
103#endif /* LC_KDF_DPI_H */
int lc_hash(const struct lc_hash *hash, const uint8_t *in, size_t inlen, uint8_t *digest)
Calculate message digest - one-shot.
int lc_kdf_dpi_generate(struct lc_hmac_ctx *hmac_ctx, const uint8_t *label, size_t labellen, uint8_t *dst, size_t dlen)
Key-based Key Derivation in Double-Pipeline Mode - SP800-108 - data generation.
int lc_kdf_dpi_init(struct lc_hmac_ctx *hmac_ctx, const uint8_t *key, size_t keylen)
Key-based Key Derivation in Double-Pipeline Mode - SP800-108 - initialization.
int lc_kdf_dpi(const struct lc_hash *hash, const uint8_t *key, size_t keylen, const uint8_t *label, size_t labellen, uint8_t *dst, size_t dlen)
One-Shot Key-based Key Derivation in Double-Pipeline Mode - SP800-108.
enum lc_alg_status_val lc_kdf_dpi_alg_status(const struct lc_hash *hash)
Obtain algorithm status.
lc_alg_status_val
Definition: lc_status.h:63