crypto: arm64/aes-modes: Import from https://github.com/itejo443/android_kernel_samsung_sm7225/blob/ksm/arch/arm64/crypto/aes-modes.S
Signed-off-by: rsuntk <rissu.ntk@gmail.com>
This commit is contained in:
parent
c5517117ef
commit
1f675ae3f3
1 changed files with 14 additions and 10 deletions
|
@ -232,19 +232,17 @@ AES_ENTRY(aes_ctr_encrypt)
|
||||||
bmi .Lctr1x
|
bmi .Lctr1x
|
||||||
cmn w6, #4 /* 32 bit overflow? */
|
cmn w6, #4 /* 32 bit overflow? */
|
||||||
bcs .Lctr1x
|
bcs .Lctr1x
|
||||||
add w7, w6, #1
|
ldr q8, .Laddends /* addends 1,2,3[,0] */
|
||||||
|
dup v7.4s, w6
|
||||||
mov v0.16b, v4.16b
|
mov v0.16b, v4.16b
|
||||||
add w8, w6, #2
|
add v7.4s, v7.4s, v8.4s
|
||||||
mov v1.16b, v4.16b
|
mov v1.16b, v4.16b
|
||||||
add w9, w6, #3
|
rev32 v8.16b, v7.16b
|
||||||
mov v2.16b, v4.16b
|
mov v2.16b, v4.16b
|
||||||
rev w7, w7
|
|
||||||
mov v3.16b, v4.16b
|
mov v3.16b, v4.16b
|
||||||
rev w8, w8
|
mov v1.s[3], v8.s[0]
|
||||||
mov v1.s[3], w7
|
mov v2.s[3], v8.s[1]
|
||||||
rev w9, w9
|
mov v3.s[3], v8.s[2]
|
||||||
mov v2.s[3], w8
|
|
||||||
mov v3.s[3], w9
|
|
||||||
ld1 {v5.16b-v7.16b}, [x20], #48 /* get 3 input blocks */
|
ld1 {v5.16b-v7.16b}, [x20], #48 /* get 3 input blocks */
|
||||||
bl aes_encrypt_block4x
|
bl aes_encrypt_block4x
|
||||||
eor v0.16b, v5.16b, v0.16b
|
eor v0.16b, v5.16b, v0.16b
|
||||||
|
@ -297,6 +295,12 @@ AES_ENTRY(aes_ctr_encrypt)
|
||||||
rev x7, x7
|
rev x7, x7
|
||||||
ins v4.d[0], x7
|
ins v4.d[0], x7
|
||||||
b .Lctrcarrydone
|
b .Lctrcarrydone
|
||||||
|
|
||||||
|
.Laddends:
|
||||||
|
.word 0x00000001
|
||||||
|
.word 0x00000002
|
||||||
|
.word 0x00000003
|
||||||
|
.word 0x00000000
|
||||||
AES_ENDPROC(aes_ctr_encrypt)
|
AES_ENDPROC(aes_ctr_encrypt)
|
||||||
.ltorg
|
.ltorg
|
||||||
|
|
||||||
|
@ -517,4 +521,4 @@ AES_ENTRY(aes_mac_update)
|
||||||
ld1 {v0.16b}, [x23] /* get dg */
|
ld1 {v0.16b}, [x23] /* get dg */
|
||||||
enc_prepare w21, x20, x0
|
enc_prepare w21, x20, x0
|
||||||
b .Lmacloop4x
|
b .Lmacloop4x
|
||||||
AES_ENDPROC(aes_mac_update)
|
AES_ENDPROC(aes_mac_update)
|
Loading…
Add table
Add a link
Reference in a new issue