aboutsummaryrefslogtreecommitdiffstats
path: root/crypto
diff options
context:
space:
mode:
authorKOVACS Krisztian <hidden@sch.bme.hu>2014-08-22 04:44:36 -0400
committerHerbert Xu <herbert@gondor.apana.org.au>2014-08-29 09:46:36 -0400
commit1443cc9bcbbbc0951fe2208fb29207a301e364d9 (patch)
tree36d9c853f1a590ab8965fa401f4711ab880c0b36 /crypto
parentd801ab204b5a500b66ca285ac7b440cc79933a27 (diff)
crypto: testmgr - add test for lz4 and lz4hc
This patch adds a simple test vector for the lz4 and lz4hc compression algorithms. Signed-off-by: KOVACS Krisztian <hidden@sch.bme.hu> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'crypto')
-rw-r--r--crypto/testmgr.c32
-rw-r--r--crypto/testmgr.h66
2 files changed, 98 insertions, 0 deletions
diff --git a/crypto/testmgr.c b/crypto/testmgr.c
index f90e91c5e47a..9459dfd7357f 100644
--- a/crypto/testmgr.c
+++ b/crypto/testmgr.c
@@ -3177,6 +3177,38 @@ static const struct alg_test_desc alg_test_descs[] = {
3177 } 3177 }
3178 } 3178 }
3179 }, { 3179 }, {
3180 .alg = "lz4",
3181 .test = alg_test_comp,
3182 .fips_allowed = 1,
3183 .suite = {
3184 .comp = {
3185 .comp = {
3186 .vecs = lz4_comp_tv_template,
3187 .count = LZ4_COMP_TEST_VECTORS
3188 },
3189 .decomp = {
3190 .vecs = lz4_decomp_tv_template,
3191 .count = LZ4_DECOMP_TEST_VECTORS
3192 }
3193 }
3194 }
3195 }, {
3196 .alg = "lz4hc",
3197 .test = alg_test_comp,
3198 .fips_allowed = 1,
3199 .suite = {
3200 .comp = {
3201 .comp = {
3202 .vecs = lz4hc_comp_tv_template,
3203 .count = LZ4HC_COMP_TEST_VECTORS
3204 },
3205 .decomp = {
3206 .vecs = lz4hc_decomp_tv_template,
3207 .count = LZ4HC_DECOMP_TEST_VECTORS
3208 }
3209 }
3210 }
3211 }, {
3180 .alg = "lzo", 3212 .alg = "lzo",
3181 .test = alg_test_comp, 3213 .test = alg_test_comp,
3182 .fips_allowed = 1, 3214 .fips_allowed = 1,
diff --git a/crypto/testmgr.h b/crypto/testmgr.h
index 6597203eccfa..62e2485bb428 100644
--- a/crypto/testmgr.h
+++ b/crypto/testmgr.h
@@ -29473,4 +29473,70 @@ static struct hash_testvec bfin_crc_tv_template[] = {
29473 29473
29474}; 29474};
29475 29475
29476#define LZ4_COMP_TEST_VECTORS 1
29477#define LZ4_DECOMP_TEST_VECTORS 1
29478
29479static struct comp_testvec lz4_comp_tv_template[] = {
29480 {
29481 .inlen = 70,
29482 .outlen = 45,
29483 .input = "Join us now and share the software "
29484 "Join us now and share the software ",
29485 .output = "\xf0\x10\x4a\x6f\x69\x6e\x20\x75"
29486 "\x73\x20\x6e\x6f\x77\x20\x61\x6e"
29487 "\x64\x20\x73\x68\x61\x72\x65\x20"
29488 "\x74\x68\x65\x20\x73\x6f\x66\x74"
29489 "\x77\x0d\x00\x0f\x23\x00\x0b\x50"
29490 "\x77\x61\x72\x65\x20",
29491 },
29492};
29493
29494static struct comp_testvec lz4_decomp_tv_template[] = {
29495 {
29496 .inlen = 45,
29497 .outlen = 70,
29498 .input = "\xf0\x10\x4a\x6f\x69\x6e\x20\x75"
29499 "\x73\x20\x6e\x6f\x77\x20\x61\x6e"
29500 "\x64\x20\x73\x68\x61\x72\x65\x20"
29501 "\x74\x68\x65\x20\x73\x6f\x66\x74"
29502 "\x77\x0d\x00\x0f\x23\x00\x0b\x50"
29503 "\x77\x61\x72\x65\x20",
29504 .output = "Join us now and share the software "
29505 "Join us now and share the software ",
29506 },
29507};
29508
29509#define LZ4HC_COMP_TEST_VECTORS 1
29510#define LZ4HC_DECOMP_TEST_VECTORS 1
29511
29512static struct comp_testvec lz4hc_comp_tv_template[] = {
29513 {
29514 .inlen = 70,
29515 .outlen = 45,
29516 .input = "Join us now and share the software "
29517 "Join us now and share the software ",
29518 .output = "\xf0\x10\x4a\x6f\x69\x6e\x20\x75"
29519 "\x73\x20\x6e\x6f\x77\x20\x61\x6e"
29520 "\x64\x20\x73\x68\x61\x72\x65\x20"
29521 "\x74\x68\x65\x20\x73\x6f\x66\x74"
29522 "\x77\x0d\x00\x0f\x23\x00\x0b\x50"
29523 "\x77\x61\x72\x65\x20",
29524 },
29525};
29526
29527static struct comp_testvec lz4hc_decomp_tv_template[] = {
29528 {
29529 .inlen = 45,
29530 .outlen = 70,
29531 .input = "\xf0\x10\x4a\x6f\x69\x6e\x20\x75"
29532 "\x73\x20\x6e\x6f\x77\x20\x61\x6e"
29533 "\x64\x20\x73\x68\x61\x72\x65\x20"
29534 "\x74\x68\x65\x20\x73\x6f\x66\x74"
29535 "\x77\x0d\x00\x0f\x23\x00\x0b\x50"
29536 "\x77\x61\x72\x65\x20",
29537 .output = "Join us now and share the software "
29538 "Join us now and share the software ",
29539 },
29540};
29541
29476#endif /* _CRYPTO_TESTMGR_H */ 29542#endif /* _CRYPTO_TESTMGR_H */