added libtomcrypt-1.05

This commit is contained in:
Tom St Denis
2005-06-27 11:47:35 +00:00
committed by Steffen Jaeckel
parent 9da48eb84b
commit 9264e34ffb
49 changed files with 1008 additions and 109 deletions
+4
View File
@@ -27,8 +27,10 @@ int register_hash(const struct ltc_hash_descriptor *hash)
LTC_ARGCHK(hash != NULL);
/* is it already registered? */
LTC_MUTEX_LOCK(&ltc_hash_mutex);
for (x = 0; x < TAB_SIZE; x++) {
if (memcmp(&hash_descriptor[x], hash, sizeof(struct ltc_hash_descriptor)) == 0) {
LTC_MUTEX_UNLOCK(&ltc_hash_mutex);
return x;
}
}
@@ -37,11 +39,13 @@ int register_hash(const struct ltc_hash_descriptor *hash)
for (x = 0; x < TAB_SIZE; x++) {
if (hash_descriptor[x].name == NULL) {
XMEMCPY(&hash_descriptor[x], hash, sizeof(struct ltc_hash_descriptor));
LTC_MUTEX_UNLOCK(&ltc_hash_mutex);
return x;
}
}
/* no spot */
LTC_MUTEX_UNLOCK(&ltc_hash_mutex);
return -1;
}