From: Paul E. Murphy Date: Tue, 17 Sep 2024 15:22:58 +0000 (+0000) Subject: Fix big-endian Power10 chacha20 implementation X-Git-Tag: openssl-3.1.8~130 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dde298ca986668aa5573165ba770adc180e21275;p=thirdparty%2Fopenssl.git Fix big-endian Power10 chacha20 implementation Some of the BE specific permutes were incorrect. Fix them. This passes all tests on a P10/ppc64 debian unstable host. Fixes #25451 CLA: trivial Reviewed-by: Paul Dale Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/25483) (cherry picked from commit daead12df04e2257bd5f2f8441a3c2965ef102ee) --- diff --git a/crypto/chacha/asm/chachap10-ppc.pl b/crypto/chacha/asm/chachap10-ppc.pl index 032cf2585bb..7b869edd5b6 100755 --- a/crypto/chacha/asm/chachap10-ppc.pl +++ b/crypto/chacha/asm/chachap10-ppc.pl @@ -1032,10 +1032,10 @@ $code.=<<___; vadduwm $xcn0,$xcn4,@K[2] vadduwm $xdn0,$xdn4,@K[3] - be?vperm $xan0,$xa4,$xa4,$beperm - be?vperm $xbn0,$xb4,$xb4,$beperm - be?vperm $xcn0,$xcn4,$xcn4,$beperm - be?vperm $xdn0,$xdn4,$xdn4,$beperm + be?vperm $xan0,$xan0,$xan0,$beperm + be?vperm $xbn0,$xbn0,$xbn0,$beperm + be?vperm $xcn0,$xcn0,$xcn0,$beperm + be?vperm $xdn0,$xdn0,$xdn0,$beperm ${UCMP}i $len,0x40 blt Ltail_vsx_8x_1