]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/blobdiff - crypto/tcrypt.h
[CRYPTO] lzo: Add LZO compression algorithm support
[mirror_ubuntu-jammy-kernel.git] / crypto / tcrypt.h
index d3c380f5fe830c75d2d72f149dfff5c381e595ee..175f26a58e2d019f358fe92a2f30e8b33edcc24d 100644 (file)
@@ -7460,6 +7460,88 @@ static struct comp_testvec deflate_decomp_tv_template[] = {
        },
 };
 
+/*
+ * LZO test vectors (null-terminated strings).
+ */
+#define LZO_COMP_TEST_VECTORS 2
+#define LZO_DECOMP_TEST_VECTORS 2
+
+static struct comp_testvec lzo_comp_tv_template[] = {
+       {
+               .inlen  = 70,
+               .outlen = 46,
+               .input  = "Join us now and share the software "
+                         "Join us now and share the software ",
+               .output = {  0x00, 0x0d, 0x4a, 0x6f, 0x69, 0x6e, 0x20, 0x75,
+                            0x73, 0x20, 0x6e, 0x6f, 0x77, 0x20, 0x61, 0x6e,
+                            0x64, 0x20, 0x73, 0x68, 0x61, 0x72, 0x65, 0x20,
+                            0x74, 0x68, 0x65, 0x20, 0x73, 0x6f, 0x66, 0x74,
+                            0x77, 0x70, 0x01, 0x01, 0x4a, 0x6f, 0x69, 0x6e,
+                            0x3d, 0x88, 0x00, 0x11, 0x00, 0x00 },
+       }, {
+               .inlen  = 159,
+               .outlen = 133,
+               .input  = "This document describes a compression method based on the LZO "
+                         "compression algorithm.  This document defines the application of "
+                         "the LZO algorithm used in UBIFS.",
+               .output = { 0x00, 0x2b, 0x54, 0x68, 0x69, 0x73, 0x20, 0x64,
+                           0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x20,
+                           0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65,
+                           0x73, 0x20, 0x61, 0x20, 0x63, 0x6f, 0x6d, 0x70,
+                           0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x20,
+                           0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x20, 0x62,
+                           0x61, 0x73, 0x65, 0x64, 0x20, 0x6f, 0x6e, 0x20,
+                           0x74, 0x68, 0x65, 0x20, 0x4c, 0x5a, 0x4f, 0x2b,
+                           0x8c, 0x00, 0x0d, 0x61, 0x6c, 0x67, 0x6f, 0x72,
+                           0x69, 0x74, 0x68, 0x6d, 0x2e, 0x20, 0x20, 0x54,
+                           0x68, 0x69, 0x73, 0x2a, 0x54, 0x01, 0x02, 0x66,
+                           0x69, 0x6e, 0x65, 0x73, 0x94, 0x06, 0x05, 0x61,
+                           0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x76,
+                           0x0a, 0x6f, 0x66, 0x88, 0x02, 0x60, 0x09, 0x27,
+                           0xf0, 0x00, 0x0c, 0x20, 0x75, 0x73, 0x65, 0x64,
+                           0x20, 0x69, 0x6e, 0x20, 0x55, 0x42, 0x49, 0x46,
+                           0x53, 0x2e, 0x11, 0x00, 0x00 },
+       },
+};
+
+static struct comp_testvec lzo_decomp_tv_template[] = {
+       {
+               .inlen  = 133,
+               .outlen = 159,
+               .input  = { 0x00, 0x2b, 0x54, 0x68, 0x69, 0x73, 0x20, 0x64,
+                           0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x20,
+                           0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65,
+                           0x73, 0x20, 0x61, 0x20, 0x63, 0x6f, 0x6d, 0x70,
+                           0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x20,
+                           0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x20, 0x62,
+                           0x61, 0x73, 0x65, 0x64, 0x20, 0x6f, 0x6e, 0x20,
+                           0x74, 0x68, 0x65, 0x20, 0x4c, 0x5a, 0x4f, 0x2b,
+                           0x8c, 0x00, 0x0d, 0x61, 0x6c, 0x67, 0x6f, 0x72,
+                           0x69, 0x74, 0x68, 0x6d, 0x2e, 0x20, 0x20, 0x54,
+                           0x68, 0x69, 0x73, 0x2a, 0x54, 0x01, 0x02, 0x66,
+                           0x69, 0x6e, 0x65, 0x73, 0x94, 0x06, 0x05, 0x61,
+                           0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x76,
+                           0x0a, 0x6f, 0x66, 0x88, 0x02, 0x60, 0x09, 0x27,
+                           0xf0, 0x00, 0x0c, 0x20, 0x75, 0x73, 0x65, 0x64,
+                           0x20, 0x69, 0x6e, 0x20, 0x55, 0x42, 0x49, 0x46,
+                           0x53, 0x2e, 0x11, 0x00, 0x00 },
+               .output = "This document describes a compression method based on the LZO "
+                         "compression algorithm.  This document defines the application of "
+                         "the LZO algorithm used in UBIFS.",
+       }, {
+               .inlen  = 46,
+               .outlen = 70,
+               .input  = { 0x00, 0x0d, 0x4a, 0x6f, 0x69, 0x6e, 0x20, 0x75,
+                           0x73, 0x20, 0x6e, 0x6f, 0x77, 0x20, 0x61, 0x6e,
+                           0x64, 0x20, 0x73, 0x68, 0x61, 0x72, 0x65, 0x20,
+                           0x74, 0x68, 0x65, 0x20, 0x73, 0x6f, 0x66, 0x74,
+                           0x77, 0x70, 0x01, 0x01, 0x4a, 0x6f, 0x69, 0x6e,
+                           0x3d, 0x88, 0x00, 0x11, 0x00, 0x00 },
+               .output = "Join us now and share the software "
+                         "Join us now and share the software ",
+       },
+};
+
 /*
  * Michael MIC test vectors from IEEE 802.11i
  */