Commit b187db09 authored by Ard Biesheuvel's avatar Ard Biesheuvel Committed by Iliyan Malchev

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

commit 40190c85f427dcfdbab5dbef4ffd2510d649da1f upstream.

Patch 638591c 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.

Change-Id: Iadf37cb5db3a826ced7b99e5ee6d298479355cbd
Signed-off-by: default avatarArd Biesheuvel <>
Acked-by: default avatarNicolas Pitre <>
Signed-off-by: default avatarRussell King <>
Signed-off-by: default avatarGreg Kroah-Hartman <>
parent c64e7c99
......@@ -148,7 +148,7 @@ AES_Te:
@ const AES_KEY *key) {
.align 5
sub r3,pc,#8 @ AES_encrypt
adr r3,AES_encrypt
stmdb sp!,{r1,r4-r12,lr}
mov r12,r0 @ inp
mov r11,r2
......@@ -381,7 +381,7 @@ _armv4_AES_encrypt:
.align 5
sub r3,pc,#8 @ AES_set_encrypt_key
adr r3,_armv4_AES_set_encrypt_key
teq r0,#0
moveq r0,#-1
beq .Labrt
......@@ -843,7 +843,7 @@ AES_Td:
@ const AES_KEY *key) {
.align 5
sub r3,pc,#8 @ AES_decrypt
adr r3,AES_decrypt
stmdb sp!,{r1,r4-r12,lr}
mov r12,r0 @ inp
mov r11,r2
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment