+2005-06-10 Ken Raeburn <raeburn@mit.edu>
+
+ * destest.c (main): Force testing of unaligned access to input,
+ output, and key blocks.
+
2005-06-09 Ken Raeburn <raeburn@mit.edu>
* f_tables.h: Include k5-platform.h.
char *argv[];
{
char block1[17], block2[17], block3[17];
-
+#if 0
mit_des_cblock key, input, output, output2;
+#else
+ /* Force tests of unaligned accesses. */
+ union { unsigned char c[8*4+3]; long l; } u;
+ unsigned char *ioblocks = u.c;
+ unsigned char *input = ioblocks+1;
+ unsigned char *output = ioblocks+10;
+ unsigned char *output2 = ioblocks+19;
+ unsigned char *key = ioblocks+27;
+#endif
mit_des_key_schedule sched;
int num = 0;
int retval;
fprintf(stderr, "des test: can't process key");
exit(1);
}
- mit_des_cbc_encrypt((const mit_des_cblock *) &input, &output2, 8,
+ mit_des_cbc_encrypt((const mit_des_cblock *) input, output2, 8,
sched, zeroblock, 1);
if (memcmp((char *)output2, (char *)output, 8)) {
/*
* Now try decrypting....
*/
- mit_des_cbc_encrypt((const mit_des_cblock *) &output, &output2, 8,
+ mit_des_cbc_encrypt((const mit_des_cblock *) output, output2, 8,
sched, zeroblock, 0);
if (memcmp((char *)output2, (char *)input, 8)) {