From: Denis Cheng <crquan@gmail.com>
To: Herbert Xu <herbert@gondor.apana.org.au>,
"David S. Miller" <davem@davemloft.net>
Cc: linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org,
Randy Dunlap <randy.dunlap@oracle.com>
Subject: [PATCH 1/2] crypto test: use print_hex_dump from <linux/kernel.h>
Date: Mon, 26 Nov 2007 15:13:02 +0800 [thread overview]
Message-ID: <1196061182-6368-1-git-send-email-crquan@gmail.com> (raw)
these utilities implemented in lib/hexdump.c are more handy, please use this.
Cc: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Denis Cheng <crquan@gmail.com>
---
crypto/tcrypt.c | 21 +++++++--------------
1 files changed, 7 insertions(+), 14 deletions(-)
diff --git a/crypto/tcrypt.c b/crypto/tcrypt.c
index 24141fb..8766023 100644
--- a/crypto/tcrypt.c
+++ b/crypto/tcrypt.c
@@ -81,14 +81,6 @@ static char *check[] = {
"camellia", "seed", NULL
};
-static void hexdump(unsigned char *buf, unsigned int len)
-{
- while (len--)
- printk("%02x", *buf++);
-
- printk("\n");
-}
-
static void tcrypt_complete(struct crypto_async_request *req, int err)
{
struct tcrypt_result *res = req->data;
@@ -156,7 +148,8 @@ static void test_hash(char *algo, struct hash_testvec *template,
goto out;
}
- hexdump(result, crypto_hash_digestsize(tfm));
+ print_hex_dump(KERN_DEBUG, "", DUMP_PREFIX_OFFSET, 16, 1, result, crypto_hash_digestsize(tfm), 1);
+
printk("%s\n",
memcmp(result, hash_tv[i].digest,
crypto_hash_digestsize(tfm)) ?
@@ -203,7 +196,7 @@ static void test_hash(char *algo, struct hash_testvec *template,
goto out;
}
- hexdump(result, crypto_hash_digestsize(tfm));
+ print_hex_dump(KERN_DEBUG, "", DUMP_PREFIX_OFFSET, 16, 1, result, crypto_hash_digestsize(tfm), 1);
printk("%s\n",
memcmp(result, hash_tv[i].digest,
crypto_hash_digestsize(tfm)) ?
@@ -319,7 +312,7 @@ static void test_cipher(char *algo, int enc,
}
q = kmap(sg_page(&sg[0])) + sg[0].offset;
- hexdump(q, cipher_tv[i].rlen);
+ print_hex_dump(KERN_DEBUG, "", DUMP_PREFIX_OFFSET, 16, 1, q, cipher_tv[i].rlen, 1);
printk("%s\n",
memcmp(q, cipher_tv[i].result,
@@ -393,7 +386,7 @@ static void test_cipher(char *algo, int enc,
for (k = 0; k < cipher_tv[i].np; k++) {
printk("page %u\n", k);
q = kmap(sg_page(&sg[k])) + sg[k].offset;
- hexdump(q, cipher_tv[i].tap[k]);
+ print_hex_dump(KERN_DEBUG, "", DUMP_PREFIX_OFFSET, 16, 1, q, cipher_tv[i].tap[k], 1);
printk("%s\n",
memcmp(q, cipher_tv[i].result + temp,
cipher_tv[i].tap[k]) ? "fail" :
@@ -839,7 +832,7 @@ static void test_deflate(void)
printk("fail: ret=%d\n", ret);
continue;
}
- hexdump(result, dlen);
+ print_hex_dump(KERN_DEBUG, "", DUMP_PREFIX_OFFSET, 16, 1, result, dlen, 1);
printk("%s (ratio %d:%d)\n",
memcmp(result, tv[i].output, dlen) ? "fail" : "pass",
ilen, dlen);
@@ -870,7 +863,7 @@ static void test_deflate(void)
printk("fail: ret=%d\n", ret);
continue;
}
- hexdump(result, dlen);
+ print_hex_dump(KERN_DEBUG, "", DUMP_PREFIX_OFFSET, 16, 1, result, dlen, 1);
printk("%s (ratio %d:%d)\n",
memcmp(result, tv[i].output, dlen) ? "fail" : "pass",
ilen, dlen);
--
1.5.3.5
next reply other threads:[~2007-11-26 7:11 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-11-26 7:13 Denis Cheng [this message]
2007-11-26 14:39 ` [PATCH 1/2] crypto test: use print_hex_dump from <linux/kernel.h> Herbert Xu
2007-11-26 17:28 ` [PATCH] [RESEND] crypto test: use print_hex_dump from <linux/kernel.h> instead Denis Cheng
2007-11-26 18:01 ` Joe Perches
2007-11-27 1:35 ` Herbert Xu
2007-11-27 2:47 ` [PATCH] [RESEND] crypto test: use print_hex_dump from kernel.h instead Denis Cheng
2007-11-27 2:58 ` Richard Knutsson
2007-11-27 5:03 ` rae l
2007-11-27 9:26 ` Andrew Morton
2007-11-29 11:13 ` Herbert Xu
2007-11-30 1:20 ` rae l
2007-11-30 6:00 ` Herbert Xu
2007-11-27 1:05 ` [PATCH] [RESEND] crypto test: use print_hex_dump from <linux/kernel.h> instead Herbert Xu
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=1196061182-6368-1-git-send-email-crquan@gmail.com \
--to=crquan@gmail.com \
--cc=davem@davemloft.net \
--cc=herbert@gondor.apana.org.au \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=randy.dunlap@oracle.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).