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: 167551 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp3866916ilk; Mon, 24 Jun 2019 00:38:33 -0700 (PDT) X-Google-Smtp-Source: APXvYqy00jKGZnaDqTa6763mv7NaOTT8Tp5ilNTopSRch2Ozlet0Sf20aZupxz9cluIy4Lw7B8V5 X-Received: by 2002:a17:90a:32c7:: with SMTP id l65mr11075022pjb.1.1561361913135; Mon, 24 Jun 2019 00:38:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561361913; cv=none; d=google.com; s=arc-20160816; b=SJ2kY/d/ULl1/X1rNZnrtYUbOJUr1T+1DI12HFJMKRXgqzZ/l8rKg+PulddPX7JR/V Rg6FcuyiTxqyIByOX3V+xd52EYPw+pFJMAcR36VdLmo5fiqc2OtQnt2xzbO+YwDh8N8w v901STRmSs9n1rSwiA9+b2PwUZ5X6WLWhkAFi7RHNeJWj4TUarAdWu8NN5xqgAy4vUC8 hOArGBDYqVbziiq3SHdAm2IKS6HavRfEanB7d63uc0NHSy8n8hbMNMcaYpypaZFE7bb+ EuM+hkrWbTSD4O3u8S3EFRcxq5qHCM2k48Pwx/f/wxaK48C99+RsMkqJekBnJ3IG/CZT Ec0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Qk5haYv1+A59FcEkEBkZM43lIkd8QPZ0KTOnGr5KAdY=; b=R4sVUUSu16+DNQaBTTJEWYpdSjjT7rr/3rOER3oucIkTVzCaC0Ao7y8o1U9Lwfv9n2 6uxGouPrCqu8rM8Jc6hjl/o6m9oF+t854/r8NKRwOLwzjHfoX5GdQN5oW/JtchzTG0dC vsfPO4Q1kae4JPVJsmOzFgntU1CsHCi/OcFDGMZCQ04T18fBQSTjh2ynKF6vRePnjvcw f4FXmOErOckTQO1tLLSr3nEBsos1I1HbrQPA0LRonlhDzorDsOUcepV3U0pkR9ozYokh Rtwey5omtfFO3eQP+UQu9NxTX1XMnATNNKkguhLqflr2ACZUTgDkOIwS3H/Pk8ePJW4p ip4Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=vuvWawKO; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h5si9375669pgd.419.2019.06.24.00.38.32; Mon, 24 Jun 2019 00:38:33 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=vuvWawKO; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726632AbfFXHic (ORCPT + 3 others); Mon, 24 Jun 2019 03:38:32 -0400 Received: from mail-wm1-f66.google.com ([209.85.128.66]:53010 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726077AbfFXHic (ORCPT ); Mon, 24 Jun 2019 03:38:32 -0400 Received: by mail-wm1-f66.google.com with SMTP id s3so11725644wms.2 for ; Mon, 24 Jun 2019 00:38:30 -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=k4cfMut6Z9cXyIyPzqFhAel36QD657HXsfd5PI9odJKbDBfysLmjc92RQCOHizphKR KimPhvOblgf6uWaQJ9GkBMi0qyl0/POPZscOXpME08s/TZnAY9/TPiU7R17nT2G0xiuP J5Vhkl2lu749XUOAVlQ4PiCKV6i9hWax8ilYwvXNL+diWKk7jvZUQdCvpD2AitJN45qv dNUoK9zaUeSvjlOJNlGJJmPG15P7oeR8xTvoTpe8a/yKUPfT5idZth8viCmQIZTTblUj 32Gjj01WGzwnTMPytJt5y9JWz1UmyoPt0eZMMx3XX6RWpeO74/cwVcC3u6Bmg0+pjWxL pteQ== X-Gm-Message-State: APjAAAVp5IUfuTpik4li1dOGaE/9zhINz4m+boQfHzV4Kus8+/ZqSVtD 0V5TraqQBUrO0q0fa8RiV+IzPre0T73Llw== 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 Cc: linux-arm-kernel@lists.infradead.org, Ard Biesheuvel , Eric Biggers , Ondrej Mosnacek , Herbert Xu , Steve Capper 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 Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org 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(-) -- 2.20.1 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);