summaryrefslogtreecommitdiff
path: root/sparc
diff options
context:
space:
mode:
authorNiels Möller <nisse@lysator.liu.se>2002-02-25 16:45:59 +0100
committerNiels Möller <nisse@lysator.liu.se>2002-02-25 16:45:59 +0100
commita06b715eccea6dcf6d6c175986c1c25c9d66438a (patch)
treef19354d7119d7b69d09bbad048ae3495e6e22dd8 /sparc
parentcf225e9e32a7c78116691f9d8ea6acc1636ec62d (diff)
downloadnettle-a06b715eccea6dcf6d6c175986c1c25c9d66438a.tar.gz
(_aes_crypt): Deleted idx register. Further cleanup.
Rev: src/nettle/sparc/aes.asm:1.65
Diffstat (limited to 'sparc')
-rw-r--r--sparc/aes.asm29
1 files changed, 10 insertions, 19 deletions
diff --git a/sparc/aes.asm b/sparc/aes.asm
index 0df565ca..e49a195d 100644
--- a/sparc/aes.asm
+++ b/sparc/aes.asm
@@ -106,7 +106,6 @@ _aes_crypt:
.Lround_loop:
! 4*i
mov 0, i
- ! add T, AES_SIDX3, idx
.Linner_loop:
! The comments mark which j in T->table[j][ Bj(wtxt[IDXi(i)]) ]
! the instruction is a part of.
@@ -114,68 +113,60 @@ _aes_crypt:
! The code uses the register %o[j], aka tj, as the primary
! register for that sub-expression. True for j==1,3.
- ! AES_SIDX1
ld [IDX1+i], t1 ! 1
- ! AES_SIDX2
+
! IDX2(j) = j XOR 2
xor i, 8, t2
- ! wtxt[IDX1...]
add wtxt, t1, t1 ! 1
ldub [t1+2], t1 ! 1
-
- ! AES_SIDX3
ld [IDX3+i], t3 ! 3
+
sll t1, 2, t1 ! 1
- ! wtxt[i]
ld [wtxt+i], t0 ! 0
- ! wtxt[IDX2...]
lduh [wtxt+t2], t2 ! 2
-
and t0, 255, t0 ! 0
- ! wtxt[IDX3...]
+
ldub [wtxt+t3], t3 ! 3
sll t0, 2, t0 ! 0
ld [T0+t0], t0 ! 0
-
and t2, 255, t2 ! 2
+
ld [T1+t1], t1 ! 1
sll t2, 2, t2 ! 2
ld [T2+t2], t2 ! 2
-
sll t3, 2, t3 ! 3
+
ld [T3+t3], t3 ! 3
xor t0, t1, t0 ! 0, 1
xor t0, t2, t0 ! 0, 1, 2
-
- ! add idx, 4, idx
! Fetch roundkey
ld [key+i], t1
+
xor t0, t3, t0 ! 0, 1, 2, 3
xor t0, t1, t0
-
st t0, [tmp+i]
cmp i, 8
+
bleu .Linner_loop
add i, 4, i
-
! switch roles for tmp and wtxt
xor wtxt, diff, wtxt
subcc round, 1, round
+
add key, 16, key
nop
-
bne .Lround_loop
xor tmp, diff, tmp
! final round
! 4*i
mov 0, i
- ! SIDX3
- ! add T, AES_SIDX3, idx
+
.Lfinal_loop:
! Comments mark which j in T->sbox[Bj(wtxt[IDXj(i)])]
! the instruction is part of
ld [IDX1+i], t1 ! 1
+ ! IDX2(j) = j XOR 2
xor i, 8, t2
! ld [idx-16], t2 ! 2
add wtxt, t1, t1 ! 1