From patchwork Mon Aug 14 13:28:15 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 9898955 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 B26006038C for ; Mon, 14 Aug 2017 13:29:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A45D9205FB for ; Mon, 14 Aug 2017 13:29:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9924C205FC; Mon, 14 Aug 2017 13:29:22 +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=-6.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM 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 91D76205FB for ; Mon, 14 Aug 2017 13:29:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752060AbdHNN2d (ORCPT ); Mon, 14 Aug 2017 09:28:33 -0400 Received: from mail-wr0-f175.google.com ([209.85.128.175]:33436 "EHLO mail-wr0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752026AbdHNN2d (ORCPT ); Mon, 14 Aug 2017 09:28:33 -0400 Received: by mail-wr0-f175.google.com with SMTP id b65so9849106wrd.0 for ; Mon, 14 Aug 2017 06:28:32 -0700 (PDT) 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=4ZHDtMwj8Pp/Qe/gAtVrom2RFtPJx4jqH5vth/cTyJs=; b=e2MyLIJllDMSLneTjsZpgmAzXIo05+34SK4zhKqAnvIy6Kn6KF70xKEOFtbkCiMtLF BABzMAat0uh6UxkiVgaRT2+pTp7Ly25ayvOu3C/O2gih2Te8wQL2VJfMXUYjwhJn2PFr Nap99Kc/WCxpP31qhPhLEsN3glJrJTe/D36ps= 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=4ZHDtMwj8Pp/Qe/gAtVrom2RFtPJx4jqH5vth/cTyJs=; b=B9iSP01xYPu3OwZH5yBmaRTqKei7BttwRBGzheONTK9lWdXjPZCaX9j+tx+LazwRgP HBQD8wWV8HabGi+YIy4nl6MX15SATy2IA+Ga4er39Oa5sQNrzSvkVig/VTp83MZdpL7m AV+UQUMczz8DZ647/uSW8t+OBMIGjkjm2cFk/kvRKJJ/YiZ8Z5soEyXvUq4BmGULBblI vbqyoOBLTQgtbdMpMPmruO3/TLGNVNf6sWZ74lDL3ZSeRbg8rn/1cn0NBlzWbDoDnX5Y KX0mlf4zt5ALu3KO8gjpk7fiVpTBC86ezdeezkSKCYK0HjHs1wqo95RGOFUtLoOqUuEu kLuw== X-Gm-Message-State: AHYfb5ipYy14FQOF08XaoC1Tk5H7j1iKpPZlIxPToza9tEcQeaaJsUaN MxvgjbKdUUPty4Cm3G9qgA== X-Received: by 10.223.145.163 with SMTP id 32mr18765461wri.224.1502717311951; Mon, 14 Aug 2017 06:28:31 -0700 (PDT) Received: from localhost.localdomain ([154.146.161.128]) by smtp.gmail.com with ESMTPSA id s8sm4902677wmf.1.2017.08.14.06.28.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 14 Aug 2017 06:28:30 -0700 (PDT) From: Ard Biesheuvel To: linux-crypto@vger.kernel.org Cc: herbert@gondor.apana.org.au, steffen.klassert@secunet.com, tobias@strongswan.org, martin@strongswan.org, Ard Biesheuvel Subject: [PATCH 2/2] crypto: testmgr - add chunked test cases for chacha20 Date: Mon, 14 Aug 2017 14:28:15 +0100 Message-Id: <20170814132815.24524-2-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170814132815.24524-1-ard.biesheuvel@linaro.org> References: <20170814132815.24524-1-ard.biesheuvel@linaro.org> 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 We failed to catch a bug in the chacha20 code after porting it to the skcipher API. We would have caught it if any chunked tests had been defined, so define some now so we will catch future regressions. Signed-off-by: Ard Biesheuvel --- crypto/testmgr.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/crypto/testmgr.h b/crypto/testmgr.h index 6ceb0e2758bb..d54971d2d1c8 100644 --- a/crypto/testmgr.h +++ b/crypto/testmgr.h @@ -32675,6 +32675,10 @@ static const struct cipher_testvec chacha20_enc_tv_template[] = { "\x5b\x86\x2f\x37\x30\xe3\x7c\xfd" "\xc4\xfd\x80\x6c\x22\xf2\x21", .rlen = 375, + .also_non_np = 1, + .np = 3, + .tap = { 375 - 20, 4, 16 }, + }, { /* RFC7539 A.2. Test Vector #3 */ .key = "\x1c\x92\x40\xa5\xeb\x55\xd3\x8a" "\xf3\x33\x88\x86\x04\xf6\xb5\xf0" @@ -33049,6 +33053,9 @@ static const struct cipher_testvec chacha20_enc_tv_template[] = { "\xa1\xed\xad\xd5\x76\xfa\x24\x8f" "\x98", .rlen = 1281, + .also_non_np = 1, + .np = 3, + .tap = { 1200, 1, 80 }, }, };