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_id.c
13 Find hash by ID, Tom St Denis
17 Find a hash by ID number
18 @param ID The ID (not same as index) of the hash to find
19 @return >= 0 if found, -1 if not present
21 int find_hash_id(unsigned char ID)
24 LTC_MUTEX_LOCK(<c_hash_mutex);
25 for (x = 0; x < TAB_SIZE; x++) {
26 if (hash_descriptor[x].ID == ID) {
27 x = (hash_descriptor[x].name == NULL) ? -1 : x;
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$ */