comparison src/mac/pelican/pelican_test.c @ 380:d5faf4814ddb libtomcrypt-orig libtomcrypt-1.16

Update to LibTomCrypt 1.16
author Matt Johnston <matt@ucc.asn.au>
date Thu, 11 Jan 2007 02:22:00 +0000
parents 59400faa4b44
children
comparison
equal deleted inserted replaced
280:59400faa4b44 380:d5faf4814ddb
4 * algorithms in a highly modular and flexible manner. 4 * algorithms in a highly modular and flexible manner.
5 * 5 *
6 * The library is free for all purposes without any express 6 * The library is free for all purposes without any express
7 * guarantee it works. 7 * guarantee it works.
8 * 8 *
9 * Tom St Denis, [email protected], http://libtomcrypt.org 9 * Tom St Denis, [email protected], http://libtomcrypt.com
10 */ 10 */
11 #include "tomcrypt.h" 11 #include "tomcrypt.h"
12 12
13 /** 13 /**
14 @file pelican_test.c 14 @file pelican_test.c
22 #ifndef LTC_TEST 22 #ifndef LTC_TEST
23 return CRYPT_NOP; 23 return CRYPT_NOP;
24 #else 24 #else
25 static const struct { 25 static const struct {
26 unsigned char K[32], MSG[64], T[16]; 26 unsigned char K[32], MSG[64], T[16];
27 int keylen, ptlen; 27 int keylen, ptlen;
28 } tests[] = { 28 } tests[] = {
29 /* K=16, M=0 */ 29 /* K=16, M=0 */
30 { 30 {
31 { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 31 { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
32 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F }, 32 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F },
97 } 97 }
98 if ((err = pelican_done(&pel, out)) != CRYPT_OK) { 98 if ((err = pelican_done(&pel, out)) != CRYPT_OK) {
99 return err; 99 return err;
100 } 100 }
101 101
102 if (memcmp(out, tests[x].T, 16)) { 102 if (XMEMCMP(out, tests[x].T, 16)) {
103 #if 0 103 #if 0
104 int y; 104 int y;
105 printf("\nFailed test %d\n", x); 105 printf("\nFailed test %d\n", x);
106 printf("{ "); for (y = 0; y < 16; ) { printf("0x%02x, ", out[y]); if (!(++y & 7)) printf("\n"); } printf(" }\n"); 106 printf("{ "); for (y = 0; y < 16; ) { printf("0x%02x, ", out[y]); if (!(++y & 7)) printf("\n"); } printf(" }\n");
107 #endif 107 #endif
114 114
115 115
116 #endif 116 #endif
117 117
118 /* $Source: /cvs/libtom/libtomcrypt/src/mac/pelican/pelican_test.c,v $ */ 118 /* $Source: /cvs/libtom/libtomcrypt/src/mac/pelican/pelican_test.c,v $ */
119 /* $Revision: 1.9 $ */ 119 /* $Revision: 1.12 $ */
120 /* $Date: 2005/05/05 14:35:59 $ */ 120 /* $Date: 2006/11/21 00:18:23 $ */