PBKDF2-HMAC

This is PBKDF2 as described by PKCS#5/RFC2898 with HMAC as the PRF.

Functions

void cf_pbkdf2_hmac(const uint8_t *pw, size_t npw, const uint8_t *salt, size_t nsalt, uint32_t iterations, uint8_t *out, size_t nout, const cf_chash *hash)

This computes PBKDF2-HMAC with the given hash functon.

Parameters:
  • pw – password input buffer.
  • npw – password length.
  • salt – salt input buffer.
  • nsalt – salt length.
  • iterations – non-zero iteration count. Tune this for performance/security tradeoff.
  • out – key material output buffer. nout bytes are written here.
  • nout – key material length.
  • hash – hash function description.