3 * This crypt(3) validation program shipped with UFC-crypt
4 * is derived from one distributed with Phil Karns PD DES package.
6 * @(#)cert.c 1.8 11 Aug 1996
13 static int totfails = 0;
15 static void good_bye (void) __attribute__ ((noreturn));
16 static void good_bye (void)
19 printf("Passed DES validation suite\n");
22 printf("%d failures during DES validation suite!!!\n", totfails);
27 static void get8(char *cp)
36 *cp++ = (t & (0x01 << (7-j))) != 0;
41 static void put8(char *cp)
55 char key[64],plain[64],cipher[64],answer[64];
60 for(test=0;!feof(stdin);test++){
63 printf(" K: "); put8(key);
67 printf(" P: "); put8(plain);
70 printf(" C: "); put8(answer);
77 if(cipher[i] != answer[i])
82 printf(" Encrypt FAIL");
89 if(cipher[i] != plain[i])
92 printf(" Decrypt FAIL");