mbed TLS library

Dependents:   HTTPClient-SSL WS_SERVER

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers pbkdf2.c Source File

pbkdf2.c

Go to the documentation of this file.
00001 /**
00002  * \file pbkdf2.c
00003  *
00004  * \brief Compatibility wrappers for pkcs5.c
00005  *
00006  * \author Mathias Olsson <mathias@kompetensum.com>
00007  *
00008  *  Copyright (C) 2006-2014, ARM Limited, All Rights Reserved
00009  *
00010  *  This file is part of mbed TLS (https://tls.mbed.org)
00011  *
00012  *  This program is free software; you can redistribute it and/or modify
00013  *  it under the terms of the GNU General Public License as published by
00014  *  the Free Software Foundation; either version 2 of the License, or
00015  *  (at your option) any later version.
00016  *
00017  *  This program is distributed in the hope that it will be useful,
00018  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00019  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00020  *  GNU General Public License for more details.
00021  *
00022  *  You should have received a copy of the GNU General Public License along
00023  *  with this program; if not, write to the Free Software Foundation, Inc.,
00024  *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
00025  */
00026 /*
00027  * PBKDF2 is part of PKCS#5
00028  *
00029  * http://tools.ietf.org/html/rfc2898 (Specification)
00030  * http://tools.ietf.org/html/rfc6070 (Test vectors)
00031  */
00032 
00033 #if !defined(POLARSSL_CONFIG_FILE)
00034 #include "polarssl/config.h"
00035 #else
00036 #include POLARSSL_CONFIG_FILE
00037 #endif
00038 
00039 #if defined(POLARSSL_PBKDF2_C)
00040 
00041 #include "polarssl/pbkdf2.h"
00042 #include "polarssl/pkcs5.h"
00043 
00044 #if ! defined(POLARSSL_DEPRECATED_REMOVED)
00045 int pbkdf2_hmac( md_context_t *ctx, const unsigned char *password, size_t plen,
00046                  const unsigned char *salt, size_t slen,
00047                  unsigned int iteration_count,
00048                  uint32_t key_length, unsigned char *output )
00049 {
00050     return pkcs5_pbkdf2_hmac( ctx, password, plen, salt, slen, iteration_count,
00051                               key_length, output );
00052 }
00053 #endif
00054 
00055 #if defined(POLARSSL_SELF_TEST)
00056 #if ! defined(POLARSSL_DEPRECATED_REMOVED)
00057 int pbkdf2_self_test( int verbose )
00058 {
00059     return pkcs5_self_test( verbose );
00060 }
00061 #endif
00062 #endif /* POLARSSL_SELF_TEST */
00063 
00064 #endif /* POLARSSL_PBKDF2_C */
00065