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 /ncr.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 'ncr.c')
-rw-r--r-- | ncr.c | 28 |
1 files changed, 0 insertions, 28 deletions
@@ -173,31 +173,3 @@ ncr_ioctl(struct ncr_lists* lst, struct file *filp, return -EINVAL; } } - -/* Returns NCR_KEY_TYPE_SECRET if a secret key algorithm or MAC is given, - * and NCR_KEY_TYPE_PUBLIC if a public key algorithm is given. - */ -ncr_key_type_t ncr_algorithm_to_key_type(ncr_algorithm_t algo) -{ - switch(algo) { - case NCR_ALG_3DES_CBC: - case NCR_ALG_AES_CBC: - case NCR_ALG_CAMELLIA_CBC: - case NCR_ALG_ARCFOUR: - case NCR_ALG_HMAC_SHA1: - case NCR_ALG_HMAC_MD5: - case NCR_ALG_HMAC_SHA2_224: - case NCR_ALG_HMAC_SHA2_256: - case NCR_ALG_HMAC_SHA2_384: - case NCR_ALG_HMAC_SHA2_512: - return NCR_KEY_TYPE_SECRET; - case NCR_ALG_RSA: - case NCR_ALG_DSA: - return NCR_KEY_TYPE_PUBLIC; - default: - return NCR_KEY_TYPE_INVALID; - } - -} - - |