Lightweight Cryptography Primitives
 All Data Structures Files Functions Variables Typedefs Macros Pages
Macros | Functions
sparkle-pbkdf2.h File Reference

Password-based key derivation function based on SPARKLE-HMAC. More...

#include <stddef.h>

Go to the source code of this file.

Macros

#define ESCH_256_PBKDF2_SIZE   32
 Default output block size for Esch256-PBKDF2. Key material is generated in blocks of this size.
 
#define ESCH_384_PBKDF2_SIZE   48
 Default output block size for Esch384-PBKDF2. Key material is generated in blocks of this size.
 

Functions

void esch_256_pbkdf2 (unsigned char *out, size_t outlen, const unsigned char *password, size_t passwordlen, const unsigned char *salt, size_t saltlen, unsigned long count)
 Derives key material using Esch256-PBKDF2. More...
 
void esch_384_pbkdf2 (unsigned char *out, size_t outlen, const unsigned char *password, size_t passwordlen, const unsigned char *salt, size_t saltlen, unsigned long count)
 Derives key material using Esch384-PBKDF2. More...
 

Detailed Description

Password-based key derivation function based on SPARKLE-HMAC.

Reference: https://tools.ietf.org/html/rfc8018

Function Documentation

void esch_256_pbkdf2 ( unsigned char *  out,
size_t  outlen,
const unsigned char *  password,
size_t  passwordlen,
const unsigned char *  salt,
size_t  saltlen,
unsigned long  count 
)

Derives key material using Esch256-PBKDF2.

Parameters
outPoints to the output buffer to receive the key material.
outlenNumber of bytes of key material to generate.
passwordPoints to the bytes of the password.
passwordlenNumber of bytes in the password.
saltPoints to the bytes of the salt.
saltlenNumber of bytes in the salt.
countNumber of iterations to perform. If this is set to zero, then the value will be changed to 1.

This function can generate a maximum of (2^32 - 1) * ESCH_256_PBKDF2_SIZE bytes, but this limit is not checked. The count value should be large enough to provide resistance against dictionary attacks on the password.

void esch_384_pbkdf2 ( unsigned char *  out,
size_t  outlen,
const unsigned char *  password,
size_t  passwordlen,
const unsigned char *  salt,
size_t  saltlen,
unsigned long  count 
)

Derives key material using Esch384-PBKDF2.

Parameters
outPoints to the output buffer to receive the key material.
outlenNumber of bytes of key material to generate.
passwordPoints to the bytes of the password.
passwordlenNumber of bytes in the password.
saltPoints to the bytes of the salt.
saltlenNumber of bytes in the salt.
countNumber of iterations to perform. If this is set to zero, then the value will be changed to 1.

This function can generate a maximum of (2^32 - 1) * ESCH_384_PBKDF2_SIZE bytes, but this limit is not checked. The count value should be large enough to provide resistance against dictionary attacks on the password.