comparison src/misc/crypt/crypt_cipher_is_valid.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
20 @param idx The index of the cipher to search for 20 @param idx The index of the cipher to search for
21 @return CRYPT_OK if valid 21 @return CRYPT_OK if valid
22 */ 22 */
23 int cipher_is_valid(int idx) 23 int cipher_is_valid(int idx)
24 { 24 {
25 LTC_MUTEX_LOCK(&ltc_cipher_mutex);
25 if (idx < 0 || idx >= TAB_SIZE || cipher_descriptor[idx].name == NULL) { 26 if (idx < 0 || idx >= TAB_SIZE || cipher_descriptor[idx].name == NULL) {
27 LTC_MUTEX_UNLOCK(&ltc_cipher_mutex);
26 return CRYPT_INVALID_CIPHER; 28 return CRYPT_INVALID_CIPHER;
27 } 29 }
30 LTC_MUTEX_UNLOCK(&ltc_cipher_mutex);
28 return CRYPT_OK; 31 return CRYPT_OK;
29 } 32 }
33
34 /* $Source: /cvs/libtom/libtomcrypt/src/misc/crypt/crypt_cipher_is_valid.c,v $ */
35 /* $Revision: 1.4 $ */
36 /* $Date: 2005/06/19 18:00:28 $ */