提交 40190c85 编写于 作者: A Ard Biesheuvel 提交者: Russell King

ARM: 7837/3: fix Thumb-2 bug in AES assembler code

Patch 638591cd enabled building the AES assembler code in Thumb2 mode.
However, this code used arithmetic involving PC rather than adr{l}
instructions to generate PC-relative references to the lookup tables,
and this needs to take into account the different PC offset when
running in Thumb mode.
Signed-off-by: NArd Biesheuvel <ard.biesheuvel@linaro.org>
Acked-by: NNicolas Pitre <nico@linaro.org>
Cc: stable@vger.kernel.org
Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
上级 c4a30c3b
...@@ -148,7 +148,7 @@ AES_Te: ...@@ -148,7 +148,7 @@ AES_Te:
@ const AES_KEY *key) { @ const AES_KEY *key) {
.align 5 .align 5
ENTRY(AES_encrypt) ENTRY(AES_encrypt)
sub r3,pc,#8 @ AES_encrypt adr r3,AES_encrypt
stmdb sp!,{r1,r4-r12,lr} stmdb sp!,{r1,r4-r12,lr}
mov r12,r0 @ inp mov r12,r0 @ inp
mov r11,r2 mov r11,r2
...@@ -381,7 +381,7 @@ _armv4_AES_encrypt: ...@@ -381,7 +381,7 @@ _armv4_AES_encrypt:
.align 5 .align 5
ENTRY(private_AES_set_encrypt_key) ENTRY(private_AES_set_encrypt_key)
_armv4_AES_set_encrypt_key: _armv4_AES_set_encrypt_key:
sub r3,pc,#8 @ AES_set_encrypt_key adr r3,_armv4_AES_set_encrypt_key
teq r0,#0 teq r0,#0
moveq r0,#-1 moveq r0,#-1
beq .Labrt beq .Labrt
...@@ -843,7 +843,7 @@ AES_Td: ...@@ -843,7 +843,7 @@ AES_Td:
@ const AES_KEY *key) { @ const AES_KEY *key) {
.align 5 .align 5
ENTRY(AES_decrypt) ENTRY(AES_decrypt)
sub r3,pc,#8 @ AES_decrypt adr r3,AES_decrypt
stmdb sp!,{r1,r4-r12,lr} stmdb sp!,{r1,r4-r12,lr}
mov r12,r0 @ inp mov r12,r0 @ inp
mov r11,r2 mov r11,r2
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册