diff options
author | Miloslav Trmač <mitr@redhat.com> | 2010-07-24 11:54:02 +0200 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2010-07-24 11:54:02 +0200 |
commit | 951eda087f418c2a5ced189fa9d64c8616634dd0 (patch) | |
tree | 72050e803bfce0e4c8454011078f10435bb66f04 /libtomcrypt/hashes/hash_get_oid.c | |
parent | c13723d4a2a9627f4cd85d47954ab1fd3a115dbd (diff) | |
download | cryptodev-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.c | 4 |
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; |