Mercurial > dropbear
comparison src/misc/crypt/crypt_unregister_hash.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 |
---|---|
25 int x; | 25 int x; |
26 | 26 |
27 LTC_ARGCHK(hash != NULL); | 27 LTC_ARGCHK(hash != NULL); |
28 | 28 |
29 /* is it already registered? */ | 29 /* is it already registered? */ |
30 LTC_MUTEX_LOCK(<c_hash_mutex); | |
30 for (x = 0; x < TAB_SIZE; x++) { | 31 for (x = 0; x < TAB_SIZE; x++) { |
31 if (memcmp(&hash_descriptor[x], hash, sizeof(struct ltc_hash_descriptor)) == 0) { | 32 if (memcmp(&hash_descriptor[x], hash, sizeof(struct ltc_hash_descriptor)) == 0) { |
32 hash_descriptor[x].name = NULL; | 33 hash_descriptor[x].name = NULL; |
34 LTC_MUTEX_UNLOCK(<c_hash_mutex); | |
33 return CRYPT_OK; | 35 return CRYPT_OK; |
34 } | 36 } |
35 } | 37 } |
38 LTC_MUTEX_UNLOCK(<c_hash_mutex); | |
36 return CRYPT_ERROR; | 39 return CRYPT_ERROR; |
37 } | 40 } |
41 | |
42 /* $Source: /cvs/libtom/libtomcrypt/src/misc/crypt/crypt_unregister_hash.c,v $ */ | |
43 /* $Revision: 1.4 $ */ | |
44 /* $Date: 2005/06/19 18:00:28 $ */ |