Mercurial > dropbear
diff demos/hashsum.c @ 143:5d99163f7e32 libtomcrypt-orig
import of libtomcrypt 0.99
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Sun, 19 Dec 2004 11:34:45 +0000 |
parents | 7faae8f46238 |
children | 1c15b283127b |
line wrap: on
line diff
--- a/demos/hashsum.c Tue Jun 15 14:07:21 2004 +0000 +++ b/demos/hashsum.c Sun Dec 19 11:34:45 2004 +0000 @@ -7,7 +7,7 @@ * more functions ;) */ -#include <mycrypt_custom.h> +#include <mycrypt.h> int errno; @@ -26,7 +26,7 @@ printf("usage: ./hash algorithm file [file ...]\n"); printf("Algorithms:\n"); for (x = 0; hash_descriptor[x].name != NULL; x++) { - printf(" %s\n", hash_descriptor[x].name); + printf(" %s (%d)\n", hash_descriptor[x].name, hash_descriptor[x].ID); } exit(EXIT_SUCCESS); } @@ -66,6 +66,8 @@ void register_algs(void) { + int err; + #ifdef TIGER register_hash (&tiger_desc); #endif @@ -102,5 +104,12 @@ #ifdef WHIRLPOOL register_hash (&whirlpool_desc); #endif +#ifdef CHC_HASH + register_hash(&chc_desc); + if ((err = chc_register(register_cipher(&aes_enc_desc))) != CRYPT_OK) { + printf("chc_register error: %s\n", error_to_string(err)); + exit(EXIT_FAILURE); + } +#endif }