From 433d2b9554e5830872c7c7003eccf51b60e37ca8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niels=20M=C3=B6ller?= <nisse@lysator.liu.se> Date: Sun, 16 Oct 2005 13:52:49 +0200 Subject: [PATCH] * sparc/machine.m4 (TMP3): A third temporary register. (AES_FINAL_ROUND): Prepared for scheduling. Rev: src/nettle/sparc/machine.m4:1.10 --- sparc/machine.m4 | 46 ++++++++++++++++++++++++---------------------- 1 file changed, 24 insertions(+), 22 deletions(-) diff --git a/sparc/machine.m4 b/sparc/machine.m4 index 0fbdffca..adc205e2 100644 --- a/sparc/machine.m4 +++ b/sparc/machine.m4 @@ -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 +>) -- GitLab