00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00034 #ifndef _BLOWFISH_H
00035 #define _BLOWFISH_H
00036
00037 #include "beecrypt/beecrypt.h"
00038 #include "beecrypt/blowfishopt.h"
00039
00040 #define BLOWFISHROUNDS 16
00041 #define BLOWFISHPSIZE (BLOWFISHROUNDS+2)
00042
00046 #ifdef __cplusplus
00047 struct BEECRYPTAPI blowfishParam
00048 #else
00049 struct _blowfishParam
00050 #endif
00051 {
00055 uint32_t p[BLOWFISHPSIZE];
00059 uint32_t s[1024];
00063 uint32_t fdback[2];
00064 };
00065
00066 #ifndef __cplusplus
00067 typedef struct _blowfishParam blowfishParam;
00068 #endif
00069
00070 #ifdef __cplusplus
00071 extern "C" {
00072 #endif
00073
00077 extern const BEECRYPTAPI blockCipher blowfish;
00078
00090 BEECRYPTAPI
00091 int blowfishSetup (blowfishParam*, const byte*, size_t, cipherOperation);
00092
00100 BEECRYPTAPI
00101 int blowfishSetIV (blowfishParam*, const byte*);
00102
00111 BEECRYPTAPI
00112 int blowfishEncrypt (blowfishParam*, uint32_t*, const uint32_t*);
00113
00122 BEECRYPTAPI
00123 int blowfishDecrypt (blowfishParam*, uint32_t*, const uint32_t*);
00124
00125 BEECRYPTAPI
00126 uint32_t* blowfishFeedback(blowfishParam*);
00127
00128 #ifdef __cplusplus
00129 }
00130 #endif
00131
00132 #endif