1 /* LibTomCrypt, modular cryptographic library -- Tom St Denis
3 * LibTomCrypt is a library that provides various cryptographic
4 * algorithms in a highly modular and flexible manner.
6 * The library is free for all purposes without any express
12 @file crypt_find_hash.c
13 Find a hash, Tom St Denis
17 Find a registered hash by name
18 @param name The name of the hash to look for
19 @return >= 0 if found, -1 if not present
21 int find_hash(const char *name)
24 LTC_ARGCHK(name != NULL);
25 LTC_MUTEX_LOCK(<c_hash_mutex);
26 for (x = 0; x < TAB_SIZE; x++) {
27 if (hash_descriptor[x].name != NULL && XSTRCMP(hash_descriptor[x].name, name) == 0) {
28 LTC_MUTEX_UNLOCK(<c_hash_mutex);
32 LTC_MUTEX_UNLOCK(<c_hash_mutex);
36 /* ref: $Format:%D$ */
37 /* git commit: $Format:%H$ */
38 /* commit time: $Format:%ai$ */