comparison src/hashes/sha2/sha384.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 @param sha384.c 12 @param sha384.c
13 SHA384 hash included in sha512.c, Tom St Denis 13 SHA384 hash included in sha512.c, Tom St Denis
14 */ 14 */
25 9, 25 9,
26 26
27 &sha384_init, 27 &sha384_init,
28 &sha512_process, 28 &sha512_process,
29 &sha384_done, 29 &sha384_done,
30 &sha384_test 30 &sha384_test,
31 NULL
31 }; 32 };
32 33
33 /** 34 /**
34 Initialize the hash state 35 Initialize the hash state
35 @param md The hash state you wish to initialize 36 @param md The hash state you wish to initialize
114 115
115 for (i = 0; i < (int)(sizeof(tests) / sizeof(tests[0])); i++) { 116 for (i = 0; i < (int)(sizeof(tests) / sizeof(tests[0])); i++) {
116 sha384_init(&md); 117 sha384_init(&md);
117 sha384_process(&md, (unsigned char*)tests[i].msg, (unsigned long)strlen(tests[i].msg)); 118 sha384_process(&md, (unsigned char*)tests[i].msg, (unsigned long)strlen(tests[i].msg));
118 sha384_done(&md, tmp); 119 sha384_done(&md, tmp);
119 if (memcmp(tmp, tests[i].hash, 48) != 0) { 120 if (XMEMCMP(tmp, tests[i].hash, 48) != 0) {
120 return CRYPT_FAIL_TESTVECTOR; 121 return CRYPT_FAIL_TESTVECTOR;
121 } 122 }
122 } 123 }
123 return CRYPT_OK; 124 return CRYPT_OK;
124 #endif 125 #endif
128 129
129 130
130 131
131 132
132 /* $Source: /cvs/libtom/libtomcrypt/src/hashes/sha2/sha384.c,v $ */ 133 /* $Source: /cvs/libtom/libtomcrypt/src/hashes/sha2/sha384.c,v $ */
133 /* $Revision: 1.5 $ */ 134 /* $Revision: 1.8 $ */
134 /* $Date: 2005/05/23 02:42:07 $ */ 135 /* $Date: 2006/11/01 09:28:17 $ */