From: Steffen Klassert <steffen.klassert@secunet.com>
To: Herbert Xu <herbert@gondor.apana.org.au>
Cc: David Miller <davem@davemloft.net>, linux-crypto@vger.kernel.org
Subject: [PATCH] tcrypt: Test algorithms by name
Date: Fri, 19 Jun 2009 13:40:58 +0200 [thread overview]
Message-ID: <20090619114058.GY20366@secunet.com> (raw)
In-Reply-To: <20090619105627.GA17781@gondor.apana.org.au>
This adds the 'alg' module parameter to be able to test an
algorithm by name. If the algorithm type is not ad-hoc
clear for a algorithm (e.g. pcrypt, cryptd) it is possilbe
to set the algorithm type with the 'type' module parameter.
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
---
crypto/tcrypt.c | 15 ++++++++++++++-
1 files changed, 14 insertions(+), 1 deletions(-)
diff --git a/crypto/tcrypt.c b/crypto/tcrypt.c
index d59ba50..dfeec0c 100644
--- a/crypto/tcrypt.c
+++ b/crypto/tcrypt.c
@@ -45,6 +45,8 @@
*/
static unsigned int sec;
+static char *alg = NULL;
+static u32 type;
static int mode;
static char *tvmem[TVMEMSIZE];
@@ -885,6 +887,11 @@ static int do_test(int m)
return ret;
}
+static int do_alg_test(const char *alg, u32 type)
+{
+ return crypto_has_alg(alg, type, CRYPTO_ALG_TYPE_MASK);
+}
+
static int __init tcrypt_mod_init(void)
{
int err = -ENOMEM;
@@ -896,7 +903,11 @@ static int __init tcrypt_mod_init(void)
goto err_free_tv;
}
- err = do_test(mode);
+ if (alg)
+ err = do_alg_test(alg, type);
+ else
+ err = do_test(mode);
+
if (err) {
printk(KERN_ERR "tcrypt: one or more tests failed!\n");
goto err_free_tv;
@@ -928,6 +939,8 @@ static void __exit tcrypt_mod_fini(void) { }
module_init(tcrypt_mod_init);
module_exit(tcrypt_mod_fini);
+module_param(alg, charp, 0);
+module_param(type, uint, 0);
module_param(mode, int, 0);
module_param(sec, uint, 0);
MODULE_PARM_DESC(sec, "Length in seconds of speed tests "
--
1.5.4.2
next prev parent reply other threads:[~2009-06-19 11:38 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-08 7:07 [RFC] [PATCH 0/5] Parallel IPsec v4 Steffen Klassert
2009-06-08 7:08 ` [RFC] [PATCH 1/5] padata: generic interface for parallel processing Steffen Klassert
2009-06-08 7:10 ` [RFC] [PATCH 2/5] pcrypt: Add pcrypt crypto parallelization wrapper Steffen Klassert
2009-06-19 12:21 ` Herbert Xu
2009-06-23 6:21 ` Steffen Klassert
2009-06-19 12:29 ` Herbert Xu
2009-06-23 8:29 ` Steffen Klassert
2009-06-23 8:34 ` Herbert Xu
2009-06-23 9:14 ` Steffen Klassert
2009-06-23 9:18 ` Herbert Xu
2009-06-23 10:19 ` Steffen Klassert
2009-06-23 10:19 ` Herbert Xu
2009-06-08 7:10 ` [RFC] [PATCH 3/5] eseqiv: Add support for aead algorithms Steffen Klassert
2009-06-25 10:46 ` Herbert Xu
2009-06-29 11:12 ` Steffen Klassert
2009-06-08 7:11 ` [RFC] [PATCH 4/5] authenc: Check if the IV is already added to the scatterlist Steffen Klassert
2009-06-08 7:12 ` [RFC] [PATCH 5/5] tcrypt: Test algorithms by name Steffen Klassert
2009-06-19 10:53 ` Herbert Xu
2009-06-19 10:56 ` Herbert Xu
2009-06-19 11:40 ` Steffen Klassert [this message]
2009-06-19 11:47 ` [PATCH] " Herbert Xu
2009-06-19 12:38 ` Herbert Xu
2009-06-23 6:04 ` Steffen Klassert
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20090619114058.GY20366@secunet.com \
--to=steffen.klassert@secunet.com \
--cc=davem@davemloft.net \
--cc=herbert@gondor.apana.org.au \
--cc=linux-crypto@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.