Mbed TLS v3.5.2
Loading...
Searching...
No Matches
pkcs5.h
Go to the documentation of this file.
1
8/*
9 * Copyright The Mbed TLS Contributors
10 * SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
11 */
12#ifndef MBEDTLS_PKCS5_H
13#define MBEDTLS_PKCS5_H
14
15#include "mbedtls/build_info.h"
17
18#include "mbedtls/asn1.h"
19#include "mbedtls/md.h"
20
21#include <stddef.h>
22#include <stdint.h>
23
25#define MBEDTLS_ERR_PKCS5_BAD_INPUT_DATA -0x2f80
27#define MBEDTLS_ERR_PKCS5_INVALID_FORMAT -0x2f00
29#define MBEDTLS_ERR_PKCS5_FEATURE_UNAVAILABLE -0x2e80
31#define MBEDTLS_ERR_PKCS5_PASSWORD_MISMATCH -0x2e00
32
33#define MBEDTLS_PKCS5_DECRYPT 0
34#define MBEDTLS_PKCS5_ENCRYPT 1
35
36#ifdef __cplusplus
37extern "C" {
38#endif
39
40#if defined(MBEDTLS_ASN1_PARSE_C)
41
42#if !defined(MBEDTLS_DEPRECATED_REMOVED)
84 const unsigned char *pwd, size_t pwdlen,
85 const unsigned char *data, size_t datalen,
86 unsigned char *output);
87#endif /* MBEDTLS_DEPRECATED_REMOVED */
88
89#if defined(MBEDTLS_CIPHER_PADDING_PKCS7)
90
124int mbedtls_pkcs5_pbes2_ext(const mbedtls_asn1_buf *pbe_params, int mode,
125 const unsigned char *pwd, size_t pwdlen,
126 const unsigned char *data, size_t datalen,
127 unsigned char *output, size_t output_size,
128 size_t *output_len);
129
130#endif /* MBEDTLS_CIPHER_PADDING_PKCS7 */
131
132#endif /* MBEDTLS_ASN1_PARSE_C */
133
149 const unsigned char *password,
150 size_t plen, const unsigned char *salt, size_t slen,
151 unsigned int iteration_count,
152 uint32_t key_length, unsigned char *output);
153
154#if defined(MBEDTLS_MD_C)
155#if !defined(MBEDTLS_DEPRECATED_REMOVED)
173 const unsigned char *password,
174 size_t plen,
175 const unsigned char *salt,
176 size_t slen,
177 unsigned int iteration_count,
178 uint32_t key_length,
179 unsigned char *output);
180#endif /* !MBEDTLS_DEPRECATED_REMOVED */
181#endif /* MBEDTLS_MD_C */
182#if defined(MBEDTLS_SELF_TEST)
183
189int mbedtls_pkcs5_self_test(int verbose);
190
191#endif /* MBEDTLS_SELF_TEST */
192
193#ifdef __cplusplus
194}
195#endif
196
197#endif /* pkcs5.h */
Generic ASN.1 parsing.
Build-time configuration info.
This file contains the generic functions for message-digest (hashing) and HMAC.
mbedtls_md_type_t
Supported message digests.
Definition md.h:161
int mbedtls_pkcs5_pbkdf2_hmac_ext(mbedtls_md_type_t md_type, const unsigned char *password, size_t plen, const unsigned char *salt, size_t slen, unsigned int iteration_count, uint32_t key_length, unsigned char *output)
PKCS#5 PBKDF2 using HMAC without using the HMAC context.
int mbedtls_pkcs5_pbes2_ext(const mbedtls_asn1_buf *pbe_params, int mode, const unsigned char *pwd, size_t pwdlen, const unsigned char *data, size_t datalen, unsigned char *output, size_t output_size, size_t *output_len)
PKCS#5 PBES2 function.
int mbedtls_pkcs5_self_test(int verbose)
Checkup routine.
int MBEDTLS_DEPRECATED mbedtls_pkcs5_pbes2(const mbedtls_asn1_buf *pbe_params, int mode, const unsigned char *pwd, size_t pwdlen, const unsigned char *data, size_t datalen, unsigned char *output)
PKCS#5 PBES2 function.
int MBEDTLS_DEPRECATED mbedtls_pkcs5_pbkdf2_hmac(mbedtls_md_context_t *ctx, const unsigned char *password, size_t plen, const unsigned char *salt, size_t slen, unsigned int iteration_count, uint32_t key_length, unsigned char *output)
PKCS#5 PBKDF2 using HMAC.
Common and shared functions used by multiple modules in the Mbed TLS library.
#define MBEDTLS_DEPRECATED