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_unregister_cipher.c
13 Unregister a cipher, Tom St Denis
17 Unregister a cipher from the descriptor table
18 @param cipher The cipher descriptor to remove
19 @return CRYPT_OK on success
21 int unregister_cipher(const struct ltc_cipher_descriptor *cipher)
25 LTC_ARGCHK(cipher != NULL);
27 /* is it already registered? */
28 LTC_MUTEX_LOCK(<c_cipher_mutex);
29 for (x = 0; x < TAB_SIZE; x++) {
30 if (XMEMCMP(&cipher_descriptor[x], cipher, sizeof(struct ltc_cipher_descriptor)) == 0) {
31 cipher_descriptor[x].name = NULL;
32 cipher_descriptor[x].ID = 255;
33 LTC_MUTEX_UNLOCK(<c_cipher_mutex);
37 LTC_MUTEX_UNLOCK(<c_cipher_mutex);
41 /* ref: $Format:%D$ */
42 /* git commit: $Format:%H$ */
43 /* commit time: $Format:%ai$ */