Mbed TLS v3.5.0
pkcs5.h
Go to the documentation of this file.
1 
8 /*
9  * Copyright The Mbed TLS Contributors
10  * SPDX-License-Identifier: Apache-2.0
11  *
12  * Licensed under the Apache License, Version 2.0 (the "License"); you may
13  * not use this file except in compliance with the License.
14  * You may obtain a copy of the License at
15  *
16  * http://www.apache.org/licenses/LICENSE-2.0
17  *
18  * Unless required by applicable law or agreed to in writing, software
19  * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
20  * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
21  * See the License for the specific language governing permissions and
22  * limitations under the License.
23  */
24 #ifndef MBEDTLS_PKCS5_H
25 #define MBEDTLS_PKCS5_H
26 
27 #include "mbedtls/build_info.h"
28 #include "mbedtls/platform_util.h"
29 
30 #include "mbedtls/asn1.h"
31 #include "mbedtls/md.h"
32 
33 #include <stddef.h>
34 #include <stdint.h>
35 
37 #define MBEDTLS_ERR_PKCS5_BAD_INPUT_DATA -0x2f80
39 #define MBEDTLS_ERR_PKCS5_INVALID_FORMAT -0x2f00
41 #define MBEDTLS_ERR_PKCS5_FEATURE_UNAVAILABLE -0x2e80
43 #define MBEDTLS_ERR_PKCS5_PASSWORD_MISMATCH -0x2e00
44 
45 #define MBEDTLS_PKCS5_DECRYPT 0
46 #define MBEDTLS_PKCS5_ENCRYPT 1
47 
48 #ifdef __cplusplus
49 extern "C" {
50 #endif
51 
52 #if defined(MBEDTLS_ASN1_PARSE_C)
53 
54 #if !defined(MBEDTLS_DEPRECATED_REMOVED)
96  const unsigned char *pwd, size_t pwdlen,
97  const unsigned char *data, size_t datalen,
98  unsigned char *output);
99 #endif /* MBEDTLS_DEPRECATED_REMOVED */
100 
101 #if defined(MBEDTLS_CIPHER_PADDING_PKCS7)
102 
136 int mbedtls_pkcs5_pbes2_ext(const mbedtls_asn1_buf *pbe_params, int mode,
137  const unsigned char *pwd, size_t pwdlen,
138  const unsigned char *data, size_t datalen,
139  unsigned char *output, size_t output_size,
140  size_t *output_len);
141 
142 #endif /* MBEDTLS_CIPHER_PADDING_PKCS7 */
143 
144 #endif /* MBEDTLS_ASN1_PARSE_C */
145 
161  const unsigned char *password,
162  size_t plen, const unsigned char *salt, size_t slen,
163  unsigned int iteration_count,
164  uint32_t key_length, unsigned char *output);
165 
166 #if defined(MBEDTLS_MD_C)
167 #if !defined(MBEDTLS_DEPRECATED_REMOVED)
185  const unsigned char *password,
186  size_t plen,
187  const unsigned char *salt,
188  size_t slen,
189  unsigned int iteration_count,
190  uint32_t key_length,
191  unsigned char *output);
192 #endif /* !MBEDTLS_DEPRECATED_REMOVED */
193 #endif /* MBEDTLS_MD_C */
194 #if defined(MBEDTLS_SELF_TEST)
195 
201 int mbedtls_pkcs5_self_test(int verbose);
202 
203 #endif /* MBEDTLS_SELF_TEST */
204 
205 #ifdef __cplusplus
206 }
207 #endif
208 
209 #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:173
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
Definition: platform_util.h:45