From 5681c7c08d03684d97b6d7806d1787d7e564b980 Mon Sep 17 00:00:00 2001 From: rsuntk Date: Thu, 20 Mar 2025 14:19:01 +0000 Subject: [PATCH] Revert "crypto: arm64/aes-modes: Import from https://github.com/itejo443/android_kernel_samsung_sm7225/blob/ksm/arch/arm64/crypto/aes-modes.S" This reverts commit 1f675ae3f390b0f1c0428394dcac2a0880c0b913. --- arch/arm64/crypto/aes-modes.S | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/arch/arm64/crypto/aes-modes.S b/arch/arm64/crypto/aes-modes.S index 96eac9fda..496c243de 100755 --- a/arch/arm64/crypto/aes-modes.S +++ b/arch/arm64/crypto/aes-modes.S @@ -232,17 +232,19 @@ AES_ENTRY(aes_ctr_encrypt) bmi .Lctr1x cmn w6, #4 /* 32 bit overflow? */ bcs .Lctr1x - ldr q8, .Laddends /* addends 1,2,3[,0] */ - dup v7.4s, w6 + add w7, w6, #1 mov v0.16b, v4.16b - add v7.4s, v7.4s, v8.4s + add w8, w6, #2 mov v1.16b, v4.16b - rev32 v8.16b, v7.16b + add w9, w6, #3 mov v2.16b, v4.16b + rev w7, w7 mov v3.16b, v4.16b - mov v1.s[3], v8.s[0] - mov v2.s[3], v8.s[1] - mov v3.s[3], v8.s[2] + rev w8, w8 + mov v1.s[3], w7 + rev w9, w9 + mov v2.s[3], w8 + mov v3.s[3], w9 ld1 {v5.16b-v7.16b}, [x20], #48 /* get 3 input blocks */ bl aes_encrypt_block4x eor v0.16b, v5.16b, v0.16b @@ -295,12 +297,6 @@ AES_ENTRY(aes_ctr_encrypt) rev x7, x7 ins v4.d[0], x7 b .Lctrcarrydone - -.Laddends: - .word 0x00000001 - .word 0x00000002 - .word 0x00000003 - .word 0x00000000 AES_ENDPROC(aes_ctr_encrypt) .ltorg @@ -521,4 +517,4 @@ AES_ENTRY(aes_mac_update) ld1 {v0.16b}, [x23] /* get dg */ enc_prepare w21, x20, x0 b .Lmacloop4x -AES_ENDPROC(aes_mac_update) \ No newline at end of file +AES_ENDPROC(aes_mac_update)