BeeCrypt  4.2.1
Data Structures | Macros | Functions | Variables
blowfish.h File Reference

Blowfish block cipher. More...

#include "beecrypt/beecrypt.h"
#include "beecrypt/blowfishopt.h"
Include dependency graph for blowfish.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  blowfishParam
 Holds all the parameters necessary for the Blowfish cipher. More...
 

Macros

#define BLOWFISHROUNDS   16
 
#define BLOWFISHPSIZE   (BLOWFISHROUNDS+2)
 

Functions

int blowfishSetup (blowfishParam *, const byte *, size_t, cipherOperation)
 The function performs the cipher's key expansion. More...
 
int blowfishSetIV (blowfishParam *, const byte *iv)
 This function sets the Initialization Vector. More...
 
int blowfishSetCTR (blowfishParam *, const byte *nivz, size_t counter)
 
int blowfishEncrypt (blowfishParam *, uint32_t *, const uint32_t *)
 This function performs the Blowfish encryption; it encrypts one block of 64 bits. More...
 
int blowfishDecrypt (blowfishParam *, uint32_t *, const uint32_t *)
 This function performs the Blowfish decryption; it Rderypts one block of 64 bits. More...
 
uint32_t * blowfishFeedback (blowfishParam *)
 

Variables

const blockCipher blowfish
 Holds the full API description of the Blowfish algorithm. More...
 

Detailed Description

Blowfish block cipher.

For more information on this blockcipher, see: "Applied Cryptography", second edition Bruce Schneier Wiley & Sons

Also see http://www.counterpane.com/blowfish.html

Author
Bob Deblier bob.d.nosp@m.ebli.nosp@m.er@te.nosp@m.lene.nosp@m.t.be

Macro Definition Documentation

#define BLOWFISHPSIZE   (BLOWFISHROUNDS+2)
#define BLOWFISHROUNDS   16

Function Documentation

blowfishDecrypt ( blowfishParam bp,
uint32_t *  dst,
const uint32_t *  src 
)

This function performs the Blowfish decryption; it Rderypts one block of 64 bits.

Parameters
bpThe cipher's parameter block.
dstThe cleartext; should be aligned on 32-bit boundary.
srcThe ciphertext; should be aligned on 32-bit boundary.
Return values
0on success.
blowfishEncrypt ( blowfishParam bp,
uint32_t *  dst,
const uint32_t *  src 
)

This function performs the Blowfish encryption; it encrypts one block of 64 bits.

Parameters
bpThe cipher's parameter block.
dstThe ciphertext; should be aligned on 32-bit boundary.
srcThe cleartext; should be aligned on 32-bit boundary.
Return values
0on success.
uint32_t* blowfishFeedback ( blowfishParam )
int blowfishSetCTR ( blowfishParam ,
const byte nivz,
size_t  counter 
)
int blowfishSetIV ( blowfishParam bp,
const byte iv 
)

This function sets the Initialization Vector.

Note
This function is only useful in block chaining or feedback modes.
Parameters
bpThe cipher's parameter block.
ivThe initialization vector; may be null.
Return values
0on success.
int blowfishSetup ( blowfishParam bp,
const byte key,
size_t  keybits,
cipherOperation  op 
)

The function performs the cipher's key expansion.

Parameters
bpThe cipher's parameter block.
keyThe key value.
keybitsThe number of bits in the key; legal values are: 32 to 448, in multiples of 8.
opENCRYPT or DECRYPT.
Return values
0on success.
-1on failure.

Variable Documentation

blowfish

Holds the full API description of the Blowfish algorithm.