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

* sparc/aes.asm (_aes_crypt): Strength reduce loop variable in the

inner loop, getting rid of one register.

Rev: src/nettle/sparc/aes.asm:1.20
parent 7c890a0d
No related branches found
No related tags found
No related merge requests found
...@@ -64,15 +64,13 @@ _aes_crypt: ...@@ -64,15 +64,13 @@ _aes_crypt:
! wtxt ! wtxt
mov %l1, %g4 mov %l1, %g4
! round: %i5 ! 4*i: %i3
! 4*round: %i3 mov 0, %i3
mov 0, %i5
.Lround_loop: .Lround_loop:
add T, AES_SIDX3, %i4 add T, AES_SIDX3, %i4
.Linner_loop: .Linner_loop:
! AES_IDX1 ! AES_IDX1
ld [%i4-32], %g3 ld [%i4-32], %g3
sll %i5, 2, %i3
! AES_IDX2 ! AES_IDX2
ld [%i4-16], %i2 ld [%i4-16], %i2
...@@ -103,12 +101,16 @@ _aes_crypt: ...@@ -103,12 +101,16 @@ _aes_crypt:
ld [T+%i2], %g3 ld [T+%i2], %g3
xor %g2, %i0, %g2 xor %g2, %i0, %g2
xor %g2, %i1, %g2 xor %g2, %i1, %g2
add %i5, 1, %i5
add %i4, 4, %i4
xor %g2, %g3, %g2 xor %g2, %g3, %g2
st %g2, [%l0+%i3] st %g2, [%l0+%i3]
cmp %i5, 3
cmp %i3, 8
bleu .Linner_loop bleu .Linner_loop
add %i4, 4, %i4 add %i3, 4, %i3
sll %g1, 4, %g2 sll %g1, 4, %g2
add %g2, ctx, %i1 add %g2, ctx, %i1
...@@ -128,7 +130,8 @@ _aes_crypt: ...@@ -128,7 +130,8 @@ _aes_crypt:
add %g1, 1, %g1 add %g1, 1, %g1
cmp %g1, %o7 cmp %g1, %o7
blu .Lround_loop blu .Lround_loop
mov 0, %i5 mov 0, %i3
sll %g1, 4, %g2 sll %g1, 4, %g2
! final round ! final round
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment