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: 6027481 X-Patchwork-Delegate: herbert@gondor.apana.org.au Return-Path: X-Original-To: patchwork-linux-crypto@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 0DB71BF90F for ; Tue, 17 Mar 2015 06:56:07 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 327E12045B for ; Tue, 17 Mar 2015 06:56:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4389B20459 for ; Tue, 17 Mar 2015 06:56:05 +0000 (UTC) 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) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=JEBM74wrsiVjuOEx9xpgOGBlBkI3tPafJ+Mr1HkfeXA=; b=aVPkWqodacoonSvgANif27WT8q8wrOO7uM91BfMM5SdWOfJ59dKchF4poByoFyAeiT 5u8H3OK142e4UEGZ/bRSkMTSMoq1TAZfxwCkLv1C0SHDOY6LKkUotcB9PESRmKyo5j3+ 1mahlwIoxY+/p4UPFlJZl40xKNv1Rn50nkc5qu/I8QRZ0JWtug8XKN6bSUD+3yPfHh8p WHcmBY3aijr4AMYQki1ISiEP0An1bYC6Pv3kONpyIXkhE440zkywIbJ5ny8tLQ64ms3d Q1Lvo2LDHnuIenOx9NEy293gq0QztIWEIPLUdB9KImnEY7f+op8p3M3rquJhYRZIwagR vpWA== X-Gm-Message-State: ALoCoQmJQ68s/mtMnVNnAQLpvkxzdOE/opHcAAMu/+UWEx7f3s6W2rKkt1HfdaS/Aae3uH0w9DSQ 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: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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]!