mirror of
https://github.com/sheumann/65816-crypto.git
synced 2024-06-01 10:41:29 +00:00
Don't update index value in each unrolled loop iteration.
This commit is contained in:
parent
2d8c85bd98
commit
d97e0c0153
4
sha1.asm
4
sha1.asm
|
@ -88,16 +88,12 @@ SHA1_PROCESSCHUNK start
|
||||||
sta e+2
|
sta e+2
|
||||||
|
|
||||||
ComputeSchedule 1
|
ComputeSchedule 1
|
||||||
ldx #0
|
|
||||||
BlockLoopPart 1
|
BlockLoopPart 1
|
||||||
ComputeSchedule 2
|
ComputeSchedule 2
|
||||||
ldx #0
|
|
||||||
BlockLoopPart 2
|
BlockLoopPart 2
|
||||||
ComputeSchedule 3
|
ComputeSchedule 3
|
||||||
ldx #0
|
|
||||||
BlockLoopPart 3
|
BlockLoopPart 3
|
||||||
ComputeSchedule 4
|
ComputeSchedule 4
|
||||||
ldx #0
|
|
||||||
BlockLoopPart 4
|
BlockLoopPart 4
|
||||||
|
|
||||||
endloop clc
|
endloop clc
|
||||||
|
|
38
sha1.macros
38
sha1.macros
|
@ -212,10 +212,7 @@ dorotl3
|
||||||
* One iteration of the loop for processing blocks.
|
* One iteration of the loop for processing blocks.
|
||||||
* The a,b,c,d,e variables are given as parameters so we can aviod cycling them.
|
* The a,b,c,d,e variables are given as parameters so we can aviod cycling them.
|
||||||
macro
|
macro
|
||||||
BlockLoopIter &a,&b,&c,&d,&e,&part
|
BlockLoopIter &a,&b,&c,&d,&e,&iter
|
||||||
|
|
||||||
stx idx
|
|
||||||
ROTL4MOVE temp,&a,5
|
|
||||||
|
|
||||||
* f_0 to f_19
|
* f_0 to f_19
|
||||||
aif &part<>1,.skip1
|
aif &part<>1,.skip1
|
||||||
|
@ -291,12 +288,13 @@ dorotl3
|
||||||
sta f_plus_k+2
|
sta f_plus_k+2
|
||||||
.skip4
|
.skip4
|
||||||
|
|
||||||
|
ROTL4MOVE temp,&a,5
|
||||||
ldx idx
|
ldx idx
|
||||||
clc
|
clc
|
||||||
lda w,x
|
lda w+&iter*4,x
|
||||||
adc temp
|
adc temp
|
||||||
tay
|
tay
|
||||||
lda w+2,x
|
lda w+&iter*4+2,x
|
||||||
adc temp+2
|
adc temp+2
|
||||||
tax
|
tax
|
||||||
clc
|
clc
|
||||||
|
@ -316,27 +314,27 @@ dorotl3
|
||||||
|
|
||||||
ROTL4 &b,30
|
ROTL4 &b,30
|
||||||
|
|
||||||
ldx idx
|
|
||||||
inx
|
|
||||||
inx
|
|
||||||
inx
|
|
||||||
inx
|
|
||||||
mend
|
mend
|
||||||
|
|
||||||
|
|
||||||
* One part of the loop for processing blocks (20 iterations)
|
* One part of the loop for processing blocks (20 iterations)
|
||||||
macro
|
macro
|
||||||
BlockLoopPart &part
|
BlockLoopPart &part
|
||||||
|
|
||||||
loop&part anop
|
|
||||||
|
|
||||||
BlockLoopIter a_,b,c,d,e,&part
|
|
||||||
BlockLoopIter e,a_,b,c,d,&part
|
|
||||||
BlockLoopIter d,e,a_,b,c,&part
|
|
||||||
BlockLoopIter c,d,e,a_,b,&part
|
|
||||||
BlockLoopIter b,c,d,e,a_,&part
|
|
||||||
|
|
||||||
cpx #20*4
|
lda #0
|
||||||
|
loop&part anop
|
||||||
|
sta idx
|
||||||
|
|
||||||
|
BlockLoopIter a_,b,c,d,e,0
|
||||||
|
BlockLoopIter e,a_,b,c,d,1
|
||||||
|
BlockLoopIter d,e,a_,b,c,2
|
||||||
|
BlockLoopIter c,d,e,a_,b,3
|
||||||
|
BlockLoopIter b,c,d,e,a_,4
|
||||||
|
|
||||||
|
clc
|
||||||
|
lda idx
|
||||||
|
adc #4*5
|
||||||
|
cmp #20*4
|
||||||
bge endloop&part
|
bge endloop&part
|
||||||
jmp loop&part
|
jmp loop&part
|
||||||
endloop&part anop
|
endloop&part anop
|
||||||
|
|
Loading…
Reference in New Issue
Block a user