pwdbased.h 2.9 KB

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