[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v8 1/2] target/s390x: support SHA-512 extensions
From: |
Jason A. Donenfeld |
Subject: |
Re: [PATCH v8 1/2] target/s390x: support SHA-512 extensions |
Date: |
Thu, 22 Sep 2022 16:35:48 +0200 |
On Thu, Sep 22, 2022 at 03:07:13PM +0200, David Hildenbrand wrote:
> + if (processed >= MAX_BLOCKS_PER_RUN * 128) {
> + break;
If you make this a `goto out` or similar instead of a break, then you
can
> + if (type == S390_FEAT_TYPE_KLMD && len < 128) {
change that to `if (len)`.
> + /*
> + * Pad the remainder with zero and place magic value 128 after the
> + * message.
> + */
> + memset(x + len, 0, 128 - len);
> + x[len] = 128;
"magic value 128" ==> "set the top bit"
Aside from these nits, this refactoring looks fine. I haven't tested
this or checked the crypto carefully, but if it passes all the Linux
test vectors, hopefully things are still fine.
Jason
[PATCH v8.1 1/2] target/s390x: support SHA-512 extensions, David Hildenbrand, 2022/09/22