1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-12-19 03:23:49 +01:00
RIOT/sys/include/hashes/pbkdf2.h
Marian Buschsieweke cac44edec7
tree-wide: replace multiple empty lines with one
For each C source/header `$file`: `sed -e '/^$/N;/^\n$/D' -i $file`.
2025-05-21 22:51:04 +02:00

58 lines
1.5 KiB
C
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*
* Copyright (C) 2019 Freie Universität Berlin
*
* This file is subject to the terms and conditions of the GNU Lesser
* General Public License v2.1. See the file LICENSE in the top level
* directory for more details.
*/
#pragma once
/**
* @defgroup sys_hashes_pbkdf2 PBKDF2
* @ingroup sys_hashes
* @brief PBKDF2 key derivation implementation.
* @{
*
* @file
* @brief PBKDF2 key derivation implementation.
*
* @author Juan I Carrano <j.carrano@fu-berlin.de>
*
* @}
*/
#include "hashes/sha256.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* @brief PBKDF2 key size length
*
* @note Currently only one derived key length is supported (32)
*/
#define PBKDF2_KEY_SIZE SHA256_DIGEST_LENGTH
/**
* @brief Create a key from a password and hash using PBKDF2.
*
* @param[in] password password pointer
* @param[in] password_len length of password
* @param[in] salt salt pointer
* @param[in] salt_len salt length, recommended 64bit
* @param[in] iterations number of rounds. Must be >1.
* NISTs detailed guide (Appendix A.2.2),
* recommended 10000
* @param[out] output array of size PBKDF2_KEY_SIZE
*/
void pbkdf2_sha256(const void *password, size_t password_len,
const void *salt, size_t salt_len,
int iterations,
uint8_t *output);
#ifdef __cplusplus
}
#endif