All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ard Biesheuvel <ard.biesheuvel@linaro.org>
To: Andy Polyakov <appro@openssl.org>
Cc: Sami Tolvanen <samitolvanen@google.com>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	"linux-crypto@vger.kernel.org" <linux-crypto@vger.kernel.org>,
	Herbert Xu <herbert@gondor.apana.org.au>,
	"David S. Miller" <davem@davemloft.net>
Subject: Re: [PATCH] arm: crypto: Add NEON optimized SHA-256
Date: Tue, 17 Mar 2015 16:51:40 +0100	[thread overview]
Message-ID: <CAKv+Gu_TK7BX5V-WD-L0tzTz6SoSfpUOjxboTawiAeRi=MbQ=w@mail.gmail.com> (raw)
In-Reply-To: <550843B4.8080903@openssl.org>

On 17 March 2015 at 16:09, Andy Polyakov <appro@openssl.org> wrote:
> Hi,
>
>>>> 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.
>
> I have no problems with reusing assembly modules in kernel context. The
> whole idea behind cryptogams initiative was exactly to reuse code in
> different contexts. But I'd prefer if it's more of cooperative effort,
> when we help each other to improve code, test on and tune for more
> platforms single developer might have access to, cross-report problems,
> etc. For this reason I'd prefer if it can be arranged in way similar to
> bsaes-armv7 module, i.e. we work together on shared copy of module that
> generates assembly that can be then compiled for OpenSSL or kernel. Is

Yes, that is what I thought.

@Sami, this also means we should integrate the .pl file and the
generated .S. Please have a look at how I integrated Andy's
bsaes-armv7.pl module.

> it sensible? BTW, why stop at SHA256? There is SHA512 and NEON SHA1...
>
> As for practicalities. In order to spare brain capacity for list
> subscribers, it would probably be appropriate to work out details such
> as naming of entry points in smaller group and present result when it's
> ready to go and tests. I'll start by looking at Thumb-ification...
>

@Andy: the core code builds without problems, but for Thumb2 there are
some trivial changes to apply:
- '.code 32' needs to be made conditional
- use adr instead of pc arithmetic for the address of K256
- bic cannot use r13 as input/output, so it needs to go via another register
- some conditional instructions need 'it' instructions added (not
strictly necessary for the kernel, because it passes
-mimplicit-it-thumb on the assembler command line, but nice for
completeness)
(see patch in other reply)

I am happy to test and/or review stuff as well.

Thanks,
Ard.

WARNING: multiple messages have this Message-ID (diff)
From: ard.biesheuvel@linaro.org (Ard Biesheuvel)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] arm: crypto: Add NEON optimized SHA-256
Date: Tue, 17 Mar 2015 16:51:40 +0100	[thread overview]
Message-ID: <CAKv+Gu_TK7BX5V-WD-L0tzTz6SoSfpUOjxboTawiAeRi=MbQ=w@mail.gmail.com> (raw)
In-Reply-To: <550843B4.8080903@openssl.org>

On 17 March 2015 at 16:09, Andy Polyakov <appro@openssl.org> wrote:
> Hi,
>
>>>> 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.
>
> I have no problems with reusing assembly modules in kernel context. The
> whole idea behind cryptogams initiative was exactly to reuse code in
> different contexts. But I'd prefer if it's more of cooperative effort,
> when we help each other to improve code, test on and tune for more
> platforms single developer might have access to, cross-report problems,
> etc. For this reason I'd prefer if it can be arranged in way similar to
> bsaes-armv7 module, i.e. we work together on shared copy of module that
> generates assembly that can be then compiled for OpenSSL or kernel. Is

Yes, that is what I thought.

@Sami, this also means we should integrate the .pl file and the
generated .S. Please have a look at how I integrated Andy's
bsaes-armv7.pl module.

> it sensible? BTW, why stop at SHA256? There is SHA512 and NEON SHA1...
>
> As for practicalities. In order to spare brain capacity for list
> subscribers, it would probably be appropriate to work out details such
> as naming of entry points in smaller group and present result when it's
> ready to go and tests. I'll start by looking at Thumb-ification...
>

@Andy: the core code builds without problems, but for Thumb2 there are
some trivial changes to apply:
- '.code 32' needs to be made conditional
- use adr instead of pc arithmetic for the address of K256
- bic cannot use r13 as input/output, so it needs to go via another register
- some conditional instructions need 'it' instructions added (not
strictly necessary for the kernel, because it passes
-mimplicit-it-thumb on the assembler command line, but nice for
completeness)
(see patch in other reply)

I am happy to test and/or review stuff as well.

Thanks,
Ard.

  parent reply	other threads:[~2015-03-17 15:51 UTC|newest]

