Mercurial > dropbear
comparison src/misc/crypt/crypt_find_hash_id.c @ 209:39d5d58461d6 libtomcrypt-orig LTC_1.05
Import of libtomcrypt 1.05
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Wed, 06 Jul 2005 03:53:40 +0000 |
parents | 1c15b283127b |
children |
comparison
equal
deleted
inserted
replaced
191:1c15b283127b | 209:39d5d58461d6 |
---|---|
21 @return >= 0 if found, -1 if not present | 21 @return >= 0 if found, -1 if not present |
22 */ | 22 */ |
23 int find_hash_id(unsigned char ID) | 23 int find_hash_id(unsigned char ID) |
24 { | 24 { |
25 int x; | 25 int x; |
26 LTC_MUTEX_LOCK(<c_hash_mutex); | |
26 for (x = 0; x < TAB_SIZE; x++) { | 27 for (x = 0; x < TAB_SIZE; x++) { |
27 if (hash_descriptor[x].ID == ID) { | 28 if (hash_descriptor[x].ID == ID) { |
28 return (hash_descriptor[x].name == NULL) ? -1 : x; | 29 x = (hash_descriptor[x].name == NULL) ? -1 : x; |
29 } | 30 LTC_MUTEX_UNLOCK(<c_hash_mutex); |
31 return x; | |
32 } | |
30 } | 33 } |
34 LTC_MUTEX_UNLOCK(<c_hash_mutex); | |
31 return -1; | 35 return -1; |
32 } | 36 } |
37 | |
38 /* $Source: /cvs/libtom/libtomcrypt/src/misc/crypt/crypt_find_hash_id.c,v $ */ | |
39 /* $Revision: 1.5 $ */ | |
40 /* $Date: 2005/06/19 18:03:25 $ */ |