diff options
author | Ken Raeburn <raeburn@mit.edu> | 2005-06-10 20:40:34 +0000 |
---|---|---|
committer | Ken Raeburn <raeburn@mit.edu> | 2005-06-10 20:40:34 +0000 |
commit | d8314626758a50370954a3716ac9aaac45d3f1d6 (patch) | |
tree | 409a92de158cac96ef43772c8807501196a18227 /src | |
parent | a02b8c67b35d2445dffbe2a9a0435627aaa6167d (diff) | |
download | krb5-d8314626758a50370954a3716ac9aaac45d3f1d6.tar.gz krb5-d8314626758a50370954a3716ac9aaac45d3f1d6.tar.xz krb5-d8314626758a50370954a3716ac9aaac45d3f1d6.zip |
* destest.c (main): Force testing of unaligned access to input, output, and key
blocks.
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@17237 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/crypto/des/ChangeLog | 5 | ||||
-rw-r--r-- | src/lib/crypto/des/destest.c | 15 |
2 files changed, 17 insertions, 3 deletions
diff --git a/src/lib/crypto/des/ChangeLog b/src/lib/crypto/des/ChangeLog index df5a9d62d..3e1628a44 100644 --- a/src/lib/crypto/des/ChangeLog +++ b/src/lib/crypto/des/ChangeLog @@ -1,3 +1,8 @@ +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. diff --git a/src/lib/crypto/des/destest.c b/src/lib/crypto/des/destest.c index 0995b08bb..2582cc3d3 100644 --- a/src/lib/crypto/des/destest.c +++ b/src/lib/crypto/des/destest.c @@ -71,8 +71,17 @@ main(argc, argv) 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; @@ -89,7 +98,7 @@ main(argc, argv) 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)) { @@ -104,7 +113,7 @@ main(argc, argv) /* * 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)) { |