home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / crypl200.zip / IDEA / IDEA.H < prev    next >
C/C++ Source or Header  |  1995-09-27  |  872b  |  35 lines

  1. #ifndef _IDEA_DEFINED
  2.  
  3. #define _IDEA_DEFINED
  4.  
  5. /* Defines for the PGP-style types used in IDEA.C */
  6.  
  7. #define byte    unsigned char
  8. #define word16    unsigned short int
  9. #define word32    unsigned long int
  10.  
  11. /* Macros from PGP */
  12.  
  13. #define burn(x)    memset( x, 0, sizeof( x ) )
  14.  
  15. /* IDEA algorithm constants */
  16.  
  17. #define IDEAKEYSIZE        16
  18. #define IDEABLOCKSIZE    8
  19.  
  20. #define IDEAROUNDS        8
  21. #define IDEAKEYLEN        ( 6 * IDEAROUNDS + 4 )
  22.  
  23. /* Routines used to implement the IDEA encryption */
  24. void ideaExpandKey( byte const *userkey, word16 *EK );
  25.  
  26. #ifdef _DCC
  27. void ideaInvertKey( word16 *EK, word16 DK[IDEAKEYLEN] );
  28. void ideaCipher( byte (inbuf[8]), byte (outbuf[8]), word16 *key );
  29. #else
  30. void ideaInvertKey( word16 const *EK, word16 DK[IDEAKEYLEN] );
  31. void ideaCipher( byte const (inbuf[8]), byte (outbuf[8]), word16 const *key );
  32. #endif
  33.  
  34. #endif /* _IDEA_DEFINED */
  35.