Commit 4831e1ff authored by Niels Möller's avatar Niels Möller
Browse files

(_aes_crypt): Moved increment of src into the

source_loop. Also fixed stop condition, the loop was run 5 times,
not 4, as it should.
(_aes_crypt): Use src directly when accessing the source data,
don't use %o5.
(_aes_crypt): Renamed variables in source_loop.
(_aes_crypt): Changed stop condition in source_loop to not depend
on i.
Finally reduced the source_loop to 16 instructions. Also increased
the alignment of the code to 16.

Rev: src/nettle/sparc/aes.asm:1.49
parent b71ab570
...@@ -7,7 +7,7 @@ include(`asm.m4') ...@@ -7,7 +7,7 @@ include(`asm.m4')
.file "aes.asm" .file "aes.asm"
.section ".text" .section ".text"
.align 4 .align 16
.global _aes_crypt .global _aes_crypt
.type _aes_crypt,#function .type _aes_crypt,#function
.proc 020 .proc 020
...@@ -66,40 +66,36 @@ _aes_crypt: ...@@ -66,40 +66,36 @@ _aes_crypt:
.Lblock_loop: .Lblock_loop:
! Read src, and add initial subkey ! Read src, and add initial subkey
mov -4, i
! Read src, and add initial subkey
! mov -4, i
! Difference between ctx and src ! Difference between ctx and src
sub ctx, src, %g2 sub ctx, src, %g2
! Difference between wtxt and src ! Difference between wtxt and src
sub wtxt, src, %g3 sub wtxt, src, %g3
! For stop condition ! For stop condition. Note that src is incremented in the
add src, 12, %g4 ! delay slot
.Lsource_loop: add src, 8, %g4
add i, 4, i nop
.Lsource_loop:
ldub [src+3], t3 ldub [src+3], t3
ldub [src+2], t2 ldub [src+2], t2
sll t3, 24, t3 sll t3, 24, t3
ldub [src+1], t1 ldub [src+1], t1
sll t2, 16, t2 sll t2, 16, t2
or t3, t2, t3 or t3, t2, t3
ldub [src], t0 ldub [src], t0
sll t1, 8, t1 sll t1, 8, t1
! Get subkey ! Get subkey
ld [ctx+i], t2 ld [src+%g2], t2
or t3, t1, t3 or t3, t1, t3
or t3, t0, t3 or t3, t0, t3
xor t3, t2, t3 xor t3, t2, t3
add src, 4, src
! cmp i, 8
cmp src, %g4 cmp src, %g4
st t3, [src+%g3]
bleu .Lsource_loop bleu .Lsource_loop
add src, 4, src
st t3, [wtxt+i]
mov 16, round mov 16, round
add ctx, 16, key add ctx, 16, key
......
Supports Markdown
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