From patchwork Tue Mar 17 06:56:02 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 45867 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f197.google.com (mail-wi0-f197.google.com [209.85.212.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id DC2A22153C for ; Tue, 17 Mar 2015 06:56:08 +0000 (UTC) Received: by wibbs8 with SMTP id bs8sf467719wib.3 for ; Mon, 16 Mar 2015 23:56:08 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:mime-version:in-reply-to:references :date:message-id:subject:from:to:cc:content-type:sender:precedence :list-id:x-original-sender:x-original-authentication-results :mailing-list:list-post:list-help:list-archive:list-unsubscribe; bh=LS5x6Ruj1kLOJOBPdFZE8FN6BVWC/aFfmbGbjQvCUP4=; b=R89TlcVS8KLihAinkgbna1VYhRd7AozJaMTX+HwJk9EDQgFt4grlRis3e+VgxDraJD l28TRsObyh5vaRcVXFXrhuDYvAxBtst3evYjA3Kt07nRC85iNIjA642079lfzWlcc7Ly Gw7sfkOuax4AhmXOOH1dhYv7IqhuvG2j4VMJ/jZSaPmPZBQSaNTm/qKwX+/wd7qEB/N4 sQDIen9Dtw5+SgFSALzDfLKOEHyliGxpg3289+mSI9RtPLQEoKdDrSG7Z81tdfaWgVgh UO/Pur3rQv0Qzpi4fuklNS0+lSEbf6u/3vxnAUCOSy8crJrDEZTKrzm9gNO/TgeZMlUV NI1Q== X-Gm-Message-State: ALoCoQljfq8pJsliivkKUhFn5Nht/ci9kgNl1P8/qEVsj6AVoRkiIqf4sq1AgD9Z9G0o1JQ8onsJ X-Received: by 10.112.44.167 with SMTP id f7mr7377712lbm.9.1426575368158; Mon, 16 Mar 2015 23:56:08 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.5.104 with SMTP id r8ls712729lar.48.gmail; Mon, 16 Mar 2015 23:56:07 -0700 (PDT) X-Received: by 10.152.184.73 with SMTP id es9mr43374761lac.104.1426575367784; Mon, 16 Mar 2015 23:56:07 -0700 (PDT) Received: from mail-lb0-f181.google.com (mail-lb0-f181.google.com. [209.85.217.181]) by mx.google.com with ESMTPS id n5si9815099lbk.166.2015.03.16.23.56.07 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 16 Mar 2015 23:56:07 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.181 as permitted sender) client-ip=209.85.217.181; Received: by lbbsy1 with SMTP id sy1so422443lbb.1 for ; Mon, 16 Mar 2015 23:56:07 -0700 (PDT) X-Received: by 10.152.29.68 with SMTP id i4mr8872467lah.19.1426575367699; Mon, 16 Mar 2015 23:56:07 -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.112.35.133 with SMTP id h5csp316501lbj; Mon, 16 Mar 2015 23:56:06 -0700 (PDT) X-Received: by 10.66.164.200 with SMTP id ys8mr146579625pab.130.1426575365864; Mon, 16 Mar 2015 23:56:05 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id fo5si222621pdb.93.2015.03.16.23.56.05 for ; Mon, 16 Mar 2015 23:56:05 -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 S1751144AbbCQG4E (ORCPT ); Tue, 17 Mar 2015 02:56:04 -0400 Received: from mail-ig0-f180.google.com ([209.85.213.180]:33754 "EHLO mail-ig0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751292AbbCQG4D (ORCPT ); Tue, 17 Mar 2015 02:56:03 -0400 Received: by ignm3 with SMTP id m3so47480893ign.0 for ; Mon, 16 Mar 2015 23:56:02 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.51.17.40 with SMTP id gb8mr115772643igd.44.1426575362497; Mon, 16 Mar 2015 23:56:02 -0700 (PDT) Received: by 10.36.125.5 with HTTP; Mon, 16 Mar 2015 23:56:02 -0700 (PDT) In-Reply-To: <20150316162304.GA35408@google.com> References: <20150316154835.GA31336@google.com> <20150316162304.GA35408@google.com> Date: Tue, 17 Mar 2015 07:56:02 +0100 Message-ID: Subject: Re: [PATCH] arm: crypto: Add NEON optimized SHA-256 From: Ard Biesheuvel To: Sami Tolvanen Cc: Andy Polyakov , "linux-arm-kernel@lists.infradead.org" , "linux-crypto@vger.kernel.org" , Herbert Xu , "David S. Miller" 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.217.181 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: , On 16 March 2015 at 17:23, Sami Tolvanen wrote: > On Mon, Mar 16, 2015 at 05:08:03PM +0100, Ard Biesheuvel wrote: >> Have you tested this code with the tcrypt.ko module? > > I have not, but I can look into it. > >> Did you talk to Andy about the license? I don't think this is >> permissible for the kernel as-is. > > Unless I have misunderstood something, the license at the Cryptogams > website includes an option to license the code under the GNU GPL. > > However, I can certainly contact Andy to clarify his intentions. > >> This is broken on thumb-2, use adr instead > >> You can also implement SHA-224 using the same core transform, it's >> just some trivial glue code. > >> Could you please rebase this onto Herbert's cryptodev tree and move >> this to arch/arm/crypto/Kconfig? > > Thanks for the comments, I will submit a second version once we have > a clarification on the license. > I have tested your code with a Thumb2 kernel. With this patch folded, it builds and passes the tcrypt.ko test for me --- 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 --- a/arch/arm/crypto/sha256-armv7-neon.S +++ b/arch/arm/crypto/sha256-armv7-neon.S @@ -10,7 +10,6 @@ #include .text -.code 32 .fpu neon .type K256,%object @@ -44,15 +43,15 @@ ENTRY(sha256_transform_neon) * %r1: data * %r2: nblks */ - sub r3,pc,#8 @ sha256_transform_neon add r2,r1,r2,lsl#6 @ len to point at the end of inp stmdb sp!,{r4-r12,lr} mov r12,sp - sub sp,sp,#16*4+16 @ alloca - sub r14,r3,#256+32 @ K256 - bic sp,sp,#15 @ align for 128-bit stores + sub r14,sp,#16*4+16 @ alloca + bic r14,r14,#15 @ align for 128-bit stores + mov sp,r14 + adr r14,K256 vld1.8 {q0},[r1]! vld1.8 {q1},[r1]!