home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / crypl200.zip / TESTSAFR.H < prev   
Text File  |  1996-03-15  |  1KB  |  38 lines

  1. /* SAFER-SK64 and SAFER_SK128 test vectors, from the ETH reference
  2.    implementation */
  3.  
  4. /* The data structure for the ( key, plaintext, ciphertext ) triplets */
  5.  
  6. typedef struct {
  7.     int rounds;
  8.     BYTE key[ SAFER_KEYSIZE ];
  9.     BYTE plaintext[ SAFER_BLOCKSIZE ];
  10.     BYTE ciphertext[ SAFER_BLOCKSIZE ];
  11.     } SAFER_TEST;
  12.  
  13. static SAFER_TEST testSafer[] = {
  14.     { SAFER_K64_ROUNDS,
  15.       { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 },
  16.       { 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08 },
  17.       { 0x15, 0x1B, 0xFF, 0x02, 0xAD, 0x11, 0xBF, 0x2D } },
  18.     { SAFER_K64_ROUNDS,
  19.       { 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08 },
  20.       { 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08 },
  21.       { 0x5F, 0xCE, 0x9B, 0xA2, 0x05, 0x84, 0x38, 0xC7 } },
  22.     { SAFER_K128_ROUNDS,
  23.       { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
  24.         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 },
  25.       { 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08 },
  26.       { 0x41, 0x4C, 0x54, 0x5A, 0xB6, 0x99, 0x4A, 0xF7 } },
  27.     { SAFER_K128_ROUNDS,
  28.       { 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08,
  29.         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
  30.       { 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08 },
  31.       { 0xFF, 0x78, 0x11, 0xE4, 0xB3, 0xA7, 0x2E, 0x71 } },
  32.     { SAFER_K128_ROUNDS,
  33.       { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  34.         0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08 },
  35.       { 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08 },
  36.       { 0x49, 0xC9, 0x9D, 0x98, 0xA5, 0xBC, 0x59, 0x08 } },
  37.     };
  38.