1
0
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:
Marian Buschsieweke 2022-11-18 13:51:32 +01:00
parent 29812d06cf
commit e92a7164e3
No known key found for this signature in database
GPG Key ID: CB8E3238CE715A94
2 changed files with 4 additions and 4 deletions

View File

@ -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, void pbkdf2_sha256(const void *password, size_t password_len,
const uint8_t *salt, size_t salt_len, const void *salt, size_t salt_len,
int iterations, int iterations,
uint8_t *output) uint8_t *output)
{ {

View File

@ -47,8 +47,8 @@ extern "C" {
* recommended 10000 * recommended 10000
* @param[out] output array of size PBKDF2_KEY_SIZE * @param[out] output array of size PBKDF2_KEY_SIZE
*/ */
void pbkdf2_sha256(const uint8_t *password, size_t password_len, void pbkdf2_sha256(const void *password, size_t password_len,
const uint8_t *salt, size_t salt_len, const void *salt, size_t salt_len,
int iterations, int iterations,
uint8_t *output); uint8_t *output);