00001
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #ifndef _BLOWFISH_H
00029 #define _BLOWFISH_H
00030
00031 #include "beecrypt.h"
00032 #include "blowfishopt.h"
00033
00034 #define BLOWFISHROUNDS 16
00035 #define BLOWFISHPSIZE (BLOWFISHROUNDS+2)
00036
00039 typedef struct
00040 {
00041 uint32 p[BLOWFISHPSIZE];
00042 uint32 s[1024];
00043 uint32 fdback[2];
00044 } blowfishParam;
00045
00046 #ifdef __cplusplus
00047 extern "C" {
00048 #endif
00049
00052
00053 extern const BEECRYPTAPI blockCipher blowfish;
00054
00057
00058 BEECRYPTAPI
00059 int blowfishSetup (blowfishParam* bp, const uint32* key, int keybits, cipherOperation op)
00060 ;
00061
00062
00065
00066 BEECRYPTAPI
00067 int blowfishSetIV (blowfishParam* bp, const uint32* iv)
00068 ;
00069
00070
00073
00074 BEECRYPTAPI
00075 int blowfishEncrypt(blowfishParam* bp, uint32* dst, const uint32* src)
00076 ;
00077
00078
00081
00082 BEECRYPTAPI
00083 int blowfishDecrypt(blowfishParam* bp, uint32* dst, const uint32* src)
00084 ;
00085
00086
00089
00090 BEECRYPTAPI
00091 int blowfishECBEncrypt(blowfishParam* bp, int count, uint32* dst, const uint32* src)
00092 ;
00093
00094
00097
00098 BEECRYPTAPI
00099 int blowfishECBDecrypt(blowfishParam* bp, int count, uint32* dst, const uint32* src)
00100 ;
00101
00102
00105
00106 BEECRYPTAPI
00107 int blowfishCBCEncrypt(blowfishParam* bp, int count, uint32* dst, const uint32* src)
00108 ;
00109
00110
00113
00114 BEECRYPTAPI
00115 int blowfishCBCDecrypt(blowfishParam* bp, int count, uint32* dst, const uint32* src)
00116 ;
00117
00118
00119 #ifdef __cplusplus
00120 }
00121 #endif
00122
00123 #endif