Thread overview: 66+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-16 15:48 [PATCH] arm: crypto: Add NEON optimized SHA-256 Sami Tolvanen
2015-03-16 15:48 ` Sami Tolvanen
2015-03-16 16:08 ` Ard Biesheuvel
2015-03-16 16:08   ` Ard Biesheuvel
2015-03-16 16:23   ` Sami Tolvanen
2015-03-16 16:23     ` Sami Tolvanen
2015-03-17  6:56     ` Ard Biesheuvel
2015-03-17  6:56       ` Ard Biesheuvel
2015-03-17 15:09       ` Andy Polyakov
2015-03-17 15:09         ` Andy Polyakov
2015-03-17 15:21         ` Sami Tolvanen
2015-03-17 15:21           ` Sami Tolvanen
2015-03-17 15:51         ` Ard Biesheuvel [this message]
2015-03-17 15:51           ` Ard Biesheuvel
2015-03-23 13:50 ` [PATCHv2] arm: crypto: Add optimized SHA-256/224 Sami Tolvanen
2015-03-23 13:50   ` Sami Tolvanen
2015-03-23 18:26   ` Ard Biesheuvel
2015-03-23 18:26     ` Ard Biesheuvel
2015-03-24 11:35     ` Herbert Xu
2015-03-24 11:35       ` Herbert Xu
2015-03-24 11:40       ` Ard Biesheuvel
2015-03-24 11:40         ` Ard Biesheuvel
2015-03-24 11:46         ` Herbert Xu
2015-03-24 11:46           ` Herbert Xu
2015-03-24 11:57           ` Ard Biesheuvel
2015-03-24 11:57             ` Ard Biesheuvel
2015-03-24 11:32   ` Herbert Xu
2015-03-24 11:32     ` Herbert Xu
2015-03-24 11:33     ` Ard Biesheuvel
2015-03-24 11:33       ` Ard Biesheuvel
2015-03-24 12:27   ` Jean-Christophe PLAGNIOL-VILLARD
2015-03-24 12:27     ` Jean-Christophe PLAGNIOL-VILLARD
2015-03-24 12:42     ` Ard Biesheuvel
2015-03-24 12:42       ` Ard Biesheuvel
2015-03-24 13:05       ` Jean-Christophe PLAGNIOL-VILLARD
2015-03-24 13:05         ` Jean-Christophe PLAGNIOL-VILLARD
2015-03-24 13:06         ` Ard Biesheuvel
2015-03-24 13:06           ` Ard Biesheuvel
2015-03-24 14:46           ` Ard Biesheuvel
2015-03-24 14:46             ` Ard Biesheuvel
2015-03-24 17:05             ` Jean-Christophe PLAGNIOL-VILLARD
2015-03-24 17:05               ` Jean-Christophe PLAGNIOL-VILLARD
2015-03-24 17:40               ` Ard Biesheuvel
2015-03-24 17:40                 ` Ard Biesheuvel
2015-03-24 18:17                 ` Sami Tolvanen
2015-03-24 18:17                   ` Sami Tolvanen
2015-03-25  6:49                   ` Ard Biesheuvel
2015-03-25  6:49                     ` Ard Biesheuvel
2015-03-27 10:42             ` Andy Polyakov
2015-03-27 10:42               ` Andy Polyakov
2015-03-27 10:44               ` Ard Biesheuvel
2015-03-27 10:44                 ` Ard Biesheuvel
2015-03-27 18:07                 ` Ard Biesheuvel
2015-03-27 18:07                   ` Ard Biesheuvel
2015-03-29 13:27                   ` Andy Polyakov
2015-03-29 13:27                     ` Andy Polyakov
2015-03-30  8:37   ` [PATCHv3] " Sami Tolvanen
2015-03-30  8:37     ` Sami Tolvanen
2015-04-01 12:43     ` Herbert Xu
2015-04-01 12:43       ` Herbert Xu
2015-04-01 13:19       ` Sami Tolvanen
2015-04-01 13:19         ` Sami Tolvanen
2015-04-03 10:04         ` Herbert Xu
2015-04-03 10:04           ` Herbert Xu
2015-03-25 20:00 ` [PATCH] arm: crypto: Add NEON optimized SHA-256 Jean-Christophe PLAGNIOL-VILLARD
2015-03-25 20:00   ` Jean-Christophe PLAGNIOL-VILLARD

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAKv+Gu_TK7BX5V-WD-L0tzTz6SoSfpUOjxboTawiAeRi=MbQ=w@mail.gmail.com' \
    --to=ard.biesheuvel@linaro.org \
    --cc=appro@openssl.org \
    --cc=davem@davemloft.net \
    --cc=herbert@gondor.apana.org.au \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-crypto@vger.kernel.org \
    --cc=samitolvanen@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.