home *** CD-ROM | disk | FTP | other *** search
/ PCMania 10 / Pcmania_Ep2_10_CD-01.iso / ARTICULOS / tecnologia / DLOCK2.ZIP / DIAMOND2.H < prev    next >
Encoding:
C/C++ Source or Header  |  1995-12-21  |  1.6 KB  |  38 lines

  1. /* diamond2.h -- program interface to the Diamond2 and Diamond2 Lite Block
  2.    Ciphers.  This file dedicated to the Public Domain by Mike Johnson, the 
  3.    author.*/
  4.  
  5. extern void set_diamond2_key(byte *external_key, /* Variable length key */
  6.                         uint key_size,      /* Length of key in bytes */
  7.                         uint rounds,        /* Number of rounds to use (5 to 15
  8.                                            for Diamond, 4 to 30 for Diamond Lite) */
  9.                         boolean invert,     /* true if mpj_decrypt may be called. */
  10.                         int block_size);    /* 16 for Diamond; 8 for Diamond Lite. */
  11. /* Call before the first call to diamond2_encrypt_block() or diamond2_decrypt_block */
  12.  
  13. extern void diamond2_encrypt_block(byte *x, byte *y);
  14. /* Call set_diamond2_key() with a block_size of 16 before first calling
  15.    diamond2_encrypt_block().   x is input, y is output.
  16. */
  17.  
  18. extern void diamond2_decrypt_block(byte *x, byte *y);
  19. /* Call set_diamond2_key() with a block_size of 16 before first calling
  20.    diamond2_decrypt_block().   x is input, y is output.
  21. */
  22.  
  23. extern void lite2_encrypt_block(byte *x, byte *y);
  24. /* Call set_diamond2_key() with a block_size of 8 before first calling
  25.    lite2_encrypt_block().   x is input, y is output.
  26. */
  27.  
  28. void lite2_decrypt_block(byte *x, byte *y);
  29. /* Call set_diamond2_key() with a block_size of 8 before first calling
  30.    lite2_decrypt_block().   x is input, y is output.
  31. */
  32.  
  33. extern void diamond2_done(void);
  34. /* Clears internal keys.  Call after the last call to
  35. diamond2_encrypt_block() or diamond2_decrypt_block() with a given key.  */
  36.  
  37.  
  38.