pbkdf2.h 658 B

12345678910111213141516171819202122232425262728
  1. // ECOin - Copyright (c) - 2014/2022 - GPLv3 - epsylon@riseup.net (https://03c8.net)
  2. #ifndef PBKDF2_H
  3. #define PBKDF2_H
  4. #include <openssl/sha.h>
  5. #include <stdint.h>
  6. typedef struct HMAC_SHA256Context {
  7. SHA256_CTX ictx;
  8. SHA256_CTX octx;
  9. } HMAC_SHA256_CTX;
  10. void
  11. HMAC_SHA256_Init(HMAC_SHA256_CTX * ctx, const void * _K, size_t Klen);
  12. void
  13. HMAC_SHA256_Update(HMAC_SHA256_CTX * ctx, const void *in, size_t len);
  14. void
  15. HMAC_SHA256_Final(unsigned char digest[32], HMAC_SHA256_CTX * ctx);
  16. void
  17. PBKDF2_SHA256(const uint8_t * passwd, size_t passwdlen, const uint8_t * salt,
  18. size_t saltlen, uint64_t c, uint8_t * buf, size_t dkLen);
  19. #endif // PBKDF2_H