RetroArch
|
PKCS#5 functions. More...
#include "mbedtls/config.h"
#include "mbedtls/pkcs5.h"
#include "mbedtls/asn1.h"
#include "mbedtls/cipher.h"
#include "mbedtls/oid.h"
#include <string.h>
#include "mbedtls/platform.h"
Macros | |
#define | MAX_TESTS 6 |
Functions | |
static int | pkcs5_parse_pbkdf2_params (const mbedtls_asn1_buf *params, mbedtls_asn1_buf *salt, int *iterations, int *keylen, mbedtls_md_type_t *md_type) |
int | 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. More... | |
int | 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. More... | |
int | mbedtls_pkcs5_self_test (int verbose) |
Checkup routine. More... | |
Variables | |
static const size_t | plen [MAX_TESTS] |
static const unsigned char | password [MAX_TESTS][32] |
static const size_t | slen [MAX_TESTS] |
static const unsigned char | salt [MAX_TESTS][40] |
static const uint32_t | it_cnt [MAX_TESTS] |
static const uint32_t | key_len [MAX_TESTS] |
static const unsigned char | result_key [MAX_TESTS][32] |
PKCS#5 functions.
Copyright (C) 2006-2015, ARM Limited, All Rights Reserved SPDX-License-Identifier: Apache-2.0
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
This file is part of mbed TLS (https://tls.mbed.org)
#define MAX_TESTS 6 |
int 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.
pbe_params | the ASN.1 algorithm parameters |
mode | either MBEDTLS_PKCS5_DECRYPT or MBEDTLS_PKCS5_ENCRYPT |
pwd | password to use when generating key |
pwdlen | length of password |
data | data to process |
datalen | length of data |
output | output buffer |
int 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.
ctx | Generic HMAC context |
password | Password to use when generating key |
plen | Length of password |
salt | Salt to use when generating key |
slen | Length of salt |
iteration_count | Iteration count |
key_length | Length of generated key in bytes |
output | Generated key. Must be at least as big as key_length |
int mbedtls_pkcs5_self_test | ( | int | verbose | ) |
Checkup routine.
|
static |