this will allow to generate a KEY + IV based on a password and salt for AES encryption/decryption as example or simply the key for hmac or rsa from text password Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
24 lines
609 B
C
24 lines
609 B
C
/*
|
|
* (C) Copyright 2015 Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
|
|
*
|
|
* Under GPLv2 Only
|
|
*/
|
|
|
|
#ifndef __PBKDF2_H__
|
|
#define __PBKDF2_H__
|
|
|
|
#include <digest.h>
|
|
|
|
int pkcs5_pbkdf2_hmac_sha1(const unsigned char *pwd, size_t pwd_len,
|
|
const unsigned char *salt, size_t salt_len,
|
|
uint32_t iteration,
|
|
uint32_t key_len, unsigned char *buf);
|
|
|
|
int pkcs5_pbkdf2_hmac(struct digest* d,
|
|
const unsigned char *pwd, size_t pwd_len,
|
|
const unsigned char *salt, size_t salt_len,
|
|
uint32_t iteration,
|
|
uint32_t key_len, unsigned char *key);
|
|
|
|
#endif /* __PBKDF2_H__ */
|