Mercurial > dropbear
comparison libtomcrypt/src/hashes/tiger.c @ 511:582cb38e4eb5 insecure-nocrypto
propagate from branch 'au.asn.ucc.matt.dropbear' (head cdcc3c729e29544e8b98a408e2dc60e4483dfd2a)
to branch 'au.asn.ucc.matt.dropbear.insecure-nocrypto' (head 0ca38a1cf349f7426ac9de34ebe4c3e3735effab)
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Thu, 06 Nov 2008 13:16:55 +0000 |
parents | 0cbe8f6dbf9e |
children | f849a5ca2efc |
comparison
equal
deleted
inserted
replaced
361:461c4b1fb35f | 511:582cb38e4eb5 |
---|---|
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 #include "tomcrypt.h" | 12 #include "tomcrypt.h" |
13 | 13 |
14 /** | 14 /** |
30 9, | 30 9, |
31 | 31 |
32 &tiger_init, | 32 &tiger_init, |
33 &tiger_process, | 33 &tiger_process, |
34 &tiger_done, | 34 &tiger_done, |
35 &tiger_test | 35 &tiger_test, |
36 NULL | |
36 }; | 37 }; |
37 | 38 |
38 #define t1 (table) | 39 #define t1 (table) |
39 #define t2 (table+256) | 40 #define t2 (table+256) |
40 #define t3 (table+256*2) | 41 #define t3 (table+256*2) |
772 | 773 |
773 for (i = 0; i < (int)(sizeof(tests) / sizeof(tests[0])); i++) { | 774 for (i = 0; i < (int)(sizeof(tests) / sizeof(tests[0])); i++) { |
774 tiger_init(&md); | 775 tiger_init(&md); |
775 tiger_process(&md, (unsigned char *)tests[i].msg, (unsigned long)strlen(tests[i].msg)); | 776 tiger_process(&md, (unsigned char *)tests[i].msg, (unsigned long)strlen(tests[i].msg)); |
776 tiger_done(&md, tmp); | 777 tiger_done(&md, tmp); |
777 if (memcmp(tmp, tests[i].hash, 24) != 0) { | 778 if (XMEMCMP(tmp, tests[i].hash, 24) != 0) { |
778 return CRYPT_FAIL_TESTVECTOR; | 779 return CRYPT_FAIL_TESTVECTOR; |
779 } | 780 } |
780 } | 781 } |
781 return CRYPT_OK; | 782 return CRYPT_OK; |
782 #endif | 783 #endif |
807 | 808 |
808 | 809 |
809 | 810 |
810 | 811 |
811 /* $Source: /cvs/libtom/libtomcrypt/src/hashes/tiger.c,v $ */ | 812 /* $Source: /cvs/libtom/libtomcrypt/src/hashes/tiger.c,v $ */ |
812 /* $Revision: 1.5 $ */ | 813 /* $Revision: 1.8 $ */ |
813 /* $Date: 2005/05/23 02:42:07 $ */ | 814 /* $Date: 2006/11/01 09:28:17 $ */ |