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

int find_hash ( const char *  name )

Find a registered hash by name

Parameters:
nameThe name of the hash to look for
Returns:
>= 0 if found, -1 if not present

Definition at line 23 of file crypt_find_hash.c.

Referenced by find_hash_any(), and hmac_test().

{
   int x;
   LTC_ARGCHK(name != NULL);
   LTC_MUTEX_LOCK(&ltc_hash_mutex);
   for (x = 0; x < TAB_SIZE; x++) {
       if (hash_descriptor[x].name != NULL && XSTRCMP(hash_descriptor[x].name, name) == 0) {
          LTC_MUTEX_UNLOCK(&ltc_hash_mutex);
          return x;
       }
   }
   LTC_MUTEX_UNLOCK(&ltc_hash_mutex);
   return -1;
}

Here is the caller graph for this function:


Generated by  Doxygen 1.6.0   Back to index