comparison libtomcrypt/src/hashes/whirl/whirl.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 11
12 /** 12 /**
13 @file whirl.c 13 @file whirl.c
14 WHIRLPOOL (using their new sbox) hash function by Tom St Denis 14 WHIRLPOOL (using their new sbox) hash function by Tom St Denis
30 6, 30 6,
31 31
32 &whirlpool_init, 32 &whirlpool_init,
33 &whirlpool_process, 33 &whirlpool_process,
34 &whirlpool_done, 34 &whirlpool_done,
35 &whirlpool_test 35 &whirlpool_test,
36 NULL
36 }; 37 };
37 38
38 /* the sboxes */ 39 /* the sboxes */
39 #include "whirltab.c" 40 #include "whirltab.c"
40 41
287 288
288 for (i = 0; i < (int)(sizeof(tests)/sizeof(tests[0])); i++) { 289 for (i = 0; i < (int)(sizeof(tests)/sizeof(tests[0])); i++) {
289 whirlpool_init(&md); 290 whirlpool_init(&md);
290 whirlpool_process(&md, (unsigned char *)tests[i].msg, tests[i].len); 291 whirlpool_process(&md, (unsigned char *)tests[i].msg, tests[i].len);
291 whirlpool_done(&md, tmp); 292 whirlpool_done(&md, tmp);
292 if (memcmp(tmp, tests[i].hash, 64) != 0) { 293 if (XMEMCMP(tmp, tests[i].hash, 64) != 0) {
293 #if 0 294 #if 0
294 printf("\nFailed test %d\n", i); 295 printf("\nFailed test %d\n", i);
295 for (i = 0; i < 64; ) { 296 for (i = 0; i < 64; ) {
296 printf("%02x ", tmp[i]); 297 printf("%02x ", tmp[i]);
297 if (!(++i & 15)) printf("\n"); 298 if (!(++i & 15)) printf("\n");
307 308
308 #endif 309 #endif
309 310
310 311
311 /* $Source: /cvs/libtom/libtomcrypt/src/hashes/whirl/whirl.c,v $ */ 312 /* $Source: /cvs/libtom/libtomcrypt/src/hashes/whirl/whirl.c,v $ */
312 /* $Revision: 1.5 $ */ 313 /* $Revision: 1.8 $ */
313 /* $Date: 2005/05/23 02:42:07 $ */ 314 /* $Date: 2006/11/01 09:28:17 $ */