comparison src/mac/omac/omac_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 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 $ */