Blowfish block cipher.
More...
#include "config.h"
#include <stddef.h>
#include <stdint.h>
#include "platform_util.h"
Go to the source code of this file.
◆ MBEDTLS_BLOWFISH_BLOCKSIZE
#define MBEDTLS_BLOWFISH_BLOCKSIZE 8 /* Blowfish uses 64 bit blocks */ |
◆ MBEDTLS_BLOWFISH_DECRYPT
#define MBEDTLS_BLOWFISH_DECRYPT 0 |
◆ MBEDTLS_BLOWFISH_ENCRYPT
#define MBEDTLS_BLOWFISH_ENCRYPT 1 |
◆ MBEDTLS_BLOWFISH_MAX_KEY_BITS
#define MBEDTLS_BLOWFISH_MAX_KEY_BITS 448 |
◆ MBEDTLS_BLOWFISH_MIN_KEY_BITS
#define MBEDTLS_BLOWFISH_MIN_KEY_BITS 32 |
◆ MBEDTLS_BLOWFISH_ROUNDS
#define MBEDTLS_BLOWFISH_ROUNDS 16 |
Rounds to use. When increasing this value, make sure to extend the initialisation vectors
◆ MBEDTLS_ERR_BLOWFISH_BAD_INPUT_DATA
#define MBEDTLS_ERR_BLOWFISH_BAD_INPUT_DATA -0x0016 |
◆ MBEDTLS_ERR_BLOWFISH_HW_ACCEL_FAILED
#define MBEDTLS_ERR_BLOWFISH_HW_ACCEL_FAILED -0x0017 |
Blowfish hardware accelerator failed.
◆ MBEDTLS_ERR_BLOWFISH_INVALID_INPUT_LENGTH
#define MBEDTLS_ERR_BLOWFISH_INVALID_INPUT_LENGTH -0x0018 |
Invalid data input length.
◆ MBEDTLS_ERR_BLOWFISH_INVALID_KEY_LENGTH
◆ mbedtls_blowfish_context
Blowfish context structure.
◆ mbedtls_blowfish_crypt_ecb()
int mbedtls_blowfish_crypt_ecb |
( |
mbedtls_blowfish_context * |
ctx, |
|
|
int |
mode, |
|
|
const unsigned char |
input[MBEDTLS_BLOWFISH_BLOCKSIZE], |
|
|
unsigned char |
output[MBEDTLS_BLOWFISH_BLOCKSIZE] |
|
) |
| |
Perform a Blowfish-ECB block encryption/decryption operation.
- Parameters
-
ctx | The Blowfish context to use. This must be initialized and bound to a key. |
mode | The mode of operation. Possible values are MBEDTLS_BLOWFISH_ENCRYPT for encryption, or MBEDTLS_BLOWFISH_DECRYPT for decryption. |
input | The input block. This must be a readable buffer of size 8 Bytes. |
output | The output block. This must be a writable buffer of size 8 Bytes. |
- Returns
0
if successful.
-
A negative error code on failure.
◆ mbedtls_blowfish_free()
Clear a Blowfish context.
- Parameters
-
ctx | The Blowfish context to be cleared. This may be NULL , in which case this function returns immediately. If it is not NULL , it must point to an initialized Blowfish context. |
◆ mbedtls_blowfish_init()
Initialize a Blowfish context.
- Parameters
-
ctx | The Blowfish context to be initialized. This must not be NULL . |
◆ mbedtls_blowfish_setkey()
Perform a Blowfish key schedule operation.
- Parameters
-
ctx | The Blowfish context to perform the key schedule on. |
key | The encryption key. This must be a readable buffer of length keybits Bits. |
keybits | The length of key in Bits. This must be between 32 and 448 and a multiple of 8 . |
- Returns
0
if successful.
-
A negative error code on failure.