From patchwork Sun Oct 9 17:42:21 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 77409 Delivered-To: patch@linaro.org Received: by 10.140.97.247 with SMTP id m110csp928145qge; Sun, 9 Oct 2016 10:42:42 -0700 (PDT) X-Received: by 10.66.159.37 with SMTP id wz5mr37025769pab.175.1476034962276; Sun, 09 Oct 2016 10:42:42 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r5si16333080pap.347.2016.10.09.10.42.42; Sun, 09 Oct 2016 10:42:42 -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 S1752006AbcJIRml (ORCPT + 1 other); Sun, 9 Oct 2016 13:42:41 -0400 Received: from mail-lf0-f41.google.com ([209.85.215.41]:36492 "EHLO mail-lf0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751947AbcJIRmk (ORCPT ); Sun, 9 Oct 2016 13:42:40 -0400 Received: by mail-lf0-f41.google.com with SMTP id b75so84199989lfg.3 for ; Sun, 09 Oct 2016 10:42:39 -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=fDkB0qDs4PlPnc29Nhn7h3JEzNuhffu7ZWMJeDQHtHN5ZTvyqExIQxZD46r5+r7Vd4 cHQ11To3Jh97lrTemm3jbDDnCFgSnQnuZIq7pwoU6RCo6Y60RISdFOMqVZXAmWjVMbMx 6EseJqnDcWIwj1ZPBU3LBlacduhILkiH6f+9A= 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=aZUuiNHEq0Urs6qkqXjlwdt5L2rJhZtra1j1FDWArYarZ9u9L7eZvo+MovEa+L9DDJ 3gEEwsJQBFnutMfFqSst36vDZwNHVEhAKkdcYaDE34eOP1CZwJnnWYTjxDPez76C0aKo Fd+erexyqhgtmhUaPj/t8KIDhrEFEQkfqdL2XdbEBVBhBMUxPJ0KseT0MUltbUuFg7UW LZzRXl+1QS7xbsae2hGtkHW/gu3e7wyiEsL3QU55A2K3NUBADKtn5crbz4HRpkT+frPJ 9MfQeDRtCo1zhjM8+Bn0xsA/D2twoF+2w2qpNz3si8dt4pSFjPGwLyC23VzL7KE5skTe YKmQ== X-Gm-Message-State: AA6/9Rm0Gw6yqQoag/jqrRKmGO02FIcn7oQpaUAUwNurEpd+PkVibsa52yC3ySXyFLPpE2S3 X-Received: by 10.194.102.67 with SMTP id fm3mr23702661wjb.80.1476034958469; Sun, 09 Oct 2016 10:42:38 -0700 (PDT) Received: from localhost.localdomain ([45.218.219.19]) by smtp.gmail.com with ESMTPSA id uw3sm32503415wjb.21.2016.10.09.10.42.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 09 Oct 2016 10:42:37 -0700 (PDT) From: Ard Biesheuvel To: linux-crypto@vger.kernel.org, linux-arm-kernel@lists.infradead.org, herbert@gondor.apana.org.au Cc: catalin.marinas@arm.com, will.deacon@arm.com, Ard Biesheuvel Subject: [PATCH 2/6] crypto: arm64/ghash-ce - fix for big endian Date: Sun, 9 Oct 2016 18:42:21 +0100 Message-Id: <1476034945-9186-3-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1476034945-9186-1-git-send-email-ard.biesheuvel@linaro.org> References: <1476034945-9186-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)