From patchwork Thu Sep 13 08:51:32 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ondrej Mosnacek X-Patchwork-Id: 10598867 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-2.web.codeaurora.org (Postfix) with ESMTP id DB08F13B6 for ; Thu, 13 Sep 2018 08:51:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C9A902A632 for ; Thu, 13 Sep 2018 08:51:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BE41A2A7F3; Thu, 13 Sep 2018 08:51:45 +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 681892A7F7 for ; Thu, 13 Sep 2018 08:51:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727781AbeIMOAN (ORCPT ); Thu, 13 Sep 2018 10:00:13 -0400 Received: from mail-wr1-f50.google.com ([209.85.221.50]:46835 "EHLO mail-wr1-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726692AbeIMOAN (ORCPT ); Thu, 13 Sep 2018 10:00:13 -0400 Received: by mail-wr1-f50.google.com with SMTP id a108-v6so4723324wrc.13 for ; Thu, 13 Sep 2018 01:51:42 -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=gApQZNUOsChVlQxX9YAZ2bVtOXSMBNJVuxwSoXbb2Is=; b=cSTC0f7nxu6vPmEr+2ArgfS8HSDUYCazLM2tDurQdlf5tiHFYv0Es1V+7HuhOuJub0 fOta/sbIks6YGIrb9rifEWSR8rjSwpLqUXhoVhihCQ7GnvPN5Y08fliWv1tmM0EJPqkd AcDPvBhDY4AR6vKgOK9nNwAZoJ2sV37jMz7fvhqVXlOvnCZdAngW2toNaR9f019bPLuB plmOW93An7ywdSOuPsGuaaGsLFpyLtqyQYSHHtq4NNdMKuwxwyNG24ABkVctAR2pJVGY EKF1b0kfGtTw1/AjOyoYVuMFM3x35jVidOB8gxQAOTpE+ePglQwh6dFkHc6yOKv9sHJI lT5Q== X-Gm-Message-State: APzg51DrAspp3mWMklDuFMOUNiiLZl+2nMigVa2UqaJ6qDoFQGs7e/fF m6+3VIfLe52oMsSq+EOqb0TV/g== X-Google-Smtp-Source: ANB0VdYre6Adzq83FvQcOTqlrpvdYRDEFqJ6Cuz6g2TszxGvn16Pks6eJhA6XQquUR29InyQua6U2A== X-Received: by 2002:adf:f0c8:: with SMTP id x8-v6mr4906271wro.49.1536828702092; Thu, 13 Sep 2018 01:51:42 -0700 (PDT) Received: from localhost.localdomain.com (nat-pool-brq-t.redhat.com. [213.175.37.10]) by smtp.gmail.com with ESMTPSA id l10-v6sm6598730wre.0.2018.09.13.01.51.40 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 13 Sep 2018 01:51:41 -0700 (PDT) From: Ondrej Mosnacek To: Herbert Xu Cc: linux-crypto@vger.kernel.org, dm-devel@redhat.com, Mikulas Patocka , Eric Biggers , Ondrej Mosnacek Subject: [PATCH v4 2/4] crypto: testmgr - Add test for LRW counter wrap-around Date: Thu, 13 Sep 2018 10:51:32 +0200 Message-Id: <20180913085134.11694-3-omosnace@redhat.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180913085134.11694-1-omosnace@redhat.com> References: <20180913085134.11694-1-omosnace@redhat.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 This patch adds a test vector for lrw(aes) that triggers wrap-around of the counter, which is a tricky corner case. Suggested-by: Eric Biggers Signed-off-by: Ondrej Mosnacek --- crypto/testmgr.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/crypto/testmgr.h b/crypto/testmgr.h index 0b3d7cadbe93..47629cb1efd3 100644 --- a/crypto/testmgr.h +++ b/crypto/testmgr.h @@ -13145,6 +13145,27 @@ static const struct cipher_testvec aes_lrw_tv_template[] = { .ctext = "\x5b\x90\x8e\xc1\xab\xdd\x67\x5f" "\x3d\x69\x8a\x95\x53\xc8\x9c\xe5", .len = 16, + }, { /* Test counter wrap-around, modified from LRW-32-AES 1 */ + .key = "\x45\x62\xac\x25\xf8\x28\x17\x6d" + "\x4c\x26\x84\x14\xb5\x68\x01\x85" + "\x25\x8e\x2a\x05\xe7\x3e\x9d\x03" + "\xee\x5a\x83\x0c\xcc\x09\x4c\x87", + .klen = 32, + .iv = "\xff\xff\xff\xff\xff\xff\xff\xff" + "\xff\xff\xff\xff\xff\xff\xff\xff", + .ptext = "\x30\x31\x32\x33\x34\x35\x36\x37" + "\x38\x39\x41\x42\x43\x44\x45\x46" + "\x30\x31\x32\x33\x34\x35\x36\x37" + "\x38\x39\x41\x42\x43\x44\x45\x46" + "\x30\x31\x32\x33\x34\x35\x36\x37" + "\x38\x39\x41\x42\x43\x44\x45\x46", + .ctext = "\x47\x90\x50\xf6\xf4\x8d\x5c\x7f" + "\x84\xc7\x83\x95\x2d\xa2\x02\xc0" + "\xda\x7f\xa3\xc0\x88\x2a\x0a\x50" + "\xfb\xc1\x78\x03\x39\xfe\x1d\xe5" + "\xf1\xb2\x73\xcd\x65\xa3\xdf\x5f" + "\xe9\x5d\x48\x92\x54\x63\x4e\xb8", + .len = 48, }, { /* http://www.mail-archive.com/stds-p1619@listserv.ieee.org/msg00173.html */ .key = "\xf8\xd4\x76\xff\xd6\x46\xee\x6c"