mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
sys/hash/pbkdf2: Accept passwd as void *
instead of uint8_t *
Having to cast a password provided as `const char *` to `const uint8_t *` is a needless pain in the ass when using the API. Hence, fix it by accepting passwords and salts as `const void *` instead.
This commit is contained in:
parent
29812d06cf
commit
e92a7164e3
@ -43,8 +43,8 @@ static void inplace_xor_digests(uint8_t *d1, const uint8_t *d2)
|
||||
}
|
||||
}
|
||||
|
||||
void pbkdf2_sha256(const uint8_t *password, size_t password_len,
|
||||
const uint8_t *salt, size_t salt_len,
|
||||
void pbkdf2_sha256(const void *password, size_t password_len,
|
||||
const void *salt, size_t salt_len,
|
||||
int iterations,
|
||||
uint8_t *output)
|
||||
{
|
||||
|
@ -47,8 +47,8 @@ extern "C" {
|
||||
* recommended 10000
|
||||
* @param[out] output array of size PBKDF2_KEY_SIZE
|
||||
*/
|
||||
void pbkdf2_sha256(const uint8_t *password, size_t password_len,
|
||||
const uint8_t *salt, size_t salt_len,
|
||||
void pbkdf2_sha256(const void *password, size_t password_len,
|
||||
const void *salt, size_t salt_len,
|
||||
int iterations,
|
||||
uint8_t *output);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user