pkcs5.h File Reference

PKCS #5 (Password-Based Cryptography Standard) More...

#include "core/crypto.h"

Go to the source code of this file.

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 PKCS5_OID [8]
 
const uint8_t PBKDF2_OID [9]
 

Detailed Description

PKCS #5 (Password-Based Cryptography Standard)

License

Copyright (C) 2010-2018 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.

Author
Oryx Embedded SARL (www.oryx-embedded.com)
Version
1.9.0

Definition in file pkcs5.h.

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]hashUnderlying hash function (MD2, MD5 or SHA-1)
[in]pPassword, an octet string
[in]pLenLength in octets of password
[in]sSalt, an octet string
[in]sLenLength in octets of salt
[in]cIteration count
[out]dkDerived key
[in]dkLenIntended length in octets of the derived key
Returns
Error code

Definition at line 64 of file pkcs5.c.

◆ 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]hashHash algorithm used by the underlying PRF
[in]pPassword, an octet string
[in]pLenLength in octets of password
[in]sSalt, an octet string
[in]sLenLength in octets of salt
[in]cIteration count
[out]dkDerived key
[in]dkLenIntended length in octets of the derived key
Returns
Error code

Definition at line 132 of file pkcs5.c.

Variable Documentation

◆ PBKDF2_OID

const uint8_t PBKDF2_OID[9]

Definition at line 43 of file pkcs5.c.

◆ PKCS5_OID

const uint8_t PKCS5_OID[8]

Definition at line 41 of file pkcs5.c.