Blowfish encryption algorithm. More...
Go to the source code of this file.
Macros | |
#define | TRACE_LEVEL CRYPTO_TRACE_LEVEL |
Functions | |
error_t | blowfishInit (BlowfishContext *context, const uint8_t *key, size_t keyLen) |
Initialize a Blowfish context using the supplied key. More... | |
error_t | blowfishInitState (BlowfishContext *context) |
Blowfish state initialization. More... | |
error_t | blowfishExpandKey (BlowfishContext *context, const uint8_t *salt, size_t saltLen, const uint8_t *key, size_t keyLen) |
Key expansion. More... | |
void | blowfishEncryptBlock (BlowfishContext *context, const uint8_t *input, uint8_t *output) |
Encrypt a 8-byte block using Blowfish algorithm. More... | |
void | blowfishDecryptBlock (BlowfishContext *context, const uint8_t *input, uint8_t *output) |
Decrypt a 8-byte block using Blowfish algorithm. More... | |
void | blowfishXorBlock (uint8_t *data, const uint8_t *salt, size_t saltLen, size_t *saltIndex) |
XOR data block with random salt. More... | |
void | blowfishDeinit (BlowfishContext *context) |
Release Blowfish context. More... | |
Variables | |
const CipherAlgo | blowfishCipherAlgo |
Detailed Description
Blowfish encryption algorithm.
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.
Description
Blowfish is an encryption algorithm designed to encipher and decipher blocks of 128 bits under control of a 128/192/256-bit secret key
- Version
- 2.4.4
Definition in file blowfish.c.
Macro Definition Documentation
◆ TRACE_LEVEL
#define TRACE_LEVEL CRYPTO_TRACE_LEVEL |
Definition at line 37 of file blowfish.c.
Function Documentation
◆ blowfishDecryptBlock()
void blowfishDecryptBlock | ( | BlowfishContext * | context, |
const uint8_t * | input, | ||
uint8_t * | output | ||
) |
Decrypt a 8-byte block using Blowfish algorithm.
- Parameters
-
[in] context Pointer to the Blowfish context [in] input Ciphertext block to decrypt [out] output Plaintext block resulting from decryption
Definition at line 461 of file blowfish.c.
◆ blowfishDeinit()
void blowfishDeinit | ( | BlowfishContext * | context | ) |
Release Blowfish context.
- Parameters
-
[in] context Pointer to the Blowfish context
Definition at line 548 of file blowfish.c.
◆ blowfishEncryptBlock()
void blowfishEncryptBlock | ( | BlowfishContext * | context, |
const uint8_t * | input, | ||
uint8_t * | output | ||
) |
Encrypt a 8-byte block using Blowfish algorithm.
- Parameters
-
[in] context Pointer to the Blowfish context [in] input Plaintext block to encrypt [out] output Ciphertext block resulting from encryption
Definition at line 411 of file blowfish.c.
◆ blowfishExpandKey()
error_t blowfishExpandKey | ( | BlowfishContext * | context, |
const uint8_t * | salt, | ||
size_t | saltLen, | ||
const uint8_t * | key, | ||
size_t | keyLen | ||
) |
Key expansion.
- Parameters
-
[in] context Pointer to the Blowfish context [in] salt Random salt [in] saltLen Length of the random salt, in bytes [in] key Secret key [in] keyLen Length of the secret key, in bytes
- Returns
- Error code
Definition at line 291 of file blowfish.c.
◆ blowfishInit()
error_t blowfishInit | ( | BlowfishContext * | context, |
const uint8_t * | key, | ||
size_t | keyLen | ||
) |
Initialize a Blowfish context using the supplied key.
- Parameters
-
[in] context Pointer to the Blowfish context to initialize [in] key Pointer to the key [in] keyLen Length of the key
- Returns
- Error code
Definition at line 227 of file blowfish.c.
◆ blowfishInitState()
error_t blowfishInitState | ( | BlowfishContext * | context | ) |
Blowfish state initialization.
- Parameters
-
[in] context Pointer to the Blowfish context
- Returns
- Error code
Definition at line 257 of file blowfish.c.
◆ blowfishXorBlock()
void blowfishXorBlock | ( | uint8_t * | data, |
const uint8_t * | salt, | ||
size_t | saltLen, | ||
size_t * | saltIndex | ||
) |
XOR data block with random salt.
- Parameters
-
[in,out] data Pointer the data block (16 bytes) [in] salt Pointer to the random salt (16 bytes) [in] saltLen Length of the salt, in bytes [in,out] saltIndex Current salt index
Definition at line 512 of file blowfish.c.
Variable Documentation
◆ blowfishCipherAlgo
const CipherAlgo blowfishCipherAlgo |
Definition at line 204 of file blowfish.c.