From 9d14aa5a07fada286cc9a76aa9245bc1be859001 Mon Sep 17 00:00:00 2001 From: Richard Basch Date: Thu, 14 Dec 1995 00:50:25 +0000 Subject: [PATCH] * t_verify.c: Added an n-fold test git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@7231 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/crypto/des/t_verify.c | 36 +++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/src/lib/crypto/des/t_verify.c b/src/lib/crypto/des/t_verify.c index 7ae08c763..cf7a56167 100644 --- a/src/lib/crypto/des/t_verify.c +++ b/src/lib/crypto/des/t_verify.c @@ -45,6 +45,7 @@ int mit_des_debug; krb5_encrypt_block eblock; krb5_keyblock keyblock; +krb5_data kdata; unsigned char cipher_text[64]; unsigned char clear_text[64] = "Now is the time for all " ; @@ -55,6 +56,23 @@ unsigned char zero_text[8] = {0x0,0,0,0,0,0,0,0}; unsigned char msb_text[8] = {0x0,0,0,0, 0,0,0,0x40}; /* to ANSI MSB */ unsigned char *input; +unsigned char *nfold_in[] = { + "basch", + "eichin", + "sommerfeld", + "MASSACHVSETTS INSTITVTE OF TECHNOLOGY" }; + +unsigned char nfold_192[4][24] = { + { 0x1a, 0xab, 0x6b, 0x42, 0x96, 0x4b, 0x98, 0xb2, 0x1f, 0x8c, 0xde, 0x2d, + 0x24, 0x48, 0xba, 0x34, 0x55, 0xd7, 0x86, 0x2c, 0x97, 0x31, 0x64, 0x3f }, + { 0x65, 0x69, 0x63, 0x68, 0x69, 0x6e, 0x4b, 0x73, 0x2b, 0x4b, 0x1b, 0x43, + 0xda, 0x1a, 0x5b, 0x99, 0x5a, 0x58, 0xd2, 0xc6, 0xd0, 0xd2, 0xdc, 0xca }, + { 0x2f, 0x7a, 0x98, 0x55, 0x7c, 0x6e, 0xe4, 0xab, 0xad, 0xf4, 0xe7, 0x11, + 0x92, 0xdd, 0x44, 0x2b, 0xd4, 0xff, 0x53, 0x25, 0xa5, 0xde, 0xf7, 0x5c }, + { 0xdb, 0x3b, 0x0d, 0x8f, 0x0b, 0x06, 0x1e, 0x60, 0x32, 0x82, 0xb3, 0x08, + 0xa5, 0x08, 0x41, 0x22, 0x9a, 0xd7, 0x98, 0xfa, 0xb9, 0x54, 0x0c, 0x1b } +}; + /* 0x0123456789abcdef */ unsigned char default_key[8] = { 0x01,0x23,0x45,0x67,0x89,0xab,0xcd,0xef @@ -339,6 +357,24 @@ main(argc,argv) } else printf("verify: CBC checksum is correct\n\n"); + + printf("N-fold\n"); + for (i=0; i