From a82a9f71ad0149380a680cae4c0cc693e6324679 Mon Sep 17 00:00:00 2001 From: Andy Polyakov Date: Sat, 23 Apr 2016 19:16:56 +0200 Subject: [PATCH] chacha/asm/chacha-ppc.pl: get misalignment corner case right on big-endian. Reviewed-by: Richard Levitte --- crypto/chacha/asm/chacha-ppc.pl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/crypto/chacha/asm/chacha-ppc.pl b/crypto/chacha/asm/chacha-ppc.pl index 2bb3fce8ed..4c5d2d1aec 100755 --- a/crypto/chacha/asm/chacha-ppc.pl +++ b/crypto/chacha/asm/chacha-ppc.pl @@ -527,9 +527,11 @@ $code.=<<___; ?lvsl $outperm,0,$out # prepare for unaligned store ?vperm $outmask,$outmask,$T0,$outperm + be?lvsl $T0,0,@x[0] # 0x00..0f be?vspltisb $T1,3 # 0x03..03 - be?vxor $inpperm,$inpperm,$T1 # swap bytes within words + be?vxor $T0,$T0,$T1 # swap bytes within words be?vxor $outperm,$outperm,$T1 + be?vperm $inpperm,$inpperm,$inpperm,$T0 b Loop_outer_vmx -- 2.25.1