From: Eric Biggers <ebiggers@kernel.org>
To: linux-crypto@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org,
Ard Biesheuvel <ardb@kernel.org>,
Herbert Xu <herbert@gondor.apana.org.au>,
David Sterba <dsterba@suse.com>,
"Jason A . Donenfeld" <Jason@zx2c4.com>,
Paul Crowley <paulcrowley@google.com>
Subject: Re: [PATCH 5/5] crypto: arm/blake2b - add NEON-optimized BLAKE2b implementation
Date: Wed, 16 Dec 2020 12:57:40 -0800 [thread overview]
Message-ID: <X9p0xJ17pCtunLnh@gmail.com> (raw)
In-Reply-To: <20201215234708.105527-6-ebiggers@kernel.org>
On Tue, Dec 15, 2020 at 03:47:08PM -0800, Eric Biggers wrote:
> +// Execute one round of BLAKE2b by updating the state matrix v[0..15] in the
> +// NEON registers q0-q7. The message block is in q8..q15. The stack pointer
> +// points to a 32-byte aligned buffer containing a copy of q8 and q9, so that
> +// they can be reloaded if q8 and q9 are used as temporary registers. The macro
> +// arguments s0-s15 give the order in which the message words are used in this
> +// round. 'final' is "true" if this is the final round, i.e. round 12 of 12.
> +.macro _blake2b_round s0, s1, s2, s3, s4, s5, s6, s7, \
> + s8, s9, s10, s11, s12, s13, s14, s15, final="false"
[...]
> + // Reloading q8-q9 can be skipped on the final round.
> +.if \final != "true"
> + vld1.8 {q8-q9}, [sp, :256]
> +.endif
> +.endm
[...]
> + _blake2b_round 14, 10, 4, 8, 9, 15, 13, 6, \
> + 1, 12, 0, 2, 11, 7, 5, 3, "true"
Apparently using the strings "true" and "false" here sometimes causes a build
error where they get treated as symbols
(https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org/thread/2JPD4H3VFBSKWPUCPEPRAXBVMSR2UCQI/),
though somehow it worked fine for me. I'll change this to use 1 and 0 instead.
- Eric
WARNING: multiple messages have this Message-ID (diff)
From: Eric Biggers <ebiggers@kernel.org>
To: linux-crypto@vger.kernel.org
Cc: "Jason A . Donenfeld" <Jason@zx2c4.com>,
Herbert Xu <herbert@gondor.apana.org.au>,
David Sterba <dsterba@suse.com>, Ard Biesheuvel <ardb@kernel.org>,
linux-arm-kernel@lists.infradead.org,
Paul Crowley <paulcrowley@google.com>
Subject: Re: [PATCH 5/5] crypto: arm/blake2b - add NEON-optimized BLAKE2b implementation
Date: Wed, 16 Dec 2020 12:57:40 -0800 [thread overview]
Message-ID: <X9p0xJ17pCtunLnh@gmail.com> (raw)
In-Reply-To: <20201215234708.105527-6-ebiggers@kernel.org>
On Tue, Dec 15, 2020 at 03:47:08PM -0800, Eric Biggers wrote:
> +// Execute one round of BLAKE2b by updating the state matrix v[0..15] in the
> +// NEON registers q0-q7. The message block is in q8..q15. The stack pointer
> +// points to a 32-byte aligned buffer containing a copy of q8 and q9, so that
> +// they can be reloaded if q8 and q9 are used as temporary registers. The macro
> +// arguments s0-s15 give the order in which the message words are used in this
> +// round. 'final' is "true" if this is the final round, i.e. round 12 of 12.
> +.macro _blake2b_round s0, s1, s2, s3, s4, s5, s6, s7, \
> + s8, s9, s10, s11, s12, s13, s14, s15, final="false"
[...]
> + // Reloading q8-q9 can be skipped on the final round.
> +.if \final != "true"
> + vld1.8 {q8-q9}, [sp, :256]
> +.endif
> +.endm
[...]
> + _blake2b_round 14, 10, 4, 8, 9, 15, 13, 6, \
> + 1, 12, 0, 2, 11, 7, 5, 3, "true"
Apparently using the strings "true" and "false" here sometimes causes a build
error where they get treated as symbols
(https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org/thread/2JPD4H3VFBSKWPUCPEPRAXBVMSR2UCQI/),
though somehow it worked fine for me. I'll change this to use 1 and 0 instead.
- Eric
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2020-12-16 20:58 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-15 23:47 [PATCH 0/5] crypto: add NEON-optimized BLAKE2b Eric Biggers
2020-12-15 23:47 ` Eric Biggers
2020-12-15 23:47 ` [PATCH 1/5] crypto: blake2b - rename constants for consistency with blake2s Eric Biggers
2020-12-15 23:47 ` Eric Biggers
2020-12-17 17:13 ` David Sterba
2020-12-17 17:13 ` David Sterba
2020-12-15 23:47 ` [PATCH 2/5] crypto: blake2b - define shash_alg structs using macros Eric Biggers
2020-12-15 23:47 ` Eric Biggers
2020-12-17 17:15 ` David Sterba
2020-12-17 17:15 ` David Sterba
2020-12-17 18:35 ` Eric Biggers
2020-12-17 18:35 ` Eric Biggers
2020-12-15 23:47 ` [PATCH 3/5] crypto: blake2b - export helpers for optimized implementations Eric Biggers
2020-12-15 23:47 ` Eric Biggers
2020-12-17 17:15 ` David Sterba
2020-12-17 17:15 ` David Sterba
2020-12-17 22:33 ` Eric Biggers
2020-12-17 22:33 ` Eric Biggers
2020-12-15 23:47 ` [PATCH 4/5] crypto: blake2b - update file comment Eric Biggers
2020-12-15 23:47 ` Eric Biggers
2020-12-17 17:17 ` David Sterba
2020-12-17 17:17 ` David Sterba
2020-12-15 23:47 ` [PATCH 5/5] crypto: arm/blake2b - add NEON-optimized BLAKE2b implementation Eric Biggers
2020-12-15 23:47 ` Eric Biggers
2020-12-16 20:57 ` Eric Biggers [this message]
2020-12-16 20:57 ` Eric Biggers
2020-12-16 20:47 ` [PATCH 0/5] crypto: add NEON-optimized BLAKE2b Eric Biggers
2020-12-16 20:47 ` Eric Biggers
2020-12-16 22:32 ` Jason A. Donenfeld
2020-12-16 22:32 ` Jason A. Donenfeld
2020-12-17 3:54 ` Eric Biggers
2020-12-17 3:54 ` Eric Biggers
2020-12-17 14:01 ` Jason A. Donenfeld
2020-12-17 14:01 ` Jason A. Donenfeld
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=X9p0xJ17pCtunLnh@gmail.com \
--to=ebiggers@kernel.org \
--cc=Jason@zx2c4.com \
--cc=ardb@kernel.org \
--cc=dsterba@suse.com \
--cc=herbert@gondor.apana.org.au \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-crypto@vger.kernel.org \
--cc=paulcrowley@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.