pwdbased.h (3122B)
1 /* pwdbased.h 2 * 3 * Copyright (C) 2006-2025 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 3 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 22 /*! 23 \file wolfssl/wolfcrypt/pwdbased.h 24 */ 25 26 #ifndef WOLF_CRYPT_PWDBASED_H 27 #define WOLF_CRYPT_PWDBASED_H 28 29 #include <wolfssl/wolfcrypt/types.h> 30 31 #ifndef NO_PWDBASED 32 33 34 #ifdef __cplusplus 35 extern "C" { 36 #endif 37 38 #if FIPS_VERSION3_GE(6,0,0) 39 extern const unsigned int wolfCrypt_FIPS_pbkdf_ro_sanity[2]; 40 WOLFSSL_LOCAL int wolfCrypt_FIPS_PBKDF_sanity(void); 41 #endif 42 /* 43 * hashType renamed to typeH to avoid shadowing global declaration here: 44 * wolfssl/wolfcrypt/asn.h line 173 in enum Oid_Types 45 */ 46 WOLFSSL_API int wc_PBKDF1_ex(byte* key, int keyLen, byte* iv, int ivLen, 47 const byte* passwd, int passwdLen, 48 const byte* salt, int saltLen, int iterations, 49 int hashType, void* heap); 50 WOLFSSL_API int wc_PBKDF1(byte* output, const byte* passwd, int pLen, 51 const byte* salt, int sLen, int iterations, int kLen, 52 int typeH); 53 WOLFSSL_API int wc_PBKDF2_ex(byte* output, const byte* passwd, int pLen, 54 const byte* salt, int sLen, int iterations, int kLen, 55 int typeH, void* heap, int devId); 56 WOLFSSL_API int wc_PBKDF2(byte* output, const byte* passwd, int pLen, 57 const byte* salt, int sLen, int iterations, int kLen, 58 int typeH); 59 WOLFSSL_API int wc_PKCS12_PBKDF(byte* output, const byte* passwd, int pLen, 60 const byte* salt, int sLen, int iterations, 61 int kLen, int typeH, int purpose); 62 WOLFSSL_API int wc_PKCS12_PBKDF_ex(byte* output, const byte* passwd,int passLen, 63 const byte* salt, int saltLen, int iterations, int kLen, 64 int hashType, int id, void* heap); 65 66 #ifdef HAVE_SCRYPT 67 WOLFSSL_API int wc_scrypt(byte* output, const byte* passwd, int passLen, 68 const byte* salt, int saltLen, int cost, 69 int blockSize, int parallel, int dkLen); 70 WOLFSSL_API int wc_scrypt_ex(byte* output, const byte* passwd, int passLen, 71 const byte* salt, int saltLen, word32 iterations, 72 int blockSize, int parallel, int dkLen); 73 #endif 74 75 76 #ifdef __cplusplus 77 } /* extern "C" */ 78 #endif 79 80 #endif /* NO_PWDBASED */ 81 #endif /* WOLF_CRYPT_PWDBASED_H */