From patchwork Mon Dec 5 18:42:24 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 86616 Delivered-To: patch@linaro.org Received: by 10.140.20.101 with SMTP id 92csp1635702qgi; Mon, 5 Dec 2016 10:42:42 -0800 (PST) X-Received: by 10.84.131.36 with SMTP id 33mr129161596pld.1.1480963362267; Mon, 05 Dec 2016 10:42:42 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r64si15593544pfa.128.2016.12.05.10.42.42; Mon, 05 Dec 2016 10:42:42 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=fail (p=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751636AbcLESml (ORCPT + 1 other); Mon, 5 Dec 2016 13:42:41 -0500 Received: from mail-wm0-f42.google.com ([74.125.82.42]:38126 "EHLO mail-wm0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751605AbcLESmk (ORCPT ); Mon, 5 Dec 2016 13:42:40 -0500 Received: by mail-wm0-f42.google.com with SMTP id f82so102802911wmf.1 for ; Mon, 05 Dec 2016 10:42:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=y7Y+ZkUeyKtMPss8Mg74WrkgbSNte2CocvpqTpuWmmE=; b=YWGD0xlPT3y00CKswYpuc7atSFMk0csgG+YH+bqEIrCQtrabnBC+l3frRmWmed2woJ Zdva5MW0GzjzecRd3ZIkpur3Yvq2kMSqdBkAAPmIrP05iSHReRA3ZPfGxo1xOIkFgvTJ MdP2LC4tKIJXu8LTFYlM71IiBRMqFCfAdAWe8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=y7Y+ZkUeyKtMPss8Mg74WrkgbSNte2CocvpqTpuWmmE=; b=NA+TK9Tdsgs5StFhih2Owr7531SdCuQ+8T4SuD3Jo2KzwsQhboXwbfh/dr824V1uhr sjDgQxjaSo7Bzyer2DGbTPX16pX9KmcxjDTJXaubB9R1P4/u/kKAMzoiXJlPGHIFEMgk kSuOO/6uvNcrgONA1+CPJFXh4kjQcfD4wBcsZtSBmxqxnYxZzR9fyJdrnRaNlKVIkiUs zpvu8I4yxeQ+JuSbqf9Gqisu+aIzmYKYDr/RoxyI14oY3ID/vnw5fuy4g+r9422LTA6i r/CC+OkNVjXmePJJ32IJRDlRdunD94KVYtKpufQx/iZqrzIn+JrD5bObNbm5jgq+OTaI 0TvQ== X-Gm-Message-State: AKaTC00T/QXbE7ByXiHwSC/To7zCkfyXGC4+4EpXvln21W6vNXkpKhhwsALgHH5RZpLtQl0L X-Received: by 10.28.41.70 with SMTP id p67mr10383186wmp.4.1480963359569; Mon, 05 Dec 2016 10:42:39 -0800 (PST) Received: from localhost.localdomain ([105.144.52.243]) by smtp.gmail.com with ESMTPSA id yj10sm21774213wjb.3.2016.12.05.10.42.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 05 Dec 2016 10:42:38 -0800 (PST) From: Ard Biesheuvel To: linux-crypto@vger.kernel.org, herbert@gondor.apana.org.au Cc: linux-arm-kernel@lists.infradead.org, Ard Biesheuvel Subject: [PATCH v3 2/6] crypto: testmgr - add/enhance test cases for CRC-T10DIF Date: Mon, 5 Dec 2016 18:42:24 +0000 Message-Id: <1480963348-24203-3-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1480963348-24203-1-git-send-email-ard.biesheuvel@linaro.org> References: <1480963348-24203-1-git-send-email-ard.biesheuvel@linaro.org> Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org The existing test cases only exercise a small slice of the various possible code paths through the x86 SSE/PCLMULQDQ implementation, and the upcoming ports of it for arm64. So add one that exceeds 256 bytes in size, and convert another to a chunked test. Signed-off-by: Ard Biesheuvel --- crypto/testmgr.h | 70 ++++++++++++-------- 1 file changed, 42 insertions(+), 28 deletions(-) -- 2.7.4 -- To unsubscribe from this list: send the line "unsubscribe linux-crypto" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/crypto/testmgr.h b/crypto/testmgr.h index e64a4ef9d8ca..9b656be7f52f 100644 --- a/crypto/testmgr.h +++ b/crypto/testmgr.h @@ -1334,36 +1334,50 @@ static struct hash_testvec rmd320_tv_template[] = { } }; -#define CRCT10DIF_TEST_VECTORS 3 +#define CRCT10DIF_TEST_VECTORS ARRAY_SIZE(crct10dif_tv_template) static struct hash_testvec crct10dif_tv_template[] = { { - .plaintext = "abc", - .psize = 3, -#ifdef __LITTLE_ENDIAN - .digest = "\x3b\x44", -#else - .digest = "\x44\x3b", -#endif - }, { - .plaintext = "1234567890123456789012345678901234567890" - "123456789012345678901234567890123456789", - .psize = 79, -#ifdef __LITTLE_ENDIAN - .digest = "\x70\x4b", -#else - .digest = "\x4b\x70", -#endif - }, { - .plaintext = - "abcddddddddddddddddddddddddddddddddddddddddddddddddddddd", - .psize = 56, -#ifdef __LITTLE_ENDIAN - .digest = "\xe3\x9c", -#else - .digest = "\x9c\xe3", -#endif - .np = 2, - .tap = { 28, 28 } + .plaintext = "abc", + .psize = 3, + .digest = (u8 *)(u16 []){ 0x443b }, + }, { + .plaintext = "1234567890123456789012345678901234567890" + "123456789012345678901234567890123456789", + .psize = 79, + .digest = (u8 *)(u16 []){ 0x4b70 }, + .np = 2, + .tap = { 63, 16 }, + }, { + .plaintext = "abcdddddddddddddddddddddddddddddddddddddddd" + "ddddddddddddd", + .psize = 56, + .digest = (u8 *)(u16 []){ 0x9ce3 }, + .np = 8, + .tap = { 1, 2, 28, 7, 6, 5, 4, 3 }, + }, { + .plaintext = "1234567890123456789012345678901234567890" + "1234567890123456789012345678901234567890" + "1234567890123456789012345678901234567890" + "1234567890123456789012345678901234567890" + "1234567890123456789012345678901234567890" + "1234567890123456789012345678901234567890" + "1234567890123456789012345678901234567890" + "123456789012345678901234567890123456789", + .psize = 319, + .digest = (u8 *)(u16 []){ 0x44c6 }, + }, { + .plaintext = "1234567890123456789012345678901234567890" + "1234567890123456789012345678901234567890" + "1234567890123456789012345678901234567890" + "1234567890123456789012345678901234567890" + "1234567890123456789012345678901234567890" + "1234567890123456789012345678901234567890" + "1234567890123456789012345678901234567890" + "123456789012345678901234567890123456789", + .psize = 319, + .digest = (u8 *)(u16 []){ 0x44c6 }, + .np = 4, + .tap = { 1, 255, 57, 6 }, } };