Logo Search packages:      
Sourcecode: libtomcrypt version File versions  Download package

int unregister_cipher ( const struct ltc_cipher_descriptor cipher  ) 

Unregister a cipher from the descriptor table

Parameters:
cipher The cipher descriptor to remove
Returns:
CRYPT_OK on success

Definition at line 23 of file crypt_unregister_cipher.c.

References ltc_cipher_descriptor::ID, and ltc_cipher_descriptor::name.

{
   int x;

   LTC_ARGCHK(cipher != NULL);

   /* is it already registered? */
   LTC_MUTEX_LOCK(&ltc_cipher_mutex);
   for (x = 0; x < TAB_SIZE; x++) {
       if (XMEMCMP(&cipher_descriptor[x], cipher, sizeof(struct ltc_cipher_descriptor)) == 0) {
          cipher_descriptor[x].name = NULL;
          cipher_descriptor[x].ID   = 255;
          LTC_MUTEX_UNLOCK(&ltc_cipher_mutex);
          return CRYPT_OK;
       }
   }
   LTC_MUTEX_UNLOCK(&ltc_cipher_mutex);
   return CRYPT_ERROR;
}


Generated by  Doxygen 1.6.0   Back to index