comparison libtomcrypt/src/mac/omac/omac_test.c @ 435:337c45621e81

merge of 'a9b0496634cdd25647b65e585cc3240f3fa699ee' and 'c22be8b8f570b48e9662dac32c7b3e7148a42206'
author Matt Johnston <matt@ucc.asn.au>
date Thu, 22 Feb 2007 14:53:49 +0000
parents 0cbe8f6dbf9e
children f849a5ca2efc
comparison
equal deleted inserted replaced
434:0aaaf68e97dc 435:337c45621e81
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 omac_test.c 14 @file omac_test.c
15 OMAC1 support, self-test, by Tom St Denis 15 OMAC1 support, self-test, by Tom St Denis
16 */ 16 */
17 17
18 #ifdef OMAC 18 #ifdef LTC_OMAC
19 19
20 /** 20 /**
21 Test the OMAC setup 21 Test the OMAC setup
22 @return CRYPT_OK if successful, CRYPT_NOP if tests have been disabled 22 @return CRYPT_OK if successful, CRYPT_NOP if tests have been disabled
23 */ 23 */
88 len = sizeof(out); 88 len = sizeof(out);
89 if ((err = omac_memory(idx, tests[x].key, tests[x].keylen, tests[x].msg, tests[x].msglen, out, &len)) != CRYPT_OK) { 89 if ((err = omac_memory(idx, tests[x].key, tests[x].keylen, tests[x].msg, tests[x].msglen, out, &len)) != CRYPT_OK) {
90 return err; 90 return err;
91 } 91 }
92 92
93 if (memcmp(out, tests[x].tag, 16) != 0) { 93 if (XMEMCMP(out, tests[x].tag, 16) != 0) {
94 #if 0 94 #if 0
95 int y; 95 int y;
96 printf("\n\nTag: "); 96 printf("\n\nTag: ");
97 for (y = 0; y < 16; y++) printf("%02x", out[y]); printf("\n\n"); 97 for (y = 0; y < 16; y++) printf("%02x", out[y]); printf("\n\n");
98 #endif 98 #endif
104 } 104 }
105 105
106 #endif 106 #endif
107 107
108 /* $Source: /cvs/libtom/libtomcrypt/src/mac/omac/omac_test.c,v $ */ 108 /* $Source: /cvs/libtom/libtomcrypt/src/mac/omac/omac_test.c,v $ */
109 /* $Revision: 1.3 $ */ 109 /* $Revision: 1.6 $ */
110 /* $Date: 2005/05/05 14:35:59 $ */ 110 /* $Date: 2006/11/03 00:39:49 $ */