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