Commit 0cfd507c authored by Ard Biesheuvel's avatar Ard Biesheuvel Committed by Herbert Xu
Browse files

crypto: arm64/aes-cts-cbc-ce - performance tweak



Optimize away one of the tbl instructions in the decryption path,
which turns out to be unnecessary.

Signed-off-by: default avatarArd Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent 6017826b
Loading
Loading
Loading
Loading
+2 −3
Original line number Original line Diff line number Diff line
@@ -293,12 +293,11 @@ AES_ENTRY(aes_cbc_cts_decrypt)
	ld1		{v5.16b}, [x5]			/* get iv */
	ld1		{v5.16b}, [x5]			/* get iv */
	dec_prepare	w3, x2, x6
	dec_prepare	w3, x2, x6


	tbl		v2.16b, {v1.16b}, v4.16b
	decrypt_block	v0, w3, x2, x6, w7
	decrypt_block	v0, w3, x2, x6, w7
	eor		v2.16b, v2.16b, v0.16b
	tbl		v2.16b, {v0.16b}, v3.16b
	eor		v2.16b, v2.16b, v1.16b


	tbx		v0.16b, {v1.16b}, v4.16b
	tbx		v0.16b, {v1.16b}, v4.16b
	tbl		v2.16b, {v2.16b}, v3.16b
	decrypt_block	v0, w3, x2, x6, w7
	decrypt_block	v0, w3, x2, x6, w7
	eor		v0.16b, v0.16b, v5.16b		/* xor with iv */
	eor		v0.16b, v0.16b, v5.16b		/* xor with iv */