mbed TLS library

Dependents:   HTTPClient-SSL WS_SERVER

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers pbkdf2.h Source File

pbkdf2.h

Go to the documentation of this file.
00001 /**
00002  * \file pbkdf2.h
00003  *
00004  * \brief Password-Based Key Derivation Function 2 (from PKCS#5)
00005  *
00006  * \deprecated Use pkcs5.h instead.
00007  *
00008  * \author Mathias Olsson <mathias@kompetensum.com>
00009  *
00010  *  Copyright (C) 2006-2012, ARM Limited, All Rights Reserved
00011  *
00012  *  This file is part of mbed TLS (https://tls.mbed.org)
00013  *
00014  *  This program is free software; you can redistribute it and/or modify
00015  *  it under the terms of the GNU General Public License as published by
00016  *  the Free Software Foundation; either version 2 of the License, or
00017  *  (at your option) any later version.
00018  *
00019  *  This program is distributed in the hope that it will be useful,
00020  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00021  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00022  *  GNU General Public License for more details.
00023  *
00024  *  You should have received a copy of the GNU General Public License along
00025  *  with this program; if not, write to the Free Software Foundation, Inc.,
00026  *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
00027  */
00028 #ifndef POLARSSL_PBKDF2_H
00029 #define POLARSSL_PBKDF2_H
00030 
00031 #include "md.h"
00032 
00033 #include <stddef.h>
00034 
00035 #if defined(_MSC_VER) && !defined(EFIX64) && !defined(EFI32)
00036 #include <basetsd.h>
00037 typedef UINT32 uint32_t;
00038 #else
00039 #include <inttypes.h>
00040 #endif
00041 
00042 #define POLARSSL_ERR_PBKDF2_BAD_INPUT_DATA                 -0x007C  /**< Bad input parameters to function. */
00043 
00044 #ifdef __cplusplus
00045 extern "C" {
00046 #endif
00047 
00048 #if ! defined(POLARSSL_DEPRECATED_REMOVED)
00049 #if defined(POLARSSL_DEPRECATED_WARNING)
00050 #define DEPRECATED    __attribute__((deprecated))
00051 #else
00052 #define DEPRECATED
00053 #endif
00054 /**
00055  * \brief          PKCS#5 PBKDF2 using HMAC
00056  *
00057  * \deprecated     Use pkcs5_pbkdf2_hmac() instead
00058  *
00059  * \param ctx      Generic HMAC context
00060  * \param password Password to use when generating key
00061  * \param plen     Length of password
00062  * \param salt     Salt to use when generating key
00063  * \param slen     Length of salt
00064  * \param iteration_count       Iteration count
00065  * \param key_length            Length of generated key
00066  * \param output   Generated key. Must be at least as big as key_length
00067  *
00068  * \returns        0 on success, or a POLARSSL_ERR_xxx code if verification fails.
00069  */
00070 int pbkdf2_hmac( md_context_t *ctx, const unsigned char *password,
00071                  size_t plen, const unsigned char *salt, size_t slen,
00072                  unsigned int iteration_count,
00073                  uint32_t key_length, unsigned char *output ) DEPRECATED;
00074 
00075 /**
00076  * \brief          Checkup routine
00077  *
00078  * \deprecated     Use pkcs5_self_test() instead
00079  *
00080  * \return         0 if successful, or 1 if the test failed
00081  */
00082 int pbkdf2_self_test( int verbose ) DEPRECATED;
00083 #undef DEPRECATED
00084 #endif /* POLARSSL_DEPRECATED_REMOVED */
00085 
00086 #ifdef __cplusplus
00087 }
00088 #endif
00089 
00090 #endif /* pbkdf2.h */
00091