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_cipher_is_valid.c
13 Determine if cipher is valid, Tom St Denis
17 Test if a cipher index is valid
18 @param idx The index of the cipher to search for
19 @return CRYPT_OK if valid
21 int cipher_is_valid(int idx)
23 LTC_MUTEX_LOCK(<c_cipher_mutex);
24 if (idx < 0 || idx >= TAB_SIZE || cipher_descriptor[idx].name == NULL) {
25 LTC_MUTEX_UNLOCK(<c_cipher_mutex);
26 return CRYPT_INVALID_CIPHER;
28 LTC_MUTEX_UNLOCK(<c_cipher_mutex);
32 /* ref: $Format:%D$ */
33 /* git commit: $Format:%H$ */
34 /* commit time: $Format:%ai$ */