From patchwork Mon Aug 4 10:34:28 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 34829 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pa0-f72.google.com (mail-pa0-f72.google.com [209.85.220.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 0A60E20F2E for ; Mon, 4 Aug 2014 10:34:41 +0000 (UTC) Received: by mail-pa0-f72.google.com with SMTP id eu11sf49398489pac.3 for ; Mon, 04 Aug 2014 03:34:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:sender:precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe; bh=1O7R13wKAK5J0dCYLuHZNRrsKOE5UwDC7eUTh0tAD8U=; b=KbmV65ZWb4pc1+i+LXVlCYrUmc83OtJv1y6hzywlo1jgUSKBIbjxKjeTwxKI1D5ias M/cmoBJOZ2oIuDQJ1cGnjjUkSOxHLHw4y742vTQ1712f/bMrcY4tZ+nBm3fJ7UOQLukZ h5ncp3vueBmVyoUP6vJZuFAxh56QKWOlFtlvigTsk9H7jNWvngY5YvnCZ6S/eFhRZ9c9 z98JDJNP0IiHgetd6OOF3l+mizaZKm4Qq4siCFLwjTpeYQCSzZqMwMLFyHQCf1GJxy9w fsx7o+C6w54AbVyTlfGfFt9O/1cP5n1UNmSzh5LQtD/gzYeShZEQzqGp8Zg7UgR7bEjl AJWA== X-Gm-Message-State: ALoCoQmoGCqYoY6bVJbU3lwZ3tfsOAGz7IL4m2UOtPl1MoL/1l3qyml4Y7FwLcjLkaBH448pa1/2 X-Received: by 10.66.235.66 with SMTP id uk2mr8345741pac.39.1407148481364; Mon, 04 Aug 2014 03:34:41 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.81.169 with SMTP id f38ls2059589qgd.24.gmail; Mon, 04 Aug 2014 03:34:41 -0700 (PDT) X-Received: by 10.220.163.69 with SMTP id z5mr9114064vcx.10.1407148481253; Mon, 04 Aug 2014 03:34:41 -0700 (PDT) Received: from mail-vc0-f178.google.com (mail-vc0-f178.google.com [209.85.220.178]) by mx.google.com with ESMTPS id b16si11646987veh.82.2014.08.04.03.34.41 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 04 Aug 2014 03:34:41 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.178 as permitted sender) client-ip=209.85.220.178; Received: by mail-vc0-f178.google.com with SMTP id la4so10707421vcb.37 for ; Mon, 04 Aug 2014 03:34:41 -0700 (PDT) X-Received: by 10.221.24.7 with SMTP id rc7mr994651vcb.54.1407148481169; Mon, 04 Aug 2014 03:34:41 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.221.37.5 with SMTP id tc5csp293846vcb; Mon, 4 Aug 2014 03:34:40 -0700 (PDT) X-Received: by 10.70.102.130 with SMTP id fo2mr22844054pdb.68.1407148480298; Mon, 04 Aug 2014 03:34:40 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id je2si4560613pbd.138.2014.08.04.03.34.40 for ; Mon, 04 Aug 2014 03:34:40 -0700 (PDT) Received-SPF: none (google.com: linux-crypto-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752515AbaHDKei (ORCPT ); Mon, 4 Aug 2014 06:34:38 -0400 Received: from mail-we0-f174.google.com ([74.125.82.174]:55365 "EHLO mail-we0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752514AbaHDKeh (ORCPT ); Mon, 4 Aug 2014 06:34:37 -0400 Received: by mail-we0-f174.google.com with SMTP id x48so7477131wes.19 for ; Mon, 04 Aug 2014 03:34:36 -0700 (PDT) X-Received: by 10.180.184.99 with SMTP id et3mr29061233wic.31.1407148476236; Mon, 04 Aug 2014 03:34:36 -0700 (PDT) Received: from ards-macbook-pro.local ([188.252.229.85]) by mx.google.com with ESMTPSA id di7sm42549064wjb.34.2014.08.04.03.34.34 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 04 Aug 2014 03:34:35 -0700 (PDT) From: Ard Biesheuvel To: linux-arm-kernel@lists.infradead.org, linux@arm.linux.org.uk, jussi.kivilinna@iki.fi Cc: linux-crypto@vger.kernel.org, herbert@gondor.apana.org.au, Ard Biesheuvel Subject: [PATCH 1/2] ARM: crypto: enable NEON SHA-1 for big endian Date: Mon, 4 Aug 2014 12:34:28 +0200 Message-Id: <1407148469-26190-1-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 1.8.3.2 Sender: linux-crypto-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-crypto@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: ard.biesheuvel@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.178 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , This tweaks the SHA-1 NEON code slightly so it works correctly under big endian, and removes the Kconfig condition preventing it from being selected if CONFIG_CPU_BIG_ENDIAN is set. Signed-off-by: Ard Biesheuvel --- arch/arm/crypto/sha1-armv7-neon.S | 8 ++++---- crypto/Kconfig | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/arch/arm/crypto/sha1-armv7-neon.S b/arch/arm/crypto/sha1-armv7-neon.S index 50013c0e2864..49179e0653e6 100644 --- a/arch/arm/crypto/sha1-armv7-neon.S +++ b/arch/arm/crypto/sha1-armv7-neon.S @@ -150,9 +150,9 @@ #define W_PRECALC_00_15() \ add RWK, sp, #(WK_offs(0)); \ \ - vld1.32 {tmp0, tmp1}, [RDATA]!; \ + vld1.8 {tmp0, tmp1}, [RDATA]!; \ vrev32.8 W0, tmp0; /* big => little */ \ - vld1.32 {tmp2, tmp3}, [RDATA]!; \ + vld1.8 {tmp2, tmp3}, [RDATA]!; \ vadd.u32 tmp0, W0, curK; \ vrev32.8 W7, tmp1; /* big => little */ \ vrev32.8 W6, tmp2; /* big => little */ \ @@ -164,7 +164,7 @@ vst1.32 {tmp2, tmp3}, [RWK]; \ #define WPRECALC_00_15_0(i,W,W_m04,W_m08,W_m12,W_m16,W_m20,W_m24,W_m28) \ - vld1.32 {tmp0, tmp1}, [RDATA]!; \ + vld1.8 {tmp0, tmp1}, [RDATA]!; \ #define WPRECALC_00_15_1(i,W,W_m04,W_m08,W_m12,W_m16,W_m20,W_m24,W_m28) \ add RWK, sp, #(WK_offs(0)); \ @@ -173,7 +173,7 @@ vrev32.8 W0, tmp0; /* big => little */ \ #define WPRECALC_00_15_3(i,W,W_m04,W_m08,W_m12,W_m16,W_m20,W_m24,W_m28) \ - vld1.32 {tmp2, tmp3}, [RDATA]!; \ + vld1.8 {tmp2, tmp3}, [RDATA]!; \ #define WPRECALC_00_15_4(i,W,W_m04,W_m08,W_m12,W_m16,W_m20,W_m24,W_m28) \ vadd.u32 tmp0, W0, curK; \ diff --git a/crypto/Kconfig b/crypto/Kconfig index 749b1e05c490..deef2a4b6559 100644 --- a/crypto/Kconfig +++ b/crypto/Kconfig @@ -542,7 +542,7 @@ config CRYPTO_SHA1_ARM config CRYPTO_SHA1_ARM_NEON tristate "SHA1 digest algorithm (ARM NEON)" - depends on ARM && KERNEL_MODE_NEON && !CPU_BIG_ENDIAN + depends on ARM && KERNEL_MODE_NEON select CRYPTO_SHA1_ARM select CRYPTO_SHA1 select CRYPTO_HASH