Commit 48965ca3 authored by Niels Möller's avatar Niels Möller
Browse files

(_aes_crypt): Renamed more variables in the inner loop. Now the

primary variables are t0, t1, t2, t3. (t1, t2 and t3 done so far).

Rev: src/nettle/sparc/aes.asm:1.36
parent ba3b14e1
...@@ -31,7 +31,9 @@ define(i, %l5) ...@@ -31,7 +31,9 @@ define(i, %l5)
! Teporaries ! Teporaries
define(t1, %o1) define(t1, %o1)
define(t2, %o2)
define(t3, %o3) define(t3, %o3)
define(idx, %o4)
_aes_crypt: _aes_crypt:
! Why -136? ! Why -136?
...@@ -105,7 +107,7 @@ _aes_crypt: ...@@ -105,7 +107,7 @@ _aes_crypt:
! This instruction copied to the delay slot of the branch here. ! This instruction copied to the delay slot of the branch here.
mov 0, i mov 0, i
.Lround_loop: .Lround_loop:
add T, AES_SIDX3, %o2 add T, AES_SIDX3, idx
.Linner_loop: .Linner_loop:
! The comments mark which j in T->table[j][ Bj(wtxt[IDXi(i)]) ] ! The comments mark which j in T->table[j][ Bj(wtxt[IDXi(i)]) ]
! the instruction is a part of. ! the instruction is a part of.
...@@ -114,23 +116,23 @@ _aes_crypt: ...@@ -114,23 +116,23 @@ _aes_crypt:
! register for that sub-expression. True for j==1,3. ! register for that sub-expression. True for j==1,3.
! AES_SIDX1 ! AES_SIDX1
ld [%o2-32], t1 ! 1 ld [idx-32], t1 ! 1
! AES_SIDX2 ! AES_SIDX2
ld [%o2-16], %o4 ! 2 ld [idx-16], t2 ! 2
! wtxt[IDX1...] ! wtxt[IDX1...]
add wtxt, t1, t1 ! 1 add wtxt, t1, t1 ! 1
ldub [t1+2], t1 ! 1 ldub [t1+2], t1 ! 1
! AES_SIDX3 ! AES_SIDX3
ld [%o2], t3 ! 3 ld [idx], t3 ! 3
sll t1, 2, t1 ! 1 sll t1, 2, t1 ! 1
! wtxt[i] ! wtxt[i]
ld [wtxt+i], %o5 ! 0 ld [wtxt+i], %o5 ! 0
! wtxt[IDX2...] ! wtxt[IDX2...]
lduh [wtxt+%o4], %g3 ! 2 lduh [wtxt+t2], t2 ! 2
and %o5, 255, %o5 ! 0 and %o5, 255, %o5 ! 0
...@@ -142,18 +144,18 @@ _aes_crypt: ...@@ -142,18 +144,18 @@ _aes_crypt:
ld [T+%o5], %g2 ! 0 ld [T+%o5], %g2 ! 0
add t1, AES_TABLE1, t1 ! 1 add t1, AES_TABLE1, t1 ! 1
and %g3, 255, %g3 ! 2 and t2, 255, t2 ! 2
ld [T+t1], t1 ! 1 ld [T+t1], t1 ! 1
sll %g3, 2, %g3 ! 2 sll t2, 2, t2 ! 2
add %g3, AES_TABLE2, %g3 ! 2 add t2, AES_TABLE2, t2 ! 2
ld [T+%g3], %o0 ! 2 ld [T+t2], t2 ! 2
sll t3, 2, t3 ! 3 sll t3, 2, t3 ! 3
add t3, AES_TABLE3, t3 ! 3 add t3, AES_TABLE3, t3 ! 3
ld [T+t3], t3 ! 3 ld [T+t3], t3 ! 3
xor %g2, t1, %g2 ! 0, 1 xor %g2, t1, %g2 ! 0, 1
xor %g2, %o0, %g2 ! 0, 1, 2 xor %g2, t2, %g2 ! 0, 1, 2
add %o2, 4, %o2 add idx, 4, idx
! ! Fetch roundkey ! ! Fetch roundkey
! sll round, 4, %o5 ! sll round, 4, %o5
......
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