#import "macros.h"
Go to the source code of this file.
|
void | of_pbkdf2 (OFHMAC *HMAC, size_t iterations, const unsigned char *salt, size_t saltLength, const char *password, size_t passwordLength, unsigned char *key, size_t keyLength) |
| Derive a key from a password and a salt. More...
|
|
◆ of_pbkdf2()
void of_pbkdf2 |
( |
OFHMAC * |
HMAC, |
|
|
size_t |
iterations, |
|
|
const unsigned char * |
salt, |
|
|
size_t |
saltLength, |
|
|
const char * |
password, |
|
|
size_t |
passwordLength, |
|
|
unsigned char * |
key, |
|
|
size_t |
keyLength |
|
) |
| |
Derive a key from a password and a salt.
- Note
- This will call reset (OFHMAC) on the OFHMAC first, making it possible to reuse the OFHMAC, but also meaning all previous results from the OFHMAC get invalidated if they have not been copied.
- Parameters
-
HMAC | The HMAC to use to derive a key |
iterations | The number of iterations to perform |
salt | The salt to derive a key with |
saltLength | The length of the salt |
password | The password to derive a key from |
passwordLength | The length of the password |
key | The buffer to write the key to |
keyLength | The desired length for the derived key (key needs to have enough storage) |