Skip to content
Snippets Groups Projects
Commit 433d2b95 authored by Niels Möller's avatar Niels Möller
Browse files

* sparc/machine.m4 (TMP3): A third temporary register.

(AES_FINAL_ROUND): Prepared for scheduling.

Rev: src/nettle/sparc/machine.m4:1.10
parent 5728e9a1
No related branches found
No related tags found
No related merge requests found
......@@ -7,6 +7,7 @@ C eval.
C Used as temporaries by the AES macros
define(<TMP1>, <%g1>)
define(<TMP2>, <%g2>)
define(<TMP3>, <%g3>)
C Loop invariants used by AES_ROUND
define(<T0>, <%o0>)
......@@ -62,31 +63,32 @@ C Compute one word in the final round function. Output is converted to
C octets and stored at dst. Relies on AES_SBOX being zero.
define(<AES_FINAL_ROUND>, <
C Load subkey
ld [$7 + eval(4*$1)], TMP1
ld [$7 + eval(4*$1)], TMP3
and $3, 0xff, TMP2
ldub [T + TMP2], TMP2
and $3, 0xff, TMP1 C 0
ldub [T + TMP1], TMP1 C 0
nop
xor TMP1, TMP2, TMP2
stb TMP2, [$8 + eval(4*$1)]
xor TMP3, TMP1, TMP1 C 0
stb TMP1, [$8 + eval(4*$1)] C 0
srl $4, 8, TMP2
and TMP2, 0xff, TMP2
ldub [T + TMP2], TMP2
srl TMP1, 8, TMP1
xor TMP1, TMP2, TMP2
stb TMP2, [$8 + eval(4*$1 + 1)]
srl $4, 8, TMP2 C 1
and TMP2, 0xff, TMP2 C 1
ldub [T + TMP2], TMP2 C 1
srl TMP3, 8, TMP3 C 1
xor TMP3, TMP2, TMP2 C 1
stb TMP2, [$8 + eval(4*$1 + 1)] C 1
srl $5, 16, TMP2
and TMP2, 0xff, TMP2
ldub [T + TMP2], TMP2
srl TMP1, 8, TMP1
xor TMP1, TMP2, TMP2
stb TMP2, [$8 + eval(4*$1 + 2)]
srl $5, 16, TMP1 C 2
and TMP1, 0xff, TMP1 C 2
ldub [T + TMP1], TMP1 C 2
srl TMP3, 8, TMP3 C 2
xor TMP3, TMP1, TMP1 C 2
stb TMP1, [$8 + eval(4*$1 + 2)] C 2
srl $6, 24, TMP2
ldub [T + TMP2], TMP2
srl TMP1, 8, TMP1
xor TMP1, TMP2, TMP2
stb TMP2, [$8 + eval(4*$1 + 3)]>)
srl $6, 24, TMP2 C 3
ldub [T + TMP2], TMP2 C 3
srl TMP3, 8, TMP3 C 3
xor TMP3, TMP2, TMP2 C 3
stb TMP2, [$8 + eval(4*$1 + 3)] C 3
>)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment