All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andy Polyakov <appro@openssl.org>
To: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>,
	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: [PATCHv2] arm: crypto: Add optimized SHA-256/224
Date: Sun, 29 Mar 2015 15:27:24 +0200	[thread overview]
Message-ID: <5517FDBC.7030008@openssl.org> (raw)
In-Reply-To: <CAKv+Gu-_=FfAdyQKD2FFafJ0_OjcuiYRi8AVhxKsRKnTX6NOTA@mail.gmail.com>

>>>> arch/arm/crypto/sha256-core.S: Assembler messages:
>>>> arch/arm/crypto/sha256-core.S:1847: Error: invalid constant (ffffefb0)
>>>> after fixup
>>>>
>>>> This is caused by the fact that, when building the integer-only code
>>>> for an older architecture, the conditional compilation produces a
>>>> slightly bigger preceding function, and the symbol K256 is out of
>>>> range for the adr instruction.
>>>>
>>>> ... and replace the offending line with
>>>>
>>>> adrl r14,K256
>>>
>>> Ard, you have mentioned that you've verified it on big-endian, but I've
>>> spotted little-endian dependency (see #ifndef __ARMEB__ in attached). I
>>> guess that it worked for you either because it was NEON that was tested
>>> (it does work as is) or __LINUX_ARM_ARCH__ was less than 7 (in which
>>> case it uses endian-neutral byte-by-byte data load). Can you confirm either?
> 
> Indeed, if I build for v7 I get
> 
> [    0.269418] 00000000: 4e a5 c5 08 a6 56 6e 76 24 05 43 f8 fe b0 6f d4
> [    0.275261] 00000010: 57 77 7b e3 95 49 c4 01 64 36 af da 65 d2 33 0e
> [    0.281031] alg: hash: Test 1 failed for sha224-asm
> [    0.285315] 00000000: 9d 6a 5d e9 e1 6c 39 99 c7 14 84 0f 47 77 1f 36
> [    0.290912] 00000010: dc c2 97 a7 bd ef aa c3 6c 95 15 ae
> 
> which is indeed the integer code failing, and your attached patch fixes it.

Committed as
http://git.openssl.org/gitweb/?p=openssl.git;a=commitdiff;h=51f8d095562f36cdaa6893597b5c609e943b0565.

WARNING: multiple messages have this Message-ID (diff)
From: appro@openssl.org (Andy Polyakov)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCHv2] arm: crypto: Add optimized SHA-256/224
Date: Sun, 29 Mar 2015 15:27:24 +0200	[thread overview]
Message-ID: <5517FDBC.7030008@openssl.org> (raw)
In-Reply-To: <CAKv+Gu-_=FfAdyQKD2FFafJ0_OjcuiYRi8AVhxKsRKnTX6NOTA@mail.gmail.com>

>>>> arch/arm/crypto/sha256-core.S: Assembler messages:
>>>> arch/arm/crypto/sha256-core.S:1847: Error: invalid constant (ffffefb0)
>>>> after fixup
>>>>
>>>> This is caused by the fact that, when building the integer-only code
>>>> for an older architecture, the conditional compilation produces a
>>>> slightly bigger preceding function, and the symbol K256 is out of
>>>> range for the adr instruction.
>>>>
>>>> ... and replace the offending line with
>>>>
>>>> adrl r14,K256
>>>
>>> Ard, you have mentioned that you've verified it on big-endian, but I've
>>> spotted little-endian dependency (see #ifndef __ARMEB__ in attached). I
>>> guess that it worked for you either because it was NEON that was tested
>>> (it does work as is) or __LINUX_ARM_ARCH__ was less than 7 (in which
>>> case it uses endian-neutral byte-by-byte data load). Can you confirm either?
> 
> Indeed, if I build for v7 I get
> 
> [    0.269418] 00000000: 4e a5 c5 08 a6 56 6e 76 24 05 43 f8 fe b0 6f d4
> [    0.275261] 00000010: 57 77 7b e3 95 49 c4 01 64 36 af da 65 d2 33 0e
> [    0.281031] alg: hash: Test 1 failed for sha224-asm
> [    0.285315] 00000000: 9d 6a 5d e9 e1 6c 39 99 c7 14 84 0f 47 77 1f 36
> [    0.290912] 00000010: dc c2 97 a7 bd ef aa c3 6c 95 15 ae
> 
> which is indeed the integer code failing, and your attached patch fixes it.

Committed as
http://git.openssl.org/gitweb/?p=openssl.git;a=commitdiff;h=51f8d095562f36cdaa6893597b5c609e943b0565.

  reply	other threads:[~2015-03-29 13:27 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
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 [this message]
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=5517FDBC.7030008@openssl.org \
    --to=appro@openssl.org \
    --cc=ard.biesheuvel@linaro.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=plagnioj@jcrosoft.com \
    --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.