Skip to contentSkip to conversation

crypto: testmgr - add tests for lzo-rle

PATCH In review Hannah Pan 3 participants 3 messages Jul 3, 2019 – Jul 26, 2019

Subsystems (2)
lore
Share & tools
lore

Hannah Pan

author
#0 lore raw

PATCH 1/1 crypto: testmgr - add tests for lzo-rle

Add self-tests for the lzo-rle algorithm.

---
 crypto/testmgr.c | 10 ++++++
 crypto/testmgr.h | 80 ++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 90 insertions(+)
crypto/testmgr.c +10 -0
index 658a7eeebab2..c8a2fd96384d 100644
@@ -4437,6 +4437,16 @@ static const struct alg_test_desc alg_test_descs[] = {
 				.decomp = __VECS(lzo_decomp_tv_template)
 			}
 		}
+	}, {
+		.alg = "lzo-rle",
+		.test = alg_test_comp,
+		.fips_allowed = 1,
+		.suite = {
+			.comp = {
+				.comp = __VECS(lzorle_comp_tv_template),
+				.decomp = __VECS(lzorle_decomp_tv_template)
+			}
+		}
 	}, {
 		.alg = "md4",
 		.test = alg_test_hash,
crypto/testmgr.h +80 -0

86 lines not on this page · raw message

Signature · 1 line
2.22.0.410.gd8fdbe21b5-goog
maintainer
#1 lore raw
Quoted 7 lines · Hannah Pan

Add self-tests for the lzo-rle algorithm.

---
crypto/testmgr.c | 10 ++++++
crypto/testmgr.h | 80 ++++++++++++++++++++++++++++++++++++++++++++++++

2 files changed, 90 insertions(+)

Patch applied. Thanks.

Signature · 3 lines
Email: Herbert Xu <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
#2 lore raw
In reply to Hannah Pan
Quoted 7 lines · Hannah Pan

Add self-tests for the lzo-rle algorithm.

---
 crypto/testmgr.c | 10 ++++++
 crypto/testmgr.h | 80 ++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 90 insertions(+)

Hi Hannah,

Thanks for adding these tests.

It looks like these tests don't include any runs of zeros in the input. In this case, most of the new RLE-related code-paths in lzo-rle aren't invoked and it behaves exactly the same as standard lzo.

To get better coverage, I would recommend adding some input data which includes some runs of at least 4 zeros (ideally, including some edge cases like all-zero, input starts / ends with a run of zeros, empty input, etc).

Regards

Dave