wolfSSL 3.11.1 for TLS1.3 beta

Fork of wolfSSL by wolf SSL

Committer:
wolfSSL
Date:
Tue May 02 08:44:47 2017 +0000
Revision:
7:481bce714567
wolfSSL3.10.2

Who changed what in which revision?

UserRevisionLine numberNew contents of line
wolfSSL 7:481bce714567 1 /* pwdbased.h
wolfSSL 7:481bce714567 2 *
wolfSSL 7:481bce714567 3 * Copyright (C) 2006-2016 wolfSSL Inc.
wolfSSL 7:481bce714567 4 *
wolfSSL 7:481bce714567 5 * This file is part of wolfSSL.
wolfSSL 7:481bce714567 6 *
wolfSSL 7:481bce714567 7 * wolfSSL is free software; you can redistribute it and/or modify
wolfSSL 7:481bce714567 8 * it under the terms of the GNU General Public License as published by
wolfSSL 7:481bce714567 9 * the Free Software Foundation; either version 2 of the License, or
wolfSSL 7:481bce714567 10 * (at your option) any later version.
wolfSSL 7:481bce714567 11 *
wolfSSL 7:481bce714567 12 * wolfSSL is distributed in the hope that it will be useful,
wolfSSL 7:481bce714567 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
wolfSSL 7:481bce714567 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
wolfSSL 7:481bce714567 15 * GNU General Public License for more details.
wolfSSL 7:481bce714567 16 *
wolfSSL 7:481bce714567 17 * You should have received a copy of the GNU General Public License
wolfSSL 7:481bce714567 18 * along with this program; if not, write to the Free Software
wolfSSL 7:481bce714567 19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
wolfSSL 7:481bce714567 20 */
wolfSSL 7:481bce714567 21
wolfSSL 7:481bce714567 22
wolfSSL 7:481bce714567 23 #ifndef WOLF_CRYPT_PWDBASED_H
wolfSSL 7:481bce714567 24 #define WOLF_CRYPT_PWDBASED_H
wolfSSL 7:481bce714567 25
wolfSSL 7:481bce714567 26 #include <wolfssl/wolfcrypt/types.h>
wolfSSL 7:481bce714567 27
wolfSSL 7:481bce714567 28 #ifndef NO_PWDBASED
wolfSSL 7:481bce714567 29
wolfSSL 7:481bce714567 30 #ifndef NO_MD5
wolfSSL 7:481bce714567 31 #include <wolfssl/wolfcrypt/md5.h> /* for hash type */
wolfSSL 7:481bce714567 32 #endif
wolfSSL 7:481bce714567 33
wolfSSL 7:481bce714567 34 #include <wolfssl/wolfcrypt/sha.h>
wolfSSL 7:481bce714567 35
wolfSSL 7:481bce714567 36 #ifdef __cplusplus
wolfSSL 7:481bce714567 37 extern "C" {
wolfSSL 7:481bce714567 38 #endif
wolfSSL 7:481bce714567 39
wolfSSL 7:481bce714567 40 /*
wolfSSL 7:481bce714567 41 * hashType renamed to typeH to avoid shadowing global declaration here:
wolfSSL 7:481bce714567 42 * wolfssl/wolfcrypt/asn.h line 173 in enum Oid_Types
wolfSSL 7:481bce714567 43 */
wolfSSL 7:481bce714567 44 WOLFSSL_API int wc_PBKDF1(byte* output, const byte* passwd, int pLen,
wolfSSL 7:481bce714567 45 const byte* salt, int sLen, int iterations, int kLen,
wolfSSL 7:481bce714567 46 int typeH);
wolfSSL 7:481bce714567 47 WOLFSSL_API int wc_PBKDF2(byte* output, const byte* passwd, int pLen,
wolfSSL 7:481bce714567 48 const byte* salt, int sLen, int iterations, int kLen,
wolfSSL 7:481bce714567 49 int typeH);
wolfSSL 7:481bce714567 50 WOLFSSL_API int wc_PKCS12_PBKDF(byte* output, const byte* passwd, int pLen,
wolfSSL 7:481bce714567 51 const byte* salt, int sLen, int iterations,
wolfSSL 7:481bce714567 52 int kLen, int typeH, int purpose);
wolfSSL 7:481bce714567 53 WOLFSSL_API int wc_PKCS12_PBKDF_ex(byte* output, const byte* passwd,int passLen,
wolfSSL 7:481bce714567 54 const byte* salt, int saltLen, int iterations, int kLen,
wolfSSL 7:481bce714567 55 int hashType, int id, void* heap);
wolfSSL 7:481bce714567 56
wolfSSL 7:481bce714567 57 #ifdef HAVE_SCRYPT
wolfSSL 7:481bce714567 58 WOLFSSL_API int wc_scrypt(byte* output, const byte* passwd, int passLen,
wolfSSL 7:481bce714567 59 const byte* salt, int saltLen, int cost,
wolfSSL 7:481bce714567 60 int blockSize, int parallel, int dkLen);
wolfSSL 7:481bce714567 61 #endif
wolfSSL 7:481bce714567 62
wolfSSL 7:481bce714567 63 /* helper functions */
wolfSSL 7:481bce714567 64 WOLFSSL_LOCAL int GetDigestSize(int typeH);
wolfSSL 7:481bce714567 65 WOLFSSL_LOCAL int GetPKCS12HashSizes(int typeH, word32* v, word32* u);
wolfSSL 7:481bce714567 66 WOLFSSL_LOCAL int DoPKCS12Hash(int typeH, byte* buffer, word32 totalLen,
wolfSSL 7:481bce714567 67 byte* Ai, word32 u, int iterations);
wolfSSL 7:481bce714567 68
wolfSSL 7:481bce714567 69
wolfSSL 7:481bce714567 70 #ifdef __cplusplus
wolfSSL 7:481bce714567 71 } /* extern "C" */
wolfSSL 7:481bce714567 72 #endif
wolfSSL 7:481bce714567 73
wolfSSL 7:481bce714567 74 #endif /* NO_PWDBASED */
wolfSSL 7:481bce714567 75 #endif /* WOLF_CRYPT_PWDBASED_H */
wolfSSL 7:481bce714567 76