comparison libtomcrypt/src/mac/pmac/pmac_test.c @ 382:0cbe8f6dbf9e

propagate from branch 'au.asn.ucc.matt.ltc.dropbear' (head 2af22fb4e878750b88f80f90d439b316d229796f) to branch 'au.asn.ucc.matt.dropbear' (head 02c413252c90e9de8e03d91e9939dde3029f5c0a)
author Matt Johnston <matt@ucc.asn.au>
date Thu, 11 Jan 2007 02:41:05 +0000
parents 1b9e69c058d2
children f849a5ca2efc
comparison
equal deleted inserted replaced
379:b66a00272a90 382:0cbe8f6dbf9e
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 $ */