summaryrefslogtreecommitdiffstats
path: root/libtomcrypt/hashes/hash_get_oid.c
diff options
context:
space:
mode:
authorMiloslav Trmač <mitr@redhat.com>2010-07-24 11:54:02 +0200
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2010-07-24 11:54:02 +0200
commit951eda087f418c2a5ced189fa9d64c8616634dd0 (patch)
tree72050e803bfce0e4c8454011078f10435bb66f04 /libtomcrypt/hashes/hash_get_oid.c
parentc13723d4a2a9627f4cd85d47954ab1fd3a115dbd (diff)
downloadcryptodev-linux-951eda087f418c2a5ced189fa9d64c8616634dd0.tar.gz
cryptodev-linux-951eda087f418c2a5ced189fa9d64c8616634dd0.tar.xz
cryptodev-linux-951eda087f418c2a5ced189fa9d64c8616634dd0.zip
Use of algo_properties to avoid linear search on a table for each property.
Diffstat (limited to 'libtomcrypt/hashes/hash_get_oid.c')
-rw-r--r--libtomcrypt/hashes/hash_get_oid.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libtomcrypt/hashes/hash_get_oid.c b/libtomcrypt/hashes/hash_get_oid.c
index 32e4390..c6469ba 100644
--- a/libtomcrypt/hashes/hash_get_oid.c
+++ b/libtomcrypt/hashes/hash_get_oid.c
@@ -46,9 +46,9 @@ static const oid_st sha512_oid = {
.OID = { 2, 16, 840, 1, 101, 3, 4, 2, 3, },
};
-int hash_get_oid(int hash, oid_st *st)
+int hash_get_oid(const struct algo_properties_st *hash, oid_st *st)
{
- switch (hash) {
+ switch (hash->algo) {
case NCR_ALG_SHA1:
memcpy(st, &sha1_oid, sizeof(*st));
break;