From patchwork Fri Jun 22 14:37:21 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Glauber X-Patchwork-Id: 10482279 X-Patchwork-Delegate: herbert@gondor.apana.org.au Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 91636602CB for ; Fri, 22 Jun 2018 14:37:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6EBB228F60 for ; Fri, 22 Jun 2018 14:37:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6161028F69; Fri, 22 Jun 2018 14:37:57 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2FA0D28F60 for ; Fri, 22 Jun 2018 14:37:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933583AbeFVOhy (ORCPT ); Fri, 22 Jun 2018 10:37:54 -0400 Received: from mail-wm0-f66.google.com ([74.125.82.66]:36904 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932170AbeFVOhx (ORCPT ); Fri, 22 Jun 2018 10:37:53 -0400 Received: by mail-wm0-f66.google.com with SMTP id r125-v6so2889276wmg.2 for ; Fri, 22 Jun 2018 07:37:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=3SL30uzb/1N9GfINuqosrFK8rhuzTsfcXnSweJfLv4A=; b=bw3fZDR0IEx07EM0vkKMghUnt/43BEViqFk4C6VwxZmeHTD1LSsHlo+U2v8bGnluSb sUc0EsDvKNLEgO/daNPFoGzToHvdSf5dzttF3D0FmRIiQc2VqV9HJhXmbiSva4Qd4XKj om/bUkELDGnfFF6G+WnSBqUBZjc69yUaT0zCXkHqsmJL0RJFqIwwfsPgCcxs014uGKI1 Q52udK61p0bYRJ+ZPDw2NQz9v2u5f8MIV9asllfi6HHymdjqdLy9v/1Rr8c0v1CmkHmf TSAMd9cuvl+wKh9TBhZyKuRdboiYlOYN87ljgyk5rxWQ1yqAZE19k9Fr1ZPtLqZ/vMgx GDSw== X-Gm-Message-State: APt69E2HUHgliUUo7XqTqAj8KrxBb3BW7aa7/9YHGmEpSpPHVaY7pe4i 0+V1E0vAy2XH/CyLk59jfbKEsUMl X-Google-Smtp-Source: ADUXVKJpjLj7Fir0cW0+wgKzpgEd6SGkBdRa5czz2DMxE/KsrUIlNaKLkh6nSMYRivscZoqcnBVbMQ== X-Received: by 2002:a1c:7a19:: with SMTP id v25-v6mr1793239wmc.81.1529678271585; Fri, 22 Jun 2018 07:37:51 -0700 (PDT) Received: from hc.cavium.com (dslb-088-066-107-231.088.066.pools.vodafone-ip.de. [88.66.107.231]) by smtp.gmail.com with ESMTPSA id a5-v6sm6553033wro.12.2018.06.22.07.37.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 22 Jun 2018 07:37:50 -0700 (PDT) From: Jan Glauber To: Herbert Xu Cc: "David S . Miller" , linux-crypto@vger.kernel.org, Mahipal Challa , Jan Glauber Subject: [PATCH 4/5] crypto: testmgr - Add test vectors for LZS compression Date: Fri, 22 Jun 2018 16:37:21 +0200 Message-Id: <20180622143722.9406-5-jglauber@cavium.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180622143722.9406-1-jglauber@cavium.com> References: <20180622143722.9406-1-jglauber@cavium.com> Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The test vectors were generated using the ThunderX ZIP coprocessor. Signed-off-by: Jan Glauber --- crypto/testmgr.c | 9 ++++++ crypto/testmgr.h | 77 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 86 insertions(+) diff --git a/crypto/testmgr.c b/crypto/testmgr.c index cfb5fe4c5ccf..8e9ff1229e93 100644 --- a/crypto/testmgr.c +++ b/crypto/testmgr.c @@ -3238,6 +3238,15 @@ static const struct alg_test_desc alg_test_descs[] = { .decomp = __VECS(lzo_decomp_tv_template) } } + }, { + .alg = "lzs", + .test = alg_test_comp, + .suite = { + .comp = { + .comp = __VECS(lzs_comp_tv_template), + .decomp = __VECS(lzs_decomp_tv_template) + } + } }, { .alg = "md4", .test = alg_test_hash, diff --git a/crypto/testmgr.h b/crypto/testmgr.h index b950aa234e43..ae7fecadcade 100644 --- a/crypto/testmgr.h +++ b/crypto/testmgr.h @@ -31699,6 +31699,83 @@ static const struct comp_testvec lzo_decomp_tv_template[] = { }, }; +/* + * LZS test vectors (null-terminated strings). + */ +static const struct comp_testvec lzs_comp_tv_template[] = { + { + .inlen = 70, + .outlen = 40, + .input = "Join us now and share the software " + "Join us now and share the software ", + .output = "\x25\x1b\xcd\x26\xe1\x01\xd4\xe6" + "\x20\x37\x1b\xce\xe2\x03\x09\xb8" + "\xc8\x20\x39\x9a\x0c\x27\x23\x28" + "\x80\xe8\x68\xc2\x07\x33\x79\x98" + "\xe8\x77\xc6\xda\x3f\xfc\xc0\x00", + }, { + .inlen = 184, + .outlen = 130, + .input = "This document describes a compression method based on the LZS " + "compression algorithm. This document defines the application of " + "the LZS algorithm to the IP Payload Compression Protocol.", + .output = "\x2a\x1a\x0d\x27\x31\x01\x90\xde" + "\x63\x3a\x9b\x4c\xa6\xe3\xa6\x24" + "\x32\x9c\xcc\x67\x23\x49\x8b\x0c" + "\x08\x0c\x22\x03\x19\xbc\xda\x70" + "\x39\x62\x83\x99\xa4\xde\x6e\x10" + "\x67\x43\xa1\xa0\xde\x64\x10\x18" + "\x8c\x27\x33\x2e\x18\xc8\x38\xe0" + "\xca\x20\x26\x16\x8a\x7a\x4f\x53" + "\x09\xb0\xce\x6f\xde\x19\xa0\xda" + "\x2e\x10\x08\x3a\xdf\x06\x63\x49" + "\xb8\xca\x73\xdb\x61\x84\xe0\x70" + "\x36\x1a\x4c\x66\x13\xa6\xca\x37" + "\x99\xb9\x3e\x3b\xdf\x1c\x90\x6f" + "\xca\xe1\x24\xa0\x20\x28\x18\x4f" + "\x26\xc3\x79\x87\xe0\x10\xfc\xbe" + "\x65\x03\x91\xbf\x42\x7d\x83\x60" + "\xbb\x00", + }, +}; + +static const struct comp_testvec lzs_decomp_tv_template[] = { + { + .inlen = 130, + .outlen = 184, + .input = "\x2a\x1a\x0d\x27\x31\x01\x90\xde" + "\x63\x3a\x9b\x4c\xa6\xe3\xa6\x24" + "\x32\x9c\xcc\x67\x23\x49\x8b\x0c" + "\x08\x0c\x22\x03\x19\xbc\xda\x70" + "\x39\x62\x83\x99\xa4\xde\x6e\x10" + "\x67\x43\xa1\xa0\xde\x64\x10\x18" + "\x8c\x27\x33\x2e\x18\xc8\x38\xe0" + "\xca\x20\x26\x16\x8a\x7a\x4f\x53" + "\x09\xb0\xce\x6f\xde\x19\xa0\xda" + "\x2e\x10\x08\x3a\xdf\x06\x63\x49" + "\xb8\xca\x73\xdb\x61\x84\xe0\x70" + "\x36\x1a\x4c\x66\x13\xa6\xca\x37" + "\x99\xb9\x3e\x3b\xdf\x1c\x90\x6f" + "\xca\xe1\x24\xa0\x20\x28\x18\x4f" + "\x26\xc3\x79\x87\xe0\x10\xfc\xbe" + "\x65\x03\x91\xbf\x42\x7d\x83\x60" + "\xbb\x00", + .output = "This document describes a compression method based on the LZS " + "compression algorithm. This document defines the application of " + "the LZS algorithm to the IP Payload Compression Protocol.", + }, { + .inlen = 40, + .outlen = 70, + .input = "\x25\x1b\xcd\x26\xe1\x01\xd4\xe6" + "\x20\x37\x1b\xce\xe2\x03\x09\xb8" + "\xc8\x20\x39\x9a\x0c\x27\x23\x28" + "\x80\xe8\x68\xc2\x07\x33\x79\x98" + "\xe8\x77\xc6\xda\x3f\xfc\xc0\x00", + .output = "Join us now and share the software " + "Join us now and share the software ", + }, +}; + /* * Michael MIC test vectors from IEEE 802.11i */