22#ifndef MBEDTLS_BLOWFISH_H
23#define MBEDTLS_BLOWFISH_H
25#if !defined(MBEDTLS_CONFIG_FILE)
28#include MBEDTLS_CONFIG_FILE
43#define MBEDTLS_BLOWFISH_ENCRYPT 1
44#define MBEDTLS_BLOWFISH_DECRYPT 0
45#define MBEDTLS_BLOWFISH_MAX_KEY_BITS 448
46#define MBEDTLS_BLOWFISH_MIN_KEY_BITS 32
47#define MBEDTLS_BLOWFISH_ROUNDS 16
48#define MBEDTLS_BLOWFISH_BLOCKSIZE 8
50#if !defined(MBEDTLS_DEPRECATED_REMOVED)
51#define MBEDTLS_ERR_BLOWFISH_INVALID_KEY_LENGTH MBEDTLS_DEPRECATED_NUMERIC_CONSTANT( -0x0016 )
53#define MBEDTLS_ERR_BLOWFISH_BAD_INPUT_DATA -0x0016
55#define MBEDTLS_ERR_BLOWFISH_INVALID_INPUT_LENGTH -0x0018
59#define MBEDTLS_ERR_BLOWFISH_HW_ACCEL_FAILED -0x0017
65#if !defined(MBEDTLS_BLOWFISH_ALT)
80#include "blowfish_alt.h"
114 unsigned int keybits );
134 const unsigned char input[MBEDTLS_BLOWFISH_BLOCKSIZE],
135 unsigned char output[MBEDTLS_BLOWFISH_BLOCKSIZE] );
137#if defined(MBEDTLS_CIPHER_MODE_CBC)
169 unsigned char iv[MBEDTLS_BLOWFISH_BLOCKSIZE],
170 const unsigned char *input,
171 unsigned char *output );
174#if defined(MBEDTLS_CIPHER_MODE_CFB)
210 unsigned char iv[MBEDTLS_BLOWFISH_BLOCKSIZE],
211 const unsigned char *input,
212 unsigned char *output );
215#if defined(MBEDTLS_CIPHER_MODE_CTR)
282 unsigned char nonce_counter[MBEDTLS_BLOWFISH_BLOCKSIZE],
283 unsigned char stream_block[MBEDTLS_BLOWFISH_BLOCKSIZE],
284 const unsigned char *input,
285 unsigned char *output );
Configuration options (set of defines)
int mbedtls_blowfish_setkey(mbedtls_blowfish_context *ctx, const unsigned char *key, unsigned int keybits)
Perform a Blowfish key schedule operation.
int mbedtls_blowfish_crypt_ecb(mbedtls_blowfish_context *ctx, int mode, const unsigned char input[8], unsigned char output[8])
Perform a Blowfish-ECB block encryption/decryption operation.
int mbedtls_blowfish_crypt_ctr(mbedtls_blowfish_context *ctx, size_t length, size_t *nc_off, unsigned char nonce_counter[8], unsigned char stream_block[8], const unsigned char *input, unsigned char *output)
Perform a Blowfish-CTR buffer encryption/decryption operation.
#define MBEDTLS_BLOWFISH_ROUNDS
Rounds to use.
void mbedtls_blowfish_init(mbedtls_blowfish_context *ctx)
Initialize a Blowfish context.
void mbedtls_blowfish_free(mbedtls_blowfish_context *ctx)
Clear a Blowfish context.
Blowfish context structure.