comparison src/hashes/whirl/whirl.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 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 $ */