comparison libtomcrypt/src/mac/pmac/pmac_test.c @ 415:8b9aba1d5fa4 channel-fix

merge of '73fe066c5d9e2395354ba74756124d45c978a04d' and 'f5014cc84558f1e8eba42dbecf9f72f94bfe6134'
author Matt Johnston <matt@ucc.asn.au>
date Tue, 06 Feb 2007 16:00:18 +0000 (2007-02-06)
parents 0cbe8f6dbf9e
children f849a5ca2efc
comparison
equal deleted inserted replaced
414:c53a26c430e5 415:8b9aba1d5fa4
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, tomstdenis@gmail.com, http://libtomcrypt.org 9 * Tom St Denis, tomstdenis@gmail.com, 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 $ */