3 * Copyright (C) 2006-2015 wolfSSL Inc.
5 * This file is part of wolfSSL. (formerly known as CyaSSL)
7 * wolfSSL is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * wolfSSL is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
22 #ifndef WOLF_CRYPT_PWDBASED_H
23 #define WOLF_CRYPT_PWDBASED_H
25 #include <wolfssl/wolfcrypt/types.h>
30 #include <wolfssl/wolfcrypt/md5.h> /* for hash type */
33 #include <wolfssl/wolfcrypt/sha.h>
40 * hashType renamed to typeH to avoid shadowing global declation here:
41 * wolfssl/wolfcrypt/asn.h line 173 in enum Oid_Types
43 WOLFSSL_API int wc_PBKDF1(byte* output, const byte* passwd, int pLen,
44 const byte* salt, int sLen, int iterations, int kLen,
46 WOLFSSL_API int wc_PBKDF2(byte* output, const byte* passwd, int pLen,
47 const byte* salt, int sLen, int iterations, int kLen,
49 WOLFSSL_API int wc_PKCS12_PBKDF(byte* output, const byte* passwd, int pLen,
50 const byte* salt, int sLen, int iterations,
51 int kLen, int typeH, int purpose);
53 /* helper functions */
54 WOLFSSL_LOCAL int GetDigestSize(int hashType);
55 WOLFSSL_LOCAL int GetPKCS12HashSizes(int hashType, word32* v, word32* u);
56 WOLFSSL_LOCAL int DoPKCS12Hash(int hashType, byte* buffer, word32 totalLen,
57 byte* Ai, word32 u, int iterations);
64 #endif /* NO_PWDBASED */
65 #endif /* WOLF_CRYPT_PWDBASED_H */