mbed TLS library

Dependents:   HTTPClient-SSL WS_SERVER

Committer:
ansond
Date:
Thu Jun 11 03:27:03 2015 +0000
Revision:
0:137634ff4186
initial commit

Who changed what in which revision?

UserRevisionLine numberNew contents of line
ansond 0:137634ff4186 1 /**
ansond 0:137634ff4186 2 * \file pbkdf2.h
ansond 0:137634ff4186 3 *
ansond 0:137634ff4186 4 * \brief Password-Based Key Derivation Function 2 (from PKCS#5)
ansond 0:137634ff4186 5 *
ansond 0:137634ff4186 6 * \deprecated Use pkcs5.h instead.
ansond 0:137634ff4186 7 *
ansond 0:137634ff4186 8 * \author Mathias Olsson <mathias@kompetensum.com>
ansond 0:137634ff4186 9 *
ansond 0:137634ff4186 10 * Copyright (C) 2006-2012, ARM Limited, All Rights Reserved
ansond 0:137634ff4186 11 *
ansond 0:137634ff4186 12 * This file is part of mbed TLS (https://tls.mbed.org)
ansond 0:137634ff4186 13 *
ansond 0:137634ff4186 14 * This program is free software; you can redistribute it and/or modify
ansond 0:137634ff4186 15 * it under the terms of the GNU General Public License as published by
ansond 0:137634ff4186 16 * the Free Software Foundation; either version 2 of the License, or
ansond 0:137634ff4186 17 * (at your option) any later version.
ansond 0:137634ff4186 18 *
ansond 0:137634ff4186 19 * This program is distributed in the hope that it will be useful,
ansond 0:137634ff4186 20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
ansond 0:137634ff4186 21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
ansond 0:137634ff4186 22 * GNU General Public License for more details.
ansond 0:137634ff4186 23 *
ansond 0:137634ff4186 24 * You should have received a copy of the GNU General Public License along
ansond 0:137634ff4186 25 * with this program; if not, write to the Free Software Foundation, Inc.,
ansond 0:137634ff4186 26 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
ansond 0:137634ff4186 27 */
ansond 0:137634ff4186 28 #ifndef POLARSSL_PBKDF2_H
ansond 0:137634ff4186 29 #define POLARSSL_PBKDF2_H
ansond 0:137634ff4186 30
ansond 0:137634ff4186 31 #include "md.h"
ansond 0:137634ff4186 32
ansond 0:137634ff4186 33 #include <stddef.h>
ansond 0:137634ff4186 34
ansond 0:137634ff4186 35 #if defined(_MSC_VER) && !defined(EFIX64) && !defined(EFI32)
ansond 0:137634ff4186 36 #include <basetsd.h>
ansond 0:137634ff4186 37 typedef UINT32 uint32_t;
ansond 0:137634ff4186 38 #else
ansond 0:137634ff4186 39 #include <inttypes.h>
ansond 0:137634ff4186 40 #endif
ansond 0:137634ff4186 41
ansond 0:137634ff4186 42 #define POLARSSL_ERR_PBKDF2_BAD_INPUT_DATA -0x007C /**< Bad input parameters to function. */
ansond 0:137634ff4186 43
ansond 0:137634ff4186 44 #ifdef __cplusplus
ansond 0:137634ff4186 45 extern "C" {
ansond 0:137634ff4186 46 #endif
ansond 0:137634ff4186 47
ansond 0:137634ff4186 48 #if ! defined(POLARSSL_DEPRECATED_REMOVED)
ansond 0:137634ff4186 49 #if defined(POLARSSL_DEPRECATED_WARNING)
ansond 0:137634ff4186 50 #define DEPRECATED __attribute__((deprecated))
ansond 0:137634ff4186 51 #else
ansond 0:137634ff4186 52 #define DEPRECATED
ansond 0:137634ff4186 53 #endif
ansond 0:137634ff4186 54 /**
ansond 0:137634ff4186 55 * \brief PKCS#5 PBKDF2 using HMAC
ansond 0:137634ff4186 56 *
ansond 0:137634ff4186 57 * \deprecated Use pkcs5_pbkdf2_hmac() instead
ansond 0:137634ff4186 58 *
ansond 0:137634ff4186 59 * \param ctx Generic HMAC context
ansond 0:137634ff4186 60 * \param password Password to use when generating key
ansond 0:137634ff4186 61 * \param plen Length of password
ansond 0:137634ff4186 62 * \param salt Salt to use when generating key
ansond 0:137634ff4186 63 * \param slen Length of salt
ansond 0:137634ff4186 64 * \param iteration_count Iteration count
ansond 0:137634ff4186 65 * \param key_length Length of generated key
ansond 0:137634ff4186 66 * \param output Generated key. Must be at least as big as key_length
ansond 0:137634ff4186 67 *
ansond 0:137634ff4186 68 * \returns 0 on success, or a POLARSSL_ERR_xxx code if verification fails.
ansond 0:137634ff4186 69 */
ansond 0:137634ff4186 70 int pbkdf2_hmac( md_context_t *ctx, const unsigned char *password,
ansond 0:137634ff4186 71 size_t plen, const unsigned char *salt, size_t slen,
ansond 0:137634ff4186 72 unsigned int iteration_count,
ansond 0:137634ff4186 73 uint32_t key_length, unsigned char *output ) DEPRECATED;
ansond 0:137634ff4186 74
ansond 0:137634ff4186 75 /**
ansond 0:137634ff4186 76 * \brief Checkup routine
ansond 0:137634ff4186 77 *
ansond 0:137634ff4186 78 * \deprecated Use pkcs5_self_test() instead
ansond 0:137634ff4186 79 *
ansond 0:137634ff4186 80 * \return 0 if successful, or 1 if the test failed
ansond 0:137634ff4186 81 */
ansond 0:137634ff4186 82 int pbkdf2_self_test( int verbose ) DEPRECATED;
ansond 0:137634ff4186 83 #undef DEPRECATED
ansond 0:137634ff4186 84 #endif /* POLARSSL_DEPRECATED_REMOVED */
ansond 0:137634ff4186 85
ansond 0:137634ff4186 86 #ifdef __cplusplus
ansond 0:137634ff4186 87 }
ansond 0:137634ff4186 88 #endif
ansond 0:137634ff4186 89
ansond 0:137634ff4186 90 #endif /* pbkdf2.h */
ansond 0:137634ff4186 91