Blowfish block cipher. More...
#include "config.h"
#include <stddef.h>
#include <stdint.h>
Go to the source code of this file.
Data Structures | |
struct | mbedtls_blowfish_context |
Blowfish context structure. More... | |
Defines | |
#define | MBEDTLS_BLOWFISH_ENCRYPT 1 |
#define | MBEDTLS_BLOWFISH_DECRYPT 0 |
#define | MBEDTLS_BLOWFISH_MAX_KEY_BITS 448 |
#define | MBEDTLS_BLOWFISH_MIN_KEY_BITS 32 |
#define | MBEDTLS_BLOWFISH_ROUNDS 16 |
#define | MBEDTLS_BLOWFISH_BLOCKSIZE 8 |
#define | MBEDTLS_ERR_BLOWFISH_INVALID_KEY_LENGTH -0x0016 |
#define | MBEDTLS_ERR_BLOWFISH_HW_ACCEL_FAILED -0x0017 |
#define | MBEDTLS_ERR_BLOWFISH_INVALID_INPUT_LENGTH -0x0018 |
Functions | |
void | mbedtls_blowfish_init (mbedtls_blowfish_context *ctx) |
Initialize Blowfish context. | |
void | mbedtls_blowfish_free (mbedtls_blowfish_context *ctx) |
Clear Blowfish context. | |
int | mbedtls_blowfish_setkey (mbedtls_blowfish_context *ctx, const unsigned char *key, unsigned int keybits) |
Blowfish key schedule. | |
int | mbedtls_blowfish_crypt_ecb (mbedtls_blowfish_context *ctx, int mode, const unsigned char input[MBEDTLS_BLOWFISH_BLOCKSIZE], unsigned char output[MBEDTLS_BLOWFISH_BLOCKSIZE]) |
Blowfish-ECB block encryption/decryption. |
Blowfish block cipher.
Definition in file blowfish.h.
#define MBEDTLS_BLOWFISH_BLOCKSIZE 8 |
Definition at line 68 of file blowfish.h.
#define MBEDTLS_BLOWFISH_DECRYPT 0 |
Definition at line 64 of file blowfish.h.
#define MBEDTLS_BLOWFISH_ENCRYPT 1 |
Definition at line 63 of file blowfish.h.
#define MBEDTLS_BLOWFISH_MAX_KEY_BITS 448 |
Definition at line 65 of file blowfish.h.
#define MBEDTLS_BLOWFISH_MIN_KEY_BITS 32 |
Definition at line 66 of file blowfish.h.
#define MBEDTLS_BLOWFISH_ROUNDS 16 |
Rounds to use. When increasing this value, make sure to extend the initialisation vectors
Definition at line 67 of file blowfish.h.
#define MBEDTLS_ERR_BLOWFISH_HW_ACCEL_FAILED -0x0017 |
Blowfish hardware accelerator failed.
Definition at line 71 of file blowfish.h.
#define MBEDTLS_ERR_BLOWFISH_INVALID_INPUT_LENGTH -0x0018 |
Invalid data input length.
Definition at line 72 of file blowfish.h.
#define MBEDTLS_ERR_BLOWFISH_INVALID_KEY_LENGTH -0x0016 |
Invalid key length.
Definition at line 70 of file blowfish.h.
int mbedtls_blowfish_crypt_ecb | ( | mbedtls_blowfish_context * | ctx, | |
int | mode, | |||
const unsigned char | input[MBEDTLS_BLOWFISH_BLOCKSIZE], | |||
unsigned char | output[MBEDTLS_BLOWFISH_BLOCKSIZE] | |||
) |
Blowfish-ECB block encryption/decryption.
ctx | Blowfish context | |
mode | MBEDTLS_BLOWFISH_ENCRYPT or MBEDTLS_BLOWFISH_DECRYPT | |
input | 8-byte input block | |
output | 8-byte output block |
void mbedtls_blowfish_free | ( | mbedtls_blowfish_context * | ctx | ) |
Clear Blowfish context.
ctx | Blowfish context to be cleared |
void mbedtls_blowfish_init | ( | mbedtls_blowfish_context * | ctx | ) |
Initialize Blowfish context.
ctx | Blowfish context to be initialized |
int mbedtls_blowfish_setkey | ( | mbedtls_blowfish_context * | ctx, | |
const unsigned char * | key, | |||
unsigned int | keybits | |||
) |
Blowfish key schedule.
ctx | Blowfish context to be initialized | |
key | encryption key | |
keybits | must be between 32 and 448 bits |