home *** CD-ROM | disk | FTP | other *** search
/ Beginning Mac Programming / Beginning Mac Programming.bin / pc / Open Me for REALbasic 3 / REALbasic 3.2 / Example Projects / Reusable Classes_Code / REALfishSource / bfsh-koc Folder / Blowfish.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-09-05  |  597 b   |  36 lines

  1. /*
  2.  * Author     :  Paul Kocher
  3.  * E-mail     :  pck@netcom.com
  4.  * Date       :  1997
  5.  * Description:  C implementation of the Blowfish algorithm.
  6.  */
  7.  
  8. #define MAXKEYBYTES 56          /* 448 bits */
  9.  
  10.  
  11.  
  12. typedef struct {
  13.  
  14.   unsigned long P[16 + 2];
  15.  
  16.   unsigned long S[4][256];
  17.  
  18. } BLOWFISH_CTX;
  19.  
  20.  
  21.  
  22. void Blowfish_Init(BLOWFISH_CTX *ctx, unsigned char *key, int keyLen);
  23.  
  24. void Blowfish_Encrypt(BLOWFISH_CTX *ctx, unsigned long *xl, unsigned long
  25. *xr);
  26.  
  27. void Blowfish_Decrypt(BLOWFISH_CTX *ctx, unsigned long *xl, unsigned long
  28. *xr);
  29.  
  30. int Blowfish_Test(BLOWFISH_CTX *ctx);       /* 0=ok, -1=bad */
  31.  
  32.  
  33.  
  34.  
  35.  
  36.