PBKDF (Password-Based Key Derivation Function) More...
Go to the source code of this file.
Macros | |
#define | TRACE_LEVEL CRYPTO_TRACE_LEVEL |
Functions | |
error_t | pbkdf1 (const HashAlgo *hash, const uint8_t *p, size_t pLen, const uint8_t *s, size_t sLen, uint_t c, uint8_t *dk, size_t dkLen) |
PBKDF1 key derivation function. More... | |
error_t | pbkdf2 (const HashAlgo *hash, const uint8_t *p, size_t pLen, const uint8_t *s, size_t sLen, uint_t c, uint8_t *dk, size_t dkLen) |
PBKDF2 key derivation function. More... | |
Variables | |
const uint8_t | PBKDF2_OID [9] = {0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x05, 0x0C} |
Detailed Description
PBKDF (Password-Based Key Derivation Function)
License
SPDX-License-Identifier: GPL-2.0-or-later
Copyright (C) 2010-2024 Oryx Embedded SARL. All rights reserved.
This file is part of CycloneCRYPTO Open.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- Version
- 2.4.4
Definition in file pbkdf.c.
Macro Definition Documentation
◆ TRACE_LEVEL
Function Documentation
◆ pbkdf1()
error_t pbkdf1 | ( | const HashAlgo * | hash, |
const uint8_t * | p, | ||
size_t | pLen, | ||
const uint8_t * | s, | ||
size_t | sLen, | ||
uint_t | c, | ||
uint8_t * | dk, | ||
size_t | dkLen | ||
) |
PBKDF1 key derivation function.
PBKDF1 applies a hash function, which shall be MD2, MD5 or SHA-1, to derive keys. The length of the derived key is bounded by the length of the hash function output, which is 16 octets for MD2 and MD5 and 20 octets for SHA-1
- Parameters
-
[in] hash Underlying hash function (MD2, MD5 or SHA-1) [in] p Password, an octet string [in] pLen Length in octets of password [in] s Salt, an octet string [in] sLen Length in octets of salt [in] c Iteration count [out] dk Derived key [in] dkLen Intended length in octets of the derived key
- Returns
- Error code
◆ pbkdf2()
error_t pbkdf2 | ( | const HashAlgo * | hash, |
const uint8_t * | p, | ||
size_t | pLen, | ||
const uint8_t * | s, | ||
size_t | sLen, | ||
uint_t | c, | ||
uint8_t * | dk, | ||
size_t | dkLen | ||
) |
PBKDF2 key derivation function.
PBKDF2 applies a pseudorandom function to derive keys. The length of the derived key is essentially unbounded
- Parameters
-
[in] hash Hash algorithm used by the underlying PRF [in] p Password, an octet string [in] pLen Length in octets of password [in] s Salt, an octet string [in] sLen Length in octets of salt [in] c Iteration count [out] dk Derived key [in] dkLen Intended length in octets of the derived key
- Returns
- Error code