bcrypt password hashing function More...
#include "core/crypto.h"
#include "kdf/bcrypt.h"
#include "cipher_mode/ecb.h"
#include "encoding/radix64.h"
Go to the source code of this file.
Macros | |
#define | TRACE_LEVEL CRYPTO_TRACE_LEVEL |
Functions | |
error_t | bcryptHashPassword (const PrngAlgo *prngAlgo, void *prngContext, uint_t cost, const char_t *password, char_t *hash, size_t *hashLen) |
Password hashing function. More... | |
error_t | bcryptVerifyPassword (const char_t *password, const char_t *hash) |
Password verification function. More... | |
error_t | bcrypt (uint_t cost, const uint8_t *salt, const char_t *password, char_t *hash, size_t *hashLen) |
bcrypt algorithm More... | |
error_t | eksBlowfishSetup (BlowfishContext *context, uint_t cost, const uint8_t *salt, size_t saltLen, const char_t *password, size_t passwordLen) |
Expensive key setup. More... | |
bcrypt password hashing function
SPDX-License-Identifier: GPL-2.0-or-later
Copyright (C) 2010-2019 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.
Definition in file bcrypt.c.
error_t bcrypt | ( | uint_t | cost, |
const uint8_t * | salt, | ||
const char_t * | password, | ||
char_t * | hash, | ||
size_t * | hashLen | ||
) |
bcrypt algorithm
[in] | cost | Key expansion iteration count as a power of two |
[in] | salt | Random salt (16 bytes) |
[in] | password | NULL-terminated password to be encoded |
[out] | hash | NULL-terminated hash string |
[out] | hashLen | Length of the hash string (optional parameter) |
error_t bcryptHashPassword | ( | const PrngAlgo * | prngAlgo, |
void * | prngContext, | ||
uint_t | cost, | ||
const char_t * | password, | ||
char_t * | hash, | ||
size_t * | hashLen | ||
) |
Password hashing function.
[in] | prngAlgo | PRNG algorithm |
[in] | prngContext | Pointer to the PRNG context |
[in] | cost | Key expansion iteration count as a power of two |
[in] | password | NULL-terminated password to be encoded |
[out] | hash | NULL-terminated hash string |
[out] | hashLen | Length of the hash string (optional parameter) |
error_t eksBlowfishSetup | ( | BlowfishContext * | context, |
uint_t | cost, | ||
const uint8_t * | salt, | ||
size_t | saltLen, | ||
const char_t * | password, | ||
size_t | passwordLen | ||
) |
Expensive key setup.
[in] | context | Pointer to the Blowfish context |
[in] | cost | Key expansion iteration count as a power of 2 |
[in] | salt | Random salt |
[in] | saltLen | Length of the random salt, in bytes |
[in] | password | NULL-terminated password to be encoded |
[in] | passwordLen | Length of the password, in bytes |