51 #ifndef MBEDTLS_BLOWFISH_H
52 #define MBEDTLS_BLOWFISH_H
54 #if !defined(MBEDTLS_CONFIG_FILE)
57 #include MBEDTLS_CONFIG_FILE
63 #define MBEDTLS_BLOWFISH_ENCRYPT 1
64 #define MBEDTLS_BLOWFISH_DECRYPT 0
65 #define MBEDTLS_BLOWFISH_MAX_KEY_BITS 448
66 #define MBEDTLS_BLOWFISH_MIN_KEY_BITS 32
67 #define MBEDTLS_BLOWFISH_ROUNDS 16
68 #define MBEDTLS_BLOWFISH_BLOCKSIZE 8
70 #define MBEDTLS_ERR_BLOWFISH_INVALID_KEY_LENGTH -0x0016
71 #define MBEDTLS_ERR_BLOWFISH_HW_ACCEL_FAILED -0x0017
72 #define MBEDTLS_ERR_BLOWFISH_INVALID_INPUT_LENGTH -0x0018
74 #if !defined(MBEDTLS_BLOWFISH_ALT)
116 unsigned int keybits );
131 unsigned char output[MBEDTLS_BLOWFISH_BLOCKSIZE] );
133 #if defined(MBEDTLS_CIPHER_MODE_CBC)
161 const unsigned char *input,
162 unsigned char *output );
165 #if defined(MBEDTLS_CIPHER_MODE_CFB)
192 const unsigned char *input,
193 unsigned char *output );
196 #if defined(MBEDTLS_CIPHER_MODE_CTR)
219 unsigned char stream_block[MBEDTLS_BLOWFISH_BLOCKSIZE],
220 const unsigned char *input,
221 unsigned char *output );
229 #include "blowfish_alt.h"
#define MBEDTLS_BLOWFISH_BLOCKSIZE
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)
Blowfish-CTR buffer encryption/decryption.
Configuration options (set of defines)
Blowfish context structure.
void mbedtls_blowfish_init(mbedtls_blowfish_context *ctx)
Initialize Blowfish context.
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)
Blowfish CFB buffer encryption/decryption.
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)
Blowfish-CBC buffer encryption/decryption Length should be a multiple of the block size (8 bytes) ...
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.
int mbedtls_blowfish_setkey(mbedtls_blowfish_context *ctx, const unsigned char *key, unsigned int keybits)
Blowfish key schedule.
#define MBEDTLS_BLOWFISH_ROUNDS
void mbedtls_blowfish_free(mbedtls_blowfish_context *ctx)
Clear Blowfish context.