mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>
To: Herbert Xu <herbert@gondor.apana.org.au>
Cc: linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org,
	Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>
Subject: [PATCH] crypto: testmgr - swith deflate test to pcomp
Date: Tue, 13 Jan 2009 16:59:45 +0100	[thread overview]
Message-ID: <1231862386-11128-7-git-send-email-Geert.Uytterhoeven@sonycom.com> (raw)
In-Reply-To: <1231862386-11128-6-git-send-email-Geert.Uytterhoeven@sonycom.com>

Change the tests for the "deflate" crypto module from the "comp" to the "pcomp"
test framework.

Signed-off-by: Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>
---
 crypto/testmgr.c |    4 ++--
 crypto/testmgr.h |   24 ++++++++++++++++++++++--
 2 files changed, 24 insertions(+), 4 deletions(-)

diff --git a/crypto/testmgr.c b/crypto/testmgr.c
index aad718f..f102796 100644
--- a/crypto/testmgr.c
+++ b/crypto/testmgr.c
@@ -1404,9 +1404,9 @@ static const struct alg_test_desc alg_test_descs[] = {
 		}
 	}, {
 		.alg = "deflate",
-		.test = alg_test_comp,
+		.test = alg_test_pcomp,
 		.suite = {
-			.comp = {
+			.pcomp = {
 				.comp = {
 					.vecs = deflate_comp_tv_template,
 					.count = DEFLATE_COMP_TEST_VECTORS
diff --git a/crypto/testmgr.h b/crypto/testmgr.h
index 81b7eb0..8b98d2e 100644
--- a/crypto/testmgr.h
+++ b/crypto/testmgr.h
@@ -15,6 +15,7 @@
 #ifndef _CRYPTO_TESTMGR_H
 #define _CRYPTO_TESTMGR_H
 
+#include <linux/zlib.h>
 #include <crypto/compress.h>
 
 #define MAX_DIGEST_SIZE		64
@@ -8360,11 +8361,27 @@ struct pcomp_testvec {
  * Deflate test vectors (null-terminated strings).
  * Params: winbits=-11, Z_DEFAULT_COMPRESSION, MAX_MEM_LEVEL.
  */
+
+static const struct deflate_comp_params deflate_comp_params = {
+	.enable_comp		= 1,
+	.windowBits		= -11,
+	.level			= Z_DEFAULT_COMPRESSION,
+	.method			= Z_DEFLATED,
+	.memLevel		= MAX_MEM_LEVEL,
+	.strategy		= Z_DEFAULT_STRATEGY
+};
+
+static const struct deflate_comp_params deflate_decomp_params = {
+	.enable_decomp		= 1,
+	.windowBits		= -11,
+};
+
 #define DEFLATE_COMP_TEST_VECTORS 2
 #define DEFLATE_DECOMP_TEST_VECTORS 2
 
-static struct comp_testvec deflate_comp_tv_template[] = {
+static struct pcomp_testvec deflate_comp_tv_template[] = {
 	{
+		.params = &deflate_comp_params,
 		.inlen	= 70,
 		.outlen	= 38,
 		.input	= "Join us now and share the software "
@@ -8375,6 +8392,7 @@ static struct comp_testvec deflate_comp_tv_template[] = {
 			  "\x48\x55\x28\xce\x4f\x2b\x29\x07"
 			  "\x71\xbc\x08\x2b\x01\x00",
 	}, {
+		.params = &deflate_comp_params,
 		.inlen	= 191,
 		.outlen	= 122,
 		.input	= "This document describes a compression method based on the DEFLATE"
@@ -8399,8 +8417,9 @@ static struct comp_testvec deflate_comp_tv_template[] = {
 	},
 };
 
-static struct comp_testvec deflate_decomp_tv_template[] = {
+static struct pcomp_testvec deflate_decomp_tv_template[] = {
 	{
+		.params = &deflate_decomp_params,
 		.inlen	= 122,
 		.outlen	= 191,
 		.input	= "\x5d\x8d\x31\x0e\xc2\x30\x10\x04"
@@ -8423,6 +8442,7 @@ static struct comp_testvec deflate_decomp_tv_template[] = {
 			"compression algorithm.  This document defines the application of "
 			"the DEFLATE algorithm to the IP Payload Compression Protocol.",
 	}, {
+		.params = &deflate_decomp_params,
 		.inlen	= 38,
 		.outlen	= 70,
 		.input	= "\xf3\xca\xcf\xcc\x53\x28\x2d\x56"
-- 
1.6.0.4


  reply	other threads:[~2009-01-13 16:01 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-13 15:59 [PATCH/RFC 0/7] Partial (de)compression API Geert Uytterhoeven
2009-01-13 15:59 ` [PATCH] crypto: compress - Add pcomp interface Geert Uytterhoeven
2009-01-13 15:59   ` [PATCH] crypto: testmgr - Add support for the " Geert Uytterhoeven
2009-01-13 15:59     ` [PATCH] crypto: api - Add type init function to crypto_tfm Geert Uytterhoeven
2009-01-13 15:59       ` [PATCH] crypto: api - Export pcomp through comp Geert Uytterhoeven
2009-01-13 15:59         ` [PATCH] crypto: deflate - switch to pcomp Geert Uytterhoeven
2009-01-13 15:59           ` Geert Uytterhoeven [this message]
2009-01-13 15:59             ` [PATCH] squashfs: Make SquashFS 4 use the new pcomp crypto interface Geert Uytterhoeven
2009-01-14  3:16   ` [PATCH] crypto: compress - Add pcomp interface Herbert Xu
2009-01-14 15:01     ` Geert Uytterhoeven
2009-01-15  3:05       ` Herbert Xu
2009-01-15 10:54         ` Geert Uytterhoeven
2009-01-16  4:27           ` Herbert Xu
2009-02-05 16:24         ` Geert Uytterhoeven
2009-02-10  6:18           ` Herbert Xu
2009-02-12 15:19             ` Geert Uytterhoeven
2009-02-19  4:08               ` Herbert Xu
2009-02-19  9:12                 ` Geert Uytterhoeven
2009-02-19 10:42                   ` Herbert Xu
2009-02-23 17:32                     ` Geert Uytterhoeven
2009-02-25  2:56                       ` Herbert Xu
2009-02-25 13:26                         ` Geert Uytterhoeven
2009-01-14 16:45   ` Jaswinder Singh Rajput
2009-01-14 16:54     ` Geert Uytterhoeven
2009-01-14 17:08       ` Jaswinder Singh Rajput

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=1231862386-11128-7-git-send-email-Geert.Uytterhoeven@sonycom.com \
    --to=geert.uytterhoeven@sonycom.com \
    --cc=herbert@gondor.apana.org.au \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®