lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20240408131238.GC732@quark.localdomain>
Date: Mon, 8 Apr 2024 09:12:38 -0400
From: Eric Biggers <ebiggers@...nel.org>
To: Stefan Kanthak <stefan.kanthak@...go.de>
Cc: linux-kernel@...r.kernel.org, linux-crypto@...r.kernel.org,
	tim.c.chen@...ux.intel.com, sean.m.gulley@...el.com
Subject: Re: [PATCH 1/2] crypto: s(h)aving 40+ bytes off
 arch/x86/crypto/sha256_ni_asm.S

On Mon, Apr 08, 2024 at 11:26:52AM +0200, Stefan Kanthak wrote:
> @@ -315,11 +315,11 @@
>          jne             .Lloop0
>  
>          /* Write hash values back in the correct order */
> -        pshufd          $0x1B, STATE0,  STATE0          /* FEBA */
> -        pshufd          $0xB1, STATE1,  STATE1          /* DCHG */
>          movdqa          STATE0, MSGTMP4
> -        pblendw         $0xF0, STATE1,  STATE0          /* DCBA */
> -        palignr         $8, MSGTMP4, STATE1             /* HGFE */
> +        punpcklqdq      STATE1, STATE0                  /* GHEF */
> +        punpckhqdq      MSGTMP4, STATE1                 /* ABCD */
> +        pshufd          $0xB1, STATE0,  STATE0          /* HGFE */
> +        pshufd          $0x1B, STATE1,  STATE1          /* DCBA */
>  
>          movdqu          STATE0, 0*16(DIGEST_PTR)
>          movdqu          STATE1, 1*16(DIGEST_PTR)

Please make sure to run the crypto self-tests too.  The above is storing the two
halves of the state in the wrong order.

Thanks,

- Eric

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