From patchwork Mon Jun 24 07:38:13 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 11012515 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 3F20D1580 for ; Mon, 24 Jun 2019 07:39:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2D3001FF7F for ; Mon, 24 Jun 2019 07:39:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1EE19289B0; Mon, 24 Jun 2019 07:39:02 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id CA28A1FF7F for ; Mon, 24 Jun 2019 07:39:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: 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: List-Owner; bh=X1rTLeDViXvCd4tT816d7jaUFt2IrBkWrcDrot2UMwk=; b=WcO/omyRgcxwAM fjgKq/l/k7XYHbjnKGoTNEOfIIHKPJhTxKdL9vD/kJzEDU2pJX+WIwaxkTAfA+wCp3T0tfL4S7ecJ EYvb2n3NTfk65FL15Hfn/O2l0DANdodslesGykiiA4cPOX4YuNJv/kBpUy9aevXgxETUNczFtIHC/ pfW6MLzmLlgSzmI1kiR8iCNoi+mw9nO1VYfyXzVcN5TqLkYXR1OsnuGA3J54WSKBOv7vfPxRvxrdc M/tghrAybFUrtHu/TADX2WYR8PaACc7EnYTe/9yGEAOLCJzkD3dh8UWO+A8kUza/yvCY2iug5MNNJ PVoeIx5eYC8238KlZ8Hw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hfJZ6-0007Y3-6d; Mon, 24 Jun 2019 07:39:00 +0000 Received: from mail-wm1-x342.google.com ([2a00:1450:4864:20::342]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hfJYd-0007Cm-N6 for linux-arm-kernel@lists.infradead.org; Mon, 24 Jun 2019 07:38:33 +0000 Received: by mail-wm1-x342.google.com with SMTP id 207so11741537wma.1 for ; Mon, 24 Jun 2019 00:38:31 -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 :mime-version:content-transfer-encoding; bh=Qk5haYv1+A59FcEkEBkZM43lIkd8QPZ0KTOnGr5KAdY=; b=vuvWawKOKrLHbP7A6PkmMFQLHSSl3WCqN3q5XyqVY69xQqwrByzqE/v89OEB/r2XlO mVVVf9ihXihb5KFRm5vDLOrwB/WL/QR+iBPLqN6IX9Ytq34pOo/SA8lrImXUaN4d8KVJ MUVmtBbGCAHj4S31932kY3Egv7VPhjCiuMboP2mAl8HHTJC98NrDMQv+tIX/oWBCms0x XkHkFy3oFrOppCYeSjO6NhCy4oO1wg+HYXI6eXeMr6jAmZqHgJ7F3NkigmsBHJQoLqu0 wKkRCSLE/8pPHtnxBOYa6fNW/OtvWFhEHfABl+zn57tODQapmaqrutyEHwK0mdRkN66i /Fkg== 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:mime-version:content-transfer-encoding; bh=Qk5haYv1+A59FcEkEBkZM43lIkd8QPZ0KTOnGr5KAdY=; b=MHRIgyLh5ylbE5ztN2aVKqw7oOvSMiZ4F4vVJIPxTbKTPiBvnnCprS9YeoAD9rrdXx ue20jJHAwxpnN3twqjx9+7hOCQoWch251qWnI5g7EjjaR70MtgGSu3L/VN/ivhnJwLo3 lgjWpiJXdzUX1K0tsdAsetu5cZgM1Ir0akJidQrG1ESqIDY+kI4ME9Cc7sVlLYcyV7MJ M3IpfbPGI4eyEppZ8IfEWq8EHfhkPGvJ4BE0NTKds4LsKRrng7o2MJ0ctw96kwdvz3D5 jwp/V112Bmdam2d0PtbOJ8mQAGqJYnJrO86AtGhsIHoawvuW/1TTuNSpUCYigkhtiOo3 nbiQ== X-Gm-Message-State: APjAAAW9z5kL5GOjUFH103Nfqz5RDqAB3RHJECcheArJkVizjkUq5Gym 23Sa6ILDJ+jS08gunu27IxExtQ== X-Google-Smtp-Source: APXvYqz9u3EsP2geCu/tEbvFGgysFsWtzxoqtJlB2Awyrfgqn7pNRWwx1B+WA6QtCqIJEJcqCntpJw== X-Received: by 2002:a7b:c301:: with SMTP id k1mr13966481wmj.43.1561361910079; Mon, 24 Jun 2019 00:38:30 -0700 (PDT) Received: from sudo.home ([2a01:cb1d:112:6f00:4866:7cdc:a930:8455]) by smtp.gmail.com with ESMTPSA id 203sm7419280wmc.30.2019.06.24.00.38.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 24 Jun 2019 00:38:29 -0700 (PDT) From: Ard Biesheuvel To: linux-crypto@vger.kernel.org Subject: [PATCH 1/6] crypto: aegis128 - use unaliged helper in unaligned decrypt path Date: Mon, 24 Jun 2019 09:38:13 +0200 Message-Id: <20190624073818.29296-2-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190624073818.29296-1-ard.biesheuvel@linaro.org> References: <20190624073818.29296-1-ard.biesheuvel@linaro.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190624_003832_092359_78E4883D X-CRM114-Status: GOOD ( 11.39 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Ard Biesheuvel , Herbert Xu , Eric Biggers , Steve Capper , Ondrej Mosnacek , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Use crypto_aegis128_update_u() not crypto_aegis128_update_a() in the decrypt path that is taken when the source or destination pointers are not aligned. Signed-off-by: Ard Biesheuvel --- crypto/aegis128.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crypto/aegis128.c b/crypto/aegis128.c index d78f77fc5dd1..125e11246990 100644 --- a/crypto/aegis128.c +++ b/crypto/aegis128.c @@ -208,7 +208,7 @@ static void crypto_aegis128_decrypt_chunk(struct aegis_state *state, u8 *dst, crypto_aegis_block_xor(&tmp, &state->blocks[1]); crypto_xor(tmp.bytes, src, AEGIS_BLOCK_SIZE); - crypto_aegis128_update_a(state, &tmp); + crypto_aegis128_update_u(state, &tmp); memcpy(dst, tmp.bytes, AEGIS_BLOCK_SIZE);