From patchwork Tue Oct 11 18:15:14 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 77512 Delivered-To: patch@linaro.org Received: by 10.140.97.247 with SMTP id m110csp121478qge; Tue, 11 Oct 2016 11:16:13 -0700 (PDT) X-Received: by 10.66.192.134 with SMTP id hg6mr8944178pac.64.1476209773387; Tue, 11 Oct 2016 11:16:13 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 4si5147972pfk.12.2016.10.11.11.16.13; Tue, 11 Oct 2016 11:16:13 -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=neutral (body hash did not verify) header.i=@linaro.org; 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=fail (p=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752444AbcJKSQK (ORCPT + 1 other); Tue, 11 Oct 2016 14:16:10 -0400 Received: from mail-wm0-f48.google.com ([74.125.82.48]:38653 "EHLO mail-wm0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752534AbcJKSQJ (ORCPT ); Tue, 11 Oct 2016 14:16:09 -0400 Received: by mail-wm0-f48.google.com with SMTP id c78so859250wme.1 for ; Tue, 11 Oct 2016 11:15:35 -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; bh=/9y3mIG1pIxqojQbG3YE4tDnR5eyoAptuESelgfbhok=; b=cX21QJ3fAdJsa2srJ4CneqIhCHRIzXOCkk42nr8HtsucZOGz9OIWu5eXcDktir4UXD FQledtUVU4suFuyFkZdIWoORNiKX/XSEcFboj4/GXmYEiIMzfKIKnGaf01aawxIEBXYZ 1RDtjsstEQdfpMerT5yDlGFTry85q0Mkhaey4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=/9y3mIG1pIxqojQbG3YE4tDnR5eyoAptuESelgfbhok=; b=MDSkNNsgi1CjkOocGcfeZNPeDDieXQNILOmUc5FzD35pARV+vl7m3rO8aXtoPOrlbD ssuQeaT3RobN8PhyEPtPVoOVdk2km/ajnkF+r/7DIeaSr4IrlD6X0wf9rYPLKoVmSLJG 8UILxS8pls5rJnJYW4fT0uhDJ4hMc6F0GjVyRO6nz6OggW2ZWwxAbCCgqRcpwG3lzfvg BJSBeOijF54b+IR2R7xwXjpXXng0bghlhr/nsKWAeU6lGax1BB3o+za8npi7HMRg2CiV P3ebSKNpuo9HrdjBotYmcpz0CnJZ1ErCGNN3TdPxR1ChoJtepvDPT2SbqcMwK/gPKZoB Qrbw== X-Gm-Message-State: AA6/9RkqiMEjyRyppIcitHBud3XBJo1oN+gs0KM6Nir9SOybDftR2efzMKHFnoi7xEirHpLw X-Received: by 10.28.111.157 with SMTP id c29mr55896wmi.36.1476209734871; Tue, 11 Oct 2016 11:15:34 -0700 (PDT) Received: from localhost.localdomain ([105.147.31.57]) by smtp.gmail.com with ESMTPSA id ya1sm8341523wjb.23.2016.10.11.11.15.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 11 Oct 2016 11:15:34 -0700 (PDT) From: Ard Biesheuvel To: linux-crypto@vger.kernel.org, linux-arm-kernel@lists.infradead.org, herbert@gondor.apana.org.au Cc: will.deacon@arm.com, catalin.marinas@arm.com, linux@arm.linux.org.uk, Ard Biesheuvel Subject: [PATCH v2 2/8] crypto: arm64/ghash-ce - fix for big endian Date: Tue, 11 Oct 2016 19:15:14 +0100 Message-Id: <1476209720-21114-3-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1476209720-21114-1-git-send-email-ard.biesheuvel@linaro.org> References: <1476209720-21114-1-git-send-email-ard.biesheuvel@linaro.org> Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org The GHASH key and digest are both pairs of 64-bit quantities, but the GHASH code does not always refer to them as such, causing failures when built for big endian. So replace the 16x1 loads and stores with 2x8 ones. Fixes: b913a6404ce2 ("arm64/crypto: improve performance of GHASH algorithm") Signed-off-by: Ard Biesheuvel --- arch/arm64/crypto/ghash-ce-core.S | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) -- 2.7.4 -- To unsubscribe from this list: send the line "unsubscribe linux-crypto" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/arch/arm64/crypto/ghash-ce-core.S b/arch/arm64/crypto/ghash-ce-core.S index dc457015884e..f0bb9f0b524f 100644 --- a/arch/arm64/crypto/ghash-ce-core.S +++ b/arch/arm64/crypto/ghash-ce-core.S @@ -29,8 +29,8 @@ * struct ghash_key const *k, const char *head) */ ENTRY(pmull_ghash_update) - ld1 {SHASH.16b}, [x3] - ld1 {XL.16b}, [x1] + ld1 {SHASH.2d}, [x3] + ld1 {XL.2d}, [x1] movi MASK.16b, #0xe1 ext SHASH2.16b, SHASH.16b, SHASH.16b, #8 shl MASK.2d, MASK.2d, #57 @@ -74,6 +74,6 @@ CPU_LE( rev64 T1.16b, T1.16b ) cbnz w0, 0b - st1 {XL.16b}, [x1] + st1 {XL.2d}, [x1] ret ENDPROC(pmull_ghash_update)