22 #ifndef MBEDTLS_BLOWFISH_H
23 #define MBEDTLS_BLOWFISH_H
25 #if !defined(MBEDTLS_CONFIG_FILE)
28 #include MBEDTLS_CONFIG_FILE
36 #define MBEDTLS_BLOWFISH_ENCRYPT 1
37 #define MBEDTLS_BLOWFISH_DECRYPT 0
38 #define MBEDTLS_BLOWFISH_MAX_KEY_BITS 448
39 #define MBEDTLS_BLOWFISH_MIN_KEY_BITS 32
40 #define MBEDTLS_BLOWFISH_ROUNDS 16
41 #define MBEDTLS_BLOWFISH_BLOCKSIZE 8
43 #if !defined(MBEDTLS_DEPRECATED_REMOVED)
44 #define MBEDTLS_ERR_BLOWFISH_INVALID_KEY_LENGTH MBEDTLS_DEPRECATED_NUMERIC_CONSTANT( -0x0016 )
47 #define MBEDTLS_ERR_BLOWFISH_BAD_INPUT_DATA -0x0016
50 #define MBEDTLS_ERR_BLOWFISH_INVALID_INPUT_LENGTH -0x0018
55 #define MBEDTLS_ERR_BLOWFISH_HW_ACCEL_FAILED -0x0017
61 #if !defined(MBEDTLS_BLOWFISH_ALT)
76 #include "blowfish_alt.h"
110 unsigned int keybits );
133 #if defined(MBEDTLS_CIPHER_MODE_CBC)
166 const unsigned char *input,
167 unsigned char *output );
170 #if defined(MBEDTLS_CIPHER_MODE_CFB)
207 const unsigned char *input,
208 unsigned char *output );
211 #if defined(MBEDTLS_CIPHER_MODE_CTR)
280 const unsigned char *input,
281 unsigned char *output );
int mbedtls_blowfish_crypt_cbc(mbedtls_blowfish_context *ctx, int mode, size_t length, unsigned char iv[MBEDTLS_BLOWFISH_BLOCKSIZE], const unsigned char *input, unsigned char *output)
Perform a Blowfish-CBC buffer encryption/decryption operation.
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_ctr(mbedtls_blowfish_context *ctx, size_t length, size_t *nc_off, unsigned char nonce_counter[MBEDTLS_BLOWFISH_BLOCKSIZE], unsigned char stream_block[MBEDTLS_BLOWFISH_BLOCKSIZE], const unsigned char *input, unsigned char *output)
Perform a Blowfish-CTR buffer encryption/decryption operation.
#define MBEDTLS_BLOWFISH_ROUNDS
void mbedtls_blowfish_init(mbedtls_blowfish_context *ctx)
Initialize a Blowfish context.
void mbedtls_blowfish_free(mbedtls_blowfish_context *ctx)
Clear a Blowfish context.
#define MBEDTLS_BLOWFISH_BLOCKSIZE
int mbedtls_blowfish_crypt_cfb64(mbedtls_blowfish_context *ctx, int mode, size_t length, size_t *iv_off, unsigned char iv[MBEDTLS_BLOWFISH_BLOCKSIZE], const unsigned char *input, unsigned char *output)
Perform a Blowfish CFB buffer encryption/decryption operation.
struct mbedtls_blowfish_context mbedtls_blowfish_context
Blowfish context structure.
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.
Configuration options (set of defines)
Blowfish context structure.
uint32_t P[MBEDTLS_BLOWFISH_ROUNDS+2]