Mercurial > dropbear
comparison src/mac/pmac/pmac_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 pmac_test.c | 14 @file pmac_test.c |
15 PMAC implementation, self-test, by Tom St Denis | 15 PMAC implementation, self-test, by Tom St Denis |
16 */ | 16 */ |
17 | 17 |
18 | 18 |
19 #ifdef PMAC | 19 #ifdef LTC_PMAC |
20 | 20 |
21 /** | 21 /** |
22 Test the OMAC implementation | 22 Test the OMAC implementation |
23 @return CRYPT_OK if successful, CRYPT_NOP if testing has been disabled | 23 @return CRYPT_OK if successful, CRYPT_NOP if testing has been disabled |
24 */ | 24 */ |
136 len = sizeof(outtag); | 136 len = sizeof(outtag); |
137 if ((err = pmac_memory(idx, tests[x].key, 16, tests[x].msg, tests[x].msglen, outtag, &len)) != CRYPT_OK) { | 137 if ((err = pmac_memory(idx, tests[x].key, 16, tests[x].msg, tests[x].msglen, outtag, &len)) != CRYPT_OK) { |
138 return err; | 138 return err; |
139 } | 139 } |
140 | 140 |
141 if (memcmp(outtag, tests[x].tag, len)) { | 141 if (XMEMCMP(outtag, tests[x].tag, len)) { |
142 #if 0 | 142 #if 0 |
143 unsigned long y; | 143 unsigned long y; |
144 printf("\nTAG:\n"); | 144 printf("\nTAG:\n"); |
145 for (y = 0; y < len; ) { | 145 for (y = 0; y < len; ) { |
146 printf("0x%02x", outtag[y]); | 146 printf("0x%02x", outtag[y]); |
159 | 159 |
160 | 160 |
161 | 161 |
162 | 162 |
163 /* $Source: /cvs/libtom/libtomcrypt/src/mac/pmac/pmac_test.c,v $ */ | 163 /* $Source: /cvs/libtom/libtomcrypt/src/mac/pmac/pmac_test.c,v $ */ |
164 /* $Revision: 1.3 $ */ | 164 /* $Revision: 1.6 $ */ |
165 /* $Date: 2005/05/05 14:35:59 $ */ | 165 /* $Date: 2006/11/03 00:39:49 $ */ |