Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 62c24708 authored by Ard Biesheuvel's avatar Ard Biesheuvel Committed by Herbert Xu
Browse files

crypto: arm64/aes-neon - move literal data to .rodata section



Move the S-boxes and some other literals to the .rodata section where
it is safe from being exploited by speculative execution.

Signed-off-by: default avatarArd Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent 96a74f7b
Loading
Loading
Loading
Loading
+4 −4
Original line number Original line Diff line number Diff line
@@ -32,10 +32,10 @@


	/* preload the entire Sbox */
	/* preload the entire Sbox */
	.macro		prepare, sbox, shiftrows, temp
	.macro		prepare, sbox, shiftrows, temp
	adr		\temp, \sbox
	movi		v12.16b, #0x1b
	movi		v12.16b, #0x1b
	ldr		q13, \shiftrows
	ldr_l		q13, \shiftrows, \temp
	ldr		q14, .Lror32by8
	ldr_l		q14, .Lror32by8, \temp
	adr_l		\temp, \sbox
	ld1		{v16.16b-v19.16b}, [\temp], #64
	ld1		{v16.16b-v19.16b}, [\temp], #64
	ld1		{v20.16b-v23.16b}, [\temp], #64
	ld1		{v20.16b-v23.16b}, [\temp], #64
	ld1		{v24.16b-v27.16b}, [\temp], #64
	ld1		{v24.16b-v27.16b}, [\temp], #64
@@ -272,7 +272,7 @@


#include "aes-modes.S"
#include "aes-modes.S"


	.text
	.section	".rodata", "a"
	.align		6
	.align		6
.LForward_Sbox:
.LForward_Sbox:
	.byte		0x63, 0x7c, 0x77, 0x7b, 0xf2, 0x6b, 0x6f, 0xc5
	.byte		0x63, 0x7c, 0x77, 0x7b, 0xf2, 0x6b, 0x6f, 0xc5