27 #ifndef POLARSSL_BLOWFISH_H
28 #define POLARSSL_BLOWFISH_H
36 typedef UINT32 uint32_t;
41 #define BLOWFISH_ENCRYPT 1
42 #define BLOWFISH_DECRYPT 0
43 #define BLOWFISH_MAX_KEY 448
44 #define BLOWFISH_MIN_KEY 32
45 #define BLOWFISH_ROUNDS 16
46 #define BLOWFISH_BLOCKSIZE 8
48 #define POLARSSL_ERR_BLOWFISH_INVALID_KEY_LENGTH -0x0016
49 #define POLARSSL_ERR_BLOWFISH_INVALID_INPUT_LENGTH -0x0018
51 #if !defined(POLARSSL_BLOWFISH_ALT)
93 unsigned char output[BLOWFISH_BLOCKSIZE] );
95 #if defined(POLARSSL_CIPHER_MODE_CBC)
114 const unsigned char *input,
115 unsigned char *output );
118 #if defined(POLARSSL_CIPHER_MODE_CFB)
137 const unsigned char *input,
138 unsigned char *output );
141 #if defined(POLARSSL_CIPHER_MODE_CTR)
164 unsigned char stream_block[BLOWFISH_BLOCKSIZE],
165 const unsigned char *input,
166 unsigned char *output );
174 #include "blowfish_alt.h"
int blowfish_setkey(blowfish_context *ctx, const unsigned char *key, unsigned int keysize)
Blowfish key schedule.
Configuration options (set of defines)
int blowfish_crypt_ecb(blowfish_context *ctx, int mode, const unsigned char input[BLOWFISH_BLOCKSIZE], unsigned char output[BLOWFISH_BLOCKSIZE])
Blowfish-ECB block encryption/decryption.
#define BLOWFISH_BLOCKSIZE
int blowfish_crypt_ctr(blowfish_context *ctx, size_t length, size_t *nc_off, unsigned char nonce_counter[BLOWFISH_BLOCKSIZE], unsigned char stream_block[BLOWFISH_BLOCKSIZE], const unsigned char *input, unsigned char *output)
Blowfish-CTR buffer encryption/decryption.
int blowfish_crypt_cfb64(blowfish_context *ctx, int mode, size_t length, size_t *iv_off, unsigned char iv[BLOWFISH_BLOCKSIZE], const unsigned char *input, unsigned char *output)
Blowfish CFB buffer encryption/decryption.
Blowfish context structure.
int blowfish_crypt_cbc(blowfish_context *ctx, int mode, size_t length, unsigned char iv[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) ...