Skip to content

Commit

Permalink
This fix PR #22817 introduced performance regression.
Browse files Browse the repository at this point in the history
In that pull request, the input length check was moved forward,
but the related ori instruction was missing, and it will cause
input of any length down to the much slower scalar implementation.

CLA: trivial
  • Loading branch information
lrzlin committed Jan 14, 2024
1 parent df04e81 commit e59ea2e
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions crypto/chacha/asm/chacha-loongarch64.pl
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@
# $a4 = arg #5 (counter array)
beqz $len,.Lno_data
ori $t3,$zero,64
la.pcrel $t0,OPENSSL_loongarch_hwcap_P
ld.w $t0,$t0,0
Expand Down Expand Up @@ -461,7 +462,6 @@ sub ROUND_4x {
$code .= <<EOF;
.align 6
.LChaCha20_4x:
ori $t3,$zero,64
addi.d $sp,$sp,-128
# Save the initial block counter in $t4
Expand Down Expand Up @@ -886,7 +886,6 @@ sub ROUND_8x {
$code .= <<EOF;
.align 6
.LChaCha20_8x:
ori $t3,$zero,64
addi.d $sp,$sp,-128
# Save the initial block counter in $t4
Expand Down

0 comments on commit e59ea2e

Please sign in to comment.