Documentation

Documentation

Includes

config.h

#include "config.h"
#include "config.h"

MBEDTLS_CONFIG_FILE

#include MBEDTLS_CONFIG_FILE
#include MBEDTLS_CONFIG_FILE

asn1.h

#include "asn1.h"
#include "asn1.h"

md.h

#include "md.h"
#include "md.h"

stddef.h

#include <stddef.h>
#include 

stdint.h

#include <stdint.h>
#include 

Macros

Marco MBEDTLS_PKCS5_H

#define MBEDTLS_PKCS5_H


      

Marco MBEDTLS_ERR_PKCS5_BAD_INPUT_DATA

#define MBEDTLS_ERR_PKCS5_BAD_INPUT_DATA                 -12160 /**< Bad input parameters to function. */


      

Marco MBEDTLS_ERR_PKCS5_INVALID_FORMAT

#define MBEDTLS_ERR_PKCS5_INVALID_FORMAT                 -12032 /**< Unexpected ASN.1 data. */


      

Marco MBEDTLS_ERR_PKCS5_FEATURE_UNAVAILABLE

#define MBEDTLS_ERR_PKCS5_FEATURE_UNAVAILABLE            -2e80 /**< Requested encryption or digest alg not available. */


      

Marco MBEDTLS_ERR_PKCS5_PASSWORD_MISMATCH

#define MBEDTLS_ERR_PKCS5_PASSWORD_MISMATCH              -2e00 /**< Given private key password does not allow for correct decryption. */


      

Marco MBEDTLS_PKCS5_DECRYPT

#define MBEDTLS_PKCS5_DECRYPT     0


      

Marco MBEDTLS_PKCS5_ENCRYPT

#define MBEDTLS_PKCS5_ENCRYPT     1

      

Functions

Func mbedtls_pkcs5_pbes2

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 );
/**
 * \brief          PKCS#5 PBES2 function
 *
 * \param pbe_params the ASN.1 algorithm parameters
 * \param mode       either MBEDTLS_PKCS5_DECRYPT or MBEDTLS_PKCS5_ENCRYPT
 * \param pwd        password to use when generating key
 * \param pwdlen     length of password
 * \param data       data to process
 * \param datalen    length of data
 * \param output     output buffer
 *
 * \returns        0 on success, or a MBEDTLS_ERR_XXX code if verification fails.
 */

Func mbedtls_pkcs5_pbkdf2_hmac

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 );
/**
 * \brief          PKCS#5 PBKDF2 using HMAC
 *
 * \param ctx      Generic HMAC context
 * \param password Password to use when generating key
 * \param plen     Length of password
 * \param salt     Salt to use when generating key
 * \param slen     Length of salt
 * \param iteration_count       Iteration count
 * \param key_length            Length of generated key in bytes
 * \param output   Generated key. Must be at least as big as key_length
 *
 * \returns        0 on success, or a MBEDTLS_ERR_XXX code if verification fails.
 */

Func mbedtls_pkcs5_self_test

int mbedtls_pkcs5_self_test( int verbose );
/**
 * \brief          Checkup routine
 *
 * \return         0 if successful, or 1 if the test failed
 */

Vars

Consts

Types

Typedefs