75 #ifdef POK_NEEDS_PROTOCOLS_BLOWFISH
85 #if (BF_ROUNDS != 16) && (BF_ROUNDS != 20)
86 #error If you set BF_ROUNDS to some value other than 16 or 20, you will have \
90 void BF_encrypt(BF_LONG *data,
const BF_KEY *key)
94 register const BF_LONG *p,*s;
126 data[1]=l&0xffffffffL;
127 data[0]=r&0xffffffffL;
129 register BF_LONG l,r,t,*k;
160 data[1]=l&0xffffffffL;
161 data[0]=r&0xffffffffL;
165 #ifndef BF_DEFAULT_OPTIONS
167 void BF_decrypt(BF_LONG *data,
const BF_KEY *key)
170 register BF_LONG l,r;
171 register const BF_LONG *p,*s;
203 data[1]=l&0xffffffffL;
204 data[0]=r&0xffffffffL;
206 register BF_LONG l,r,t,*k;
237 data[1]=l&0xffffffffL;
238 data[0]=r&0xffffffffL;
242 void BF_cbc_encrypt(
const unsigned char *in,
unsigned char *out,
long length,
243 const BF_KEY *schedule,
unsigned char *ivec,
int encrypt)
245 register BF_LONG tin0,tin1;
246 register BF_LONG tout0,tout1,xor0,xor1;
247 register long l=length;
255 for (l-=8; l>=0; l-=8)
263 BF_encrypt(tin,schedule);
271 n2ln(in,tin0,tin1,l+8);
276 BF_encrypt(tin,schedule);
290 for (l-=8; l>=0; l-=8)
296 BF_decrypt(tin,schedule);
310 BF_decrypt(tin,schedule);
313 l2nn(tout0,tout1,out,l+8);
320 tin0=tin1=tout0=tout1=xor0=xor1=0;
325 void BF_ecb_encrypt(
const unsigned char *in,
unsigned char *out,
326 const BF_KEY *key,
int encrypt)