From patchwork Tue Oct 3 23:00:06 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Lamparter X-Patchwork-Id: 9983619 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 A50A16029B for ; Tue, 3 Oct 2017 23:00:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9B20628A4E for ; Tue, 3 Oct 2017 23:00:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8F62D28A4D; Tue, 3 Oct 2017 23:00:24 +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, FREEMAIL_FROM, 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 4D1DF289DA for ; Tue, 3 Oct 2017 23:00:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751208AbdJCXAW (ORCPT ); Tue, 3 Oct 2017 19:00:22 -0400 Received: from mail-wm0-f41.google.com ([74.125.82.41]:51502 "EHLO mail-wm0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750865AbdJCXAV (ORCPT ); Tue, 3 Oct 2017 19:00:21 -0400 Received: by mail-wm0-f41.google.com with SMTP id f4so11743537wme.0 for ; Tue, 03 Oct 2017 16:00:20 -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 :in-reply-to:references; bh=FcJmmbztr0dI20e/qXQP47+1FJ9TYEUNKgeLEU8lzCA=; b=YKG+/8T/v5T/EWVeR2GwBFBlF1/MKpGzSpJ4HDo8ijJX0T5FxFWX9nVZgOqYJZYH6M OxA+HZ2n6tMsPVjGfRob2BUTIqtXjh/y1IrS5nT8C8LTb3ky3WHgYosWfOUZ3xm08BSo /n5QpIX2wEacW46u+FZLwneu8AF7z+VaXaioQwPRax7YnMxZRHtBAGs2lmiNo9aGAMEb NwO6KXwg1jJx4C5uAtDLXPUgzLBQ+/txwHE9yMRosoWwiZXoS6OKxu0qR+ZANRwQocvF oQa8ZnBK/cu7+Ct7r83WH+epqJzveaVse3DQVXzgaMB3OxJnBOj1AYkW3VSjiunHIwPH d0eA== 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:in-reply-to:references; bh=FcJmmbztr0dI20e/qXQP47+1FJ9TYEUNKgeLEU8lzCA=; b=MCnAutXCfOyiaEOQSYjcF6du0b5Q9e04iIy/ztpjccxAXNHaRjBAH+3OrwwUPK4s8x 4OvkMNXS+hzu25d2WTsdRqtA0sGf1r2GEusMnrDdzxpbaLjR9GWbvp4fyJ7ubBEVtIO9 OIyVrscG6YquFRdrE06lhpufo7yqXKnKS552qsTWAVeFSubowLkmwOLlX8uhLT/Jr1od WASzpG6sdT22pr6EJ2KsbNhTzE9Vw4rHhDd6CDVyf9BvXFM7Qy4/s/ozv6tzMgp6bVph X88byr/a5GvWO2XQVYjOR33JFPGRRaVC1H1qercD9sEr28C22rVOEL32CFxjV6KmNTwW C36g== X-Gm-Message-State: AMCzsaW8dHtP+zvqfunKCVpyLv/LR0QbMZ0ig4j8oKFbzQ+KqBJBoXg6 2es7QCFpT3tuMNqI3Wh9GUKiGnsk X-Google-Smtp-Source: AOwi7QD/Ue2seK4UAVm5nQ/lShJsoI4kWTM7F+cdtUBLPQeAjxdFVGnYEWnD46OYsD5U0iM8uIVC6A== X-Received: by 10.28.32.216 with SMTP id g207mr621393wmg.138.1507071619515; Tue, 03 Oct 2017 16:00:19 -0700 (PDT) Received: from debian64.daheim (p200300D5FBCA48FCD63D7EFFFEBDE96E.dip0.t-ipconnect.de. [2003:d5:fbca:48fc:d63d:7eff:febd:e96e]) by smtp.gmail.com with ESMTPSA id d17sm8141278wrc.13.2017.10.03.16.00.17 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 03 Oct 2017 16:00:17 -0700 (PDT) Received: from chuck by debian64.daheim with local (Exim 4.89) (envelope-from ) id 1dzWAj-000107-FB; Wed, 04 Oct 2017 01:00:17 +0200 From: Christian Lamparter To: linux-crypto@vger.kernel.org Cc: Herbert Xu Subject: [PATCH 02/13] crypto: crypto4xx: fix off-by-one AES-OFB Date: Wed, 4 Oct 2017 01:00:06 +0200 Message-Id: <797afe0175f10d30c33ce84a0bcc814ff95767e8.1507070985.git.chunkeey@gmail.com> X-Mailer: git-send-email 2.14.2 In-Reply-To: <8c9b4bc7e3a88970fe0fc308034627b8ae972600.1507070985.git.chunkeey@gmail.com> References: <8c9b4bc7e3a88970fe0fc308034627b8ae972600.1507070985.git.chunkeey@gmail.com> In-Reply-To: <8c9b4bc7e3a88970fe0fc308034627b8ae972600.1507070985.git.chunkeey@gmail.com> References: <8c9b4bc7e3a88970fe0fc308034627b8ae972600.1507070985.git.chunkeey@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 I used aes-cbc as a template for ofb. But sadly I forgot to update set_key method to crypto4xx_setkey_aes_ofb(). this was caught by the testmgr: alg: skcipher: Test 1 failed (invalid result) on encr. for ofb-aes-ppc4xx 00000000: 76 49 ab ac 81 19 b2 46 ce e9 8e 9b 12 e9 19 7d 00000010: 50 86 cb 9b 50 72 19 ee 95 db 11 3a 91 76 78 b2 00000020: 73 be d6 b8 e3 c1 74 3b 71 16 e6 9e 22 22 95 16 00000030: 3f f1 ca a1 68 1f ac 09 12 0e ca 30 75 86 e1 a7 With the correct set_key method, the aes-ofb cipher passes the test. name : ofb(aes) driver : ofb-aes-ppc4xx module : crypto4xx priority : 300 refcnt : 1 selftest : passed internal : no type : ablkcipher async : yes blocksize : 16 min keysize : 16 max keysize : 32 ivsize : 16 geniv : Signed-off-by: Christian Lamparter --- drivers/crypto/amcc/crypto4xx_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/crypto/amcc/crypto4xx_core.c b/drivers/crypto/amcc/crypto4xx_core.c index 773e5faebc47..cb45365166ae 100644 --- a/drivers/crypto/amcc/crypto4xx_core.c +++ b/drivers/crypto/amcc/crypto4xx_core.c @@ -1148,7 +1148,7 @@ struct crypto4xx_alg_common crypto4xx_alg[] = { .min_keysize = AES_MIN_KEY_SIZE, .max_keysize = AES_MAX_KEY_SIZE, .ivsize = AES_IV_SIZE, - .setkey = crypto4xx_setkey_aes_cbc, + .setkey = crypto4xx_setkey_aes_ofb, .encrypt = crypto4xx_encrypt, .decrypt = crypto4xx_decrypt, }