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