From patchwork Tue Jul 20 08:55:26 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 12387809 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 903C9C07E95 for ; Tue, 20 Jul 2021 08:57:41 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6054C6120F for ; Tue, 20 Jul 2021 08:57:41 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6054C6120F Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=microchip.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=cwI8tjJURsB0/9vwAvruNtm80kq5Bonr+jpFLjsAM5A=; b=K0+FygFp80kz/o g50YdOsgGMIbX9Peey+nMwZu6RLVKclgYxZmiqXAk/v+6577gXNTpub+sQ9DaLQk4nw0XWEPETFwL z88YqbYDcrShVAIrcMldrJRVpV/9MnjBa3neowTnQ1H+MMVf5QiIixUDDY31UXBuRyfih6KDMCETc /seBkQZfeb7+dLC50rUfstSwMxFZrqftFPpoZCCs+tePBdPpICVL5uEiXyHNSVpMjgO++egs9vsEd r5k3n4fu0SxTY5xkPEaiGWXZKGOaUvgFDNtcZOILKvXngT/JVFf2Hm3a8PiIinSN1SFRHFxqIp98E ixJivOfySvrdf19xgMyQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1m5lXY-00CIsM-0I; Tue, 20 Jul 2021 08:55:48 +0000 Received: from esa.microchip.iphmx.com ([68.232.154.123]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1m5lXT-00CIqT-Gw for linux-arm-kernel@lists.infradead.org; Tue, 20 Jul 2021 08:55:46 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1626771343; x=1658307343; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=O4c1MZdz3w2v44NOm3cz4feeg7svwtP+OQBMnAdlLtk=; b=n/4dYMmStvAKlPz8d0tF4xSvca/sgXNzTXofW6M7mKLAKx2D1itiPtEQ AXJYoTIzthsay6bRYf1tc2gAK9UDmVyt09qdomSyXgNlzJ3afaGCx4mtI nRnki7gL/asQpl2y1NqttoAvanix/mQpEEUSfhoIoVVQprbtGZwrkMpmV bkM2SBuXHBwuzeCJPki5HSP+vWBWbV9ic6gBWNjors2YsXnSaQjx38vaQ +qJDJDoYvzDf/Ug3sT8KywP8eX4GnaNj1ln4UO2cqZ54oyqbqStlaXZEq K0y9+qDCikORa51I/FTnbQIoDZ7qyuJJf4dCGXgiVbqiATFXWIg3gLcN3 g==; IronPort-SDR: Ytk+/ayBCHigX7kcDMt8gAyPF7xzX+gf+MbFCpptvDSFL7PrTLQQbqhwS6SWIPblix+RzKHikK jbgRVl8MiQ2ft2JY1U7qArbauB485Z53LGZUJ0BK1fFVkDrdZbGgwzumy7/OyijCIT0uWVhuHp MdcdqaDaR7ru+NLl5To0hahnhTnIMJA2JtJ9St34/UHX6qMrcgGZqWv4Nul2PuFJbDUelU+BEo qvEAPkcw8BaV+hAuzbDQS3lqsD7/G2MySRmoURzuHhnUfJTHRzaq8kMq8voyg61HW+0iCCkmM5 JsIv+gMmww+waf/NH0AIh7ik X-IronPort-AV: E=Sophos;i="5.84,254,1620716400"; d="scan'208";a="122687300" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa4.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 20 Jul 2021 01:55:39 -0700 Received: from chn-vm-ex03.mchp-main.com (10.10.85.151) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Tue, 20 Jul 2021 01:55:39 -0700 Received: from ROB-ULT-M18064N.mchp-main.com (10.10.115.15) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server id 15.1.2176.2 via Frontend Transport; Tue, 20 Jul 2021 01:55:37 -0700 From: Tudor Ambarus To: Subject: [PATCH 0/9] crypto: atmel-{aes, tdes}: Fix corner cases - crypto self tests Date: Tue, 20 Jul 2021 11:55:26 +0300 Message-ID: <20210720085535.141486-1-tudor.ambarus@microchip.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210720_015543_694848_A2C80CDB X-CRM114-Status: UNSURE ( 4.50 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alexandre.belloni@bootlin.com, Tudor Ambarus , linux-kernel@vger.kernel.org, ludovic.desroches@microchip.com, linux-crypto@vger.kernel.org, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The extra run-time crypto self tests hit some corner cases that were not handled in the drivers. Fix some corner cases. Propose some cleaning patches. Tudor Ambarus (9): crypto: atmel-tdes: Clarify how tdes dev gets allocated to the tfm crypto: atmel-tdes: Handle error messages crypto: atmel-aes: Add blocksize constraint for ECB and CBC modes crypto: atmel-aes: Add XTS input length constraint crypto: atmel-aes: Add NIST 800-38A's zero length cryptlen constraint crypto: atmel-tdes: Add FIPS81's zero length cryptlen constraint crypto: atmel-{aes, tdes}: Set OFB's blocksize to 1 crypto: atmel-aes: Add fallback to XTS software implementation crypto: atmel-aes: Allocate aes dev at tfm init time drivers/crypto/atmel-aes.c | 146 +++++++++++++++++++++++++++--------- drivers/crypto/atmel-tdes.c | 66 +++++++--------- 2 files changed, 138 insertions(+), 74 deletions(-)