pwdbased.h
Go to the documentation of this file.
1 /* pwdbased.h
2  *
3  * Copyright (C) 2006-2020 wolfSSL Inc.
4  *
5  * This file is part of wolfSSL.
6  *
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.
11  *
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.
16  *
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-1335, USA
20  */
21 
26 #ifndef WOLF_CRYPT_PWDBASED_H
27 #define WOLF_CRYPT_PWDBASED_H
28 
30 
31 #ifndef NO_PWDBASED
32 
33 
34 #ifdef __cplusplus
35  extern "C" {
36 #endif
37 
38 /*
39  * hashType renamed to typeH to avoid shadowing global declaration here:
40  * wolfssl/wolfcrypt/asn.h line 173 in enum Oid_Types
41  */
42 WOLFSSL_API int wc_PBKDF1_ex(byte* key, int keyLen, byte* iv, int ivLen,
43  const byte* passwd, int passwdLen,
44  const byte* salt, int saltLen, int iterations,
45  int hashType, void* heap);
46 WOLFSSL_API int wc_PBKDF1(byte* output, const byte* passwd, int pLen,
47  const byte* salt, int sLen, int iterations, int kLen,
48  int typeH);
49 WOLFSSL_API int wc_PBKDF2_ex(byte* output, const byte* passwd, int pLen,
50  const byte* salt, int sLen, int iterations, int kLen,
51  int typeH, void* heap, int devId);
52 WOLFSSL_API int wc_PBKDF2(byte* output, const byte* passwd, int pLen,
53  const byte* salt, int sLen, int iterations, int kLen,
54  int typeH);
55 WOLFSSL_API int wc_PKCS12_PBKDF(byte* output, const byte* passwd, int pLen,
56  const byte* salt, int sLen, int iterations,
57  int kLen, int typeH, int purpose);
58 WOLFSSL_API int wc_PKCS12_PBKDF_ex(byte* output, const byte* passwd,int passLen,
59  const byte* salt, int saltLen, int iterations, int kLen,
60  int hashType, int id, void* heap);
61 
62 #ifdef HAVE_SCRYPT
63 WOLFSSL_API int wc_scrypt(byte* output, const byte* passwd, int passLen,
64  const byte* salt, int saltLen, int cost,
65  int blockSize, int parallel, int dkLen);
66 WOLFSSL_API int wc_scrypt_ex(byte* output, const byte* passwd, int passLen,
67  const byte* salt, int saltLen, word32 iterations,
68  int blockSize, int parallel, int dkLen);
69 #endif
70 
71 
72 #ifdef __cplusplus
73  } /* extern "C" */
74 #endif
75 
76 #endif /* NO_PWDBASED */
77 #endif /* WOLF_CRYPT_PWDBASED_H */
WOLFSSL_API int wc_PBKDF1(byte *output, const byte *passwd, int pLen, const byte *salt, int sLen, int iterations, int kLen, int typeH)
This function implements the Password Based Key Derivation Function 1 (PBKDF1), converting an input p...
Definition: pwdbased.c:163
WOLFSSL_API int wc_PKCS12_PBKDF(byte *output, const byte *passwd, int pLen, const byte *salt, int sLen, int iterations, int kLen, int typeH, int purpose)
This function implements the Password Based Key Derivation Function (PBKDF) described in RFC 7292 App...
Definition: pwdbased.c:341
WOLFSSL_API int wc_PBKDF2(byte *output, const byte *passwd, int pLen, const byte *salt, int sLen, int iterations, int kLen, int typeH)
This function implements the Password Based Key Derivation Function 2 (PBKDF2), converting an input p...
Definition: pwdbased.c:273