From patchwork Mon May 21 05:50:27 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Biggers X-Patchwork-Id: 10413981 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 4E6CE6032B for ; Mon, 21 May 2018 05:52:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3CE7228786 for ; Mon, 21 May 2018 05:52:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 31B8128789; Mon, 21 May 2018 05:52: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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, 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 A4F3828786 for ; Mon, 21 May 2018 05:52:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750922AbeEUFwU (ORCPT ); Mon, 21 May 2018 01:52:20 -0400 Received: from mail-pl0-f68.google.com ([209.85.160.68]:44555 "EHLO mail-pl0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750920AbeEUFwR (ORCPT ); Mon, 21 May 2018 01:52:17 -0400 Received: by mail-pl0-f68.google.com with SMTP id e6-v6so8122885plt.11 for ; Sun, 20 May 2018 22:52:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=VScDdJJ8979bvGgE9XPPUJvI92imb55L/3pWVaW/dE4=; b=McJhrQkZzjSc6xJ7ae6DNar7tSZS5KKrtQUfrFrEsS9820tjYRTsJ4weSt6l5zm1U9 H+J+Oz73m4bU93YJTcmZnB4BjshI0jLa4ud8WiU/Fj2jro9PZGAWT8ohVCvFx1O40/Ul XpTudXicqYCbgfBAbY0nHtcYoaZnPnOko9HRjEseSfV0wP9hazfPtl51LN7zemwA0XmS eJJavoDbFcuk8+H+xR0Om31fcNxecdcmCQiVwIiERmSELOGUwlAS5/XzMyCVKBN4R9QB 9jZQyE9XqMcIVTrxcX9OJqkNMYZA1iEPq9XclegFdMrkpsYnxfI0CeHvWhrjRdcA538n fYSg== 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=VScDdJJ8979bvGgE9XPPUJvI92imb55L/3pWVaW/dE4=; b=Eg+o9pZ60GYBzJxNHnDgpC5+aZoYZ/AnKbQwD62rZKQYnzH5KD6icmsy8U259hzfGq 4giiVyrhr6K6zCzkKTOVnkXDWEdY0p0sjVinO1DOgdAxxaybknR5TzB9UlUq4x8vZT0R 8uxnw4fVB24OR81KEfYLDc96yzoxwqQ2i5zL8MDIUSKPxw9sx4XN32zcNiVzOnDUmMJ1 1Q2TAkR2Yezqx2KALV1opgsN06pGWqNHut/95HFNRMDR27Lq6dqAY59YbkTJuo7gXCu+ fviC4abOIK2aYr/Ga0ss/b87pUUkkGhpfhXuS8F1nAMdd+CjRDD5wtDS0e2OyhZwUpDZ LAPA== X-Gm-Message-State: ALKqPwfsuZjWF99QAovg0gxAfBnUFGml8dse3wLK60taLVPSbAxQuoV7 CwUodeH0BzV3eU4xHXgysWe0C/vg X-Google-Smtp-Source: AB8JxZoy6a7CRKd5SPSV8Z5zyFS8ze2jd8Xq2mwGMXzJkwuwwg278Qmn5Uo3dNPeUmFuPci15ZnY+A== X-Received: by 2002:a17:902:b946:: with SMTP id h6-v6mr19646250pls.3.1526881936907; Sun, 20 May 2018 22:52:16 -0700 (PDT) Received: from sol.localdomain (c-67-185-97-198.hsd1.wa.comcast.net. [67.185.97.198]) by smtp.gmail.com with ESMTPSA id n19-v6sm5859436pgv.89.2018.05.20.22.52.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 20 May 2018 22:52:16 -0700 (PDT) From: Eric Biggers To: linux-crypto@vger.kernel.org Cc: Herbert Xu , Eric Biggers Subject: [PATCH 3/5] crypto: testmgr - add extra ecb(tnepres) encryption test vectors Date: Sun, 20 May 2018 22:50:27 -0700 Message-Id: <20180521055029.16657-4-ebiggers3@gmail.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180521055029.16657-1-ebiggers3@gmail.com> References: <20180521055029.16657-1-ebiggers3@gmail.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 From: Eric Biggers None of the four "ecb(tnepres)" decryption test vectors exactly match an encryption test vector with input and result swapped. In preparation for removing the decryption test vectors, add these to the encryption test vectors, so we don't lose any test coverage. Signed-off-by: Eric Biggers --- crypto/testmgr.h | 40 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-) diff --git a/crypto/testmgr.h b/crypto/testmgr.h index bdc67c058d5c..745a0ed0a73a 100644 --- a/crypto/testmgr.h +++ b/crypto/testmgr.h @@ -12047,6 +12047,14 @@ static const struct cipher_testvec serpent_enc_tv_template[] = { }; static const struct cipher_testvec tnepres_enc_tv_template[] = { + { /* KeySize=0 */ + .input = "\x00\x01\x02\x03\x04\x05\x06\x07" + "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + .ilen = 16, + .result = "\x41\xcc\x6b\x31\x59\x31\x45\x97" + "\x6d\x6f\xbb\x38\x4b\x37\x21\x28", + .rlen = 16, + }, { /* KeySize=128, PT=0, I=1 */ .input = "\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00", @@ -12057,6 +12065,24 @@ static const struct cipher_testvec tnepres_enc_tv_template[] = { .result = "\x49\xaf\xbf\xad\x9d\x5a\x34\x05" "\x2c\xd8\xff\xa5\x98\x6b\xd2\xdd", .rlen = 16, + }, { /* KeySize=128 */ + .key = "\x00\x01\x02\x03\x04\x05\x06\x07" + "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + .klen = 16, + .input = "\x00\x01\x02\x03\x04\x05\x06\x07" + "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + .ilen = 16, + .result = "\xea\xf4\xd7\xfc\xd8\x01\x34\x47" + "\x81\x45\x0b\xfa\x0c\xd6\xad\x6e", + .rlen = 16, + }, { /* KeySize=128, I=121 */ + .key = "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80", + .klen = 16, + .input = zeroed_string, + .ilen = 16, + .result = "\x3d\xda\xbf\xc0\x06\xda\xab\x06" + "\x46\x2a\xf4\xef\x81\x54\x4e\x26", + .rlen = 16, }, { /* KeySize=192, PT=0, I=1 */ .key = "\x80\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00" @@ -12092,7 +12118,19 @@ static const struct cipher_testvec tnepres_enc_tv_template[] = { .result = "\x5c\xe7\x1c\x70\xd2\x88\x2e\x5b" "\xb8\x32\xe4\x33\xf8\x9f\x26\xde", .rlen = 16, - }, + }, { /* KeySize=256 */ + .key = "\x00\x01\x02\x03\x04\x05\x06\x07" + "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f" + "\x10\x11\x12\x13\x14\x15\x16\x17" + "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f", + .klen = 32, + .input = "\x00\x01\x02\x03\x04\x05\x06\x07" + "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", + .ilen = 16, + .result = "\x64\xa9\x1a\x37\xed\x9f\xe7\x49" + "\xa8\x4e\x76\xd6\xf5\x0d\x78\xee", + .rlen = 16, + } };