From patchwork Sun Dec 4 11:54:03 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 86446 Delivered-To: patch@linaro.org Received: by 10.140.20.101 with SMTP id 92csp1026600qgi; Sun, 4 Dec 2016 03:54:20 -0800 (PST) X-Received: by 10.99.167.15 with SMTP id d15mr93550566pgf.167.1480852460922; Sun, 04 Dec 2016 03:54:20 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m6si11158844pgg.171.2016.12.04.03.54.20; Sun, 04 Dec 2016 03:54:20 -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 S1751148AbcLDLyU (ORCPT + 1 other); Sun, 4 Dec 2016 06:54:20 -0500 Received: from mail-wm0-f48.google.com ([74.125.82.48]:38668 "EHLO mail-wm0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750867AbcLDLyT (ORCPT ); Sun, 4 Dec 2016 06:54:19 -0500 Received: by mail-wm0-f48.google.com with SMTP id f82so53682797wmf.1 for ; Sun, 04 Dec 2016 03:54:19 -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=FM0cstmUNwSBNxItFBxH5g2is0hud4JHPde7GPNEG2s=; b=TUu8Nh3wXTEQ1MgxCfDEdgJoO+7TyPod460jvlyd5mZ+LLrTMcXbUxdIoGsudAxJD1 xUbVp1rot4pKI/bCelMWJjSHSv0Z2TW/7X+1wR91ji7eAITTG+05ASbAdrvCdljLsg6m l56iMkP6jbLkIlWxQCkWXzIkt34m7dHJpeqxY= 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=FM0cstmUNwSBNxItFBxH5g2is0hud4JHPde7GPNEG2s=; b=MxANiF0ec7NSokBdXb60mIL1QsyMHRmvHwm+Jbj9qUaYFYZdelxVpSBJWxE5J+Q3bf l0+0ofWri00hn5s3JDWrH/4Eu2mYatBnBEG0ddE859g90S1uKd43mGDA20ecsMCWRQ7G m3fftZYcdp2ISPBJf2Vp5K4CJbxEEkegCT4Pnnu1KM1EHbxt/oPE29SFaxuidal05rFh e9UkSKjstUD9hNB+vL1j+x2xnK45M5it/+IJ4lYQRDU/tRCg929vcQYvRsmmNHh9KtNS HJSiy5c6W4eaFPckHM2adW5tnxB/29SBrnD/sIpD9daYtGwCjNkJusYsDmgZmt2n1tC8 eLIw== X-Gm-Message-State: AKaTC013FAAHWtTmN0jOdn5wP+/MJXPhz9h/hPYPLSKNuQXLGNlxjsVRGxy0vj1yEzWe/Zjq X-Received: by 10.28.183.215 with SMTP id h206mr5418114wmf.60.1480852458135; Sun, 04 Dec 2016 03:54:18 -0800 (PST) Received: from localhost.localdomain ([105.144.52.243]) by smtp.gmail.com with ESMTPSA id i132sm12678625wmf.14.2016.12.04.03.54.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 04 Dec 2016 03:54:17 -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 v2 2/6] crypto: testmgr - add/enhance test cases for CRC-T10DIF Date: Sun, 4 Dec 2016 11:54:03 +0000 Message-Id: <1480852447-25082-3-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1480852447-25082-1-git-send-email-ard.biesheuvel@linaro.org> References: <1480852447-25082-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..b7cd41b25a2a 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 }, } };