Loading...
Searching...
No Matches
pbkdf2.h File Reference

PBKDF2 key derivation implementation. More...

Detailed Description

PBKDF2 key derivation implementation.

Author
Juan I Carrano j.car.nosp@m.rano.nosp@m.@fu-b.nosp@m.erli.nosp@m.n.de

Definition in file pbkdf2.h.

#include "hashes/sha256.h"
+ Include dependency graph for pbkdf2.h:

Go to the source code of this file.

Macros

#define PBKDF2_KEY_SIZE   SHA256_DIGEST_LENGTH
 PBKDF2 key size length.
 

Functions

void pbkdf2_sha256 (const void *password, size_t password_len, const void *salt, size_t salt_len, int iterations, uint8_t *output)
 Create a key from a password and hash using PBKDF2.
 

Macro Definition Documentation

◆ PBKDF2_KEY_SIZE

#define PBKDF2_KEY_SIZE   SHA256_DIGEST_LENGTH

PBKDF2 key size length.

Note
Currently only one derived key length is supported (32)

Definition at line 36 of file pbkdf2.h.

Function Documentation

◆ pbkdf2_sha256()

void pbkdf2_sha256 ( const void *  password,
size_t  password_len,
const void *  salt,
size_t  salt_len,
int  iterations,
uint8_t *  output 
)

Create a key from a password and hash using PBKDF2.

Parameters
[in]passwordpassword pointer
[in]password_lenlength of password
[in]saltsalt pointer
[in]salt_lensalt length, recommended 64bit
[in]iterationsnumber of rounds. Must be >1. NIST’s detailed guide (Appendix A.2.2), recommended 10000
[out]outputarray of size PBKDF2_KEY_SIZE