home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / crypl200.zip / RC / RC5.H < prev   
Text File  |  1996-01-25  |  962b  |  35 lines

  1. #ifndef _RC5_DEFINED
  2.  
  3. #define _RC5_DEFINED
  4.  
  5. /* The RC5 blocksize */
  6.  
  7. #define RC5_BLOCKSIZE        8
  8.  
  9. /* The default and maximum (sane) number of RC5 rounds */
  10.  
  11. #define RC5_DEFAULT_ROUNDS    12
  12. #define RC5_MAX_ROUNDS        32
  13.  
  14. /* The maximum RC5 expanded key size: 256 bytes.  Note that sizeof( LONG )
  15.    may not equal 4, so the total size may in fact be more than 256 bytes,
  16.    however the total information content is only 256 bytes */
  17.  
  18. #define RC5_EXPANDED_KEYSIZE_LONG    64
  19. #define RC5_EXPANDED_KEYSIZE        ( RC5_EXPANDED_KEYSIZE_LONG * sizeof( LONG ) )
  20.  
  21. /* A structure to hold the RC5 key */
  22.  
  23. typedef struct {
  24.     LONG S[ RC5_EXPANDED_KEYSIZE_LONG ];    /* S-box */
  25.     int noRounds;                            /* Number of rounds */
  26.     } RC5_KEY;
  27.  
  28. /* Prototypes for functions in RC5.C */
  29.  
  30. void rc5encrypt( RC5_KEY *key, BYTE *data );
  31. void rc5decrypt( RC5_KEY *key, BYTE *data );
  32. void rc5keyInit( RC5_KEY *key, BYTE *userKey, int userKeyLength );
  33.  
  34. #endif /* _RC5_DEFINED */
  35.