Small cleanups in SHA-1.

This commit is contained in:
Stephen Heumann 2017-06-30 13:23:29 -05:00
parent 6c1d703b84
commit 97fc1ce981
2 changed files with 8 additions and 12 deletions

View File

@ -2,14 +2,14 @@
mcopy sha1.macros mcopy sha1.macros
* Direct page locations * Direct page locations
;chunk gequ 0 ; 8 bytes ;chunk gequ 0
a_ gequ 8 ; elements of state a_ gequ 8 ; elements of state
b gequ 12 b gequ 12
c gequ 16 c gequ 16
d gequ 20 d gequ 20
e gequ 24 e gequ 24
idx gequ 28 idx gequ 28
f40temp gequ 30 unused gequ 30
f_plus_k gequ 32 f_plus_k gequ 32
temp gequ 36 temp gequ 36
h0 gequ 40 h0 gequ 40
@ -19,10 +19,6 @@ h3 gequ 52
h4 gequ 56 h4 gequ 56
w gequ 60 w gequ 60
initial_value privdata
dc h'67452301 efcdab89 98badcfe 10325476 c3d2e1f0'
end
sha1_init start sha1_init start
CFunction SHA1_INIT CFunction SHA1_INIT

View File

@ -253,10 +253,10 @@ dorotl3
lda &c lda &c
ora &d ora &d
and &b and &b
sta f40temp sta temp
lda &c lda &c
and &d and &d
ora f40temp ora temp
clc clc
adc #$BCDC adc #$BCDC
sta f_plus_k sta f_plus_k
@ -264,10 +264,10 @@ dorotl3
lda &c+2 lda &c+2
ora &d+2 ora &d+2
and &b+2 and &b+2
sta f40temp sta temp
lda &c+2 lda &c+2
and &d+2 and &d+2
ora f40temp ora temp
adc #$8F1B adc #$8F1B
sta f_plus_k+2 sta f_plus_k+2
.skip3 .skip3
@ -321,9 +321,8 @@ dorotl3
macro macro
BlockLoopPart &part BlockLoopPart &part
lda #0 stz idx
loop&part anop loop&part anop
sta idx
BlockLoopIter a_,b,c,d,e,0 BlockLoopIter a_,b,c,d,e,0
BlockLoopIter e,a_,b,c,d,1 BlockLoopIter e,a_,b,c,d,1
@ -336,6 +335,7 @@ loop&part anop
adc #4*5 adc #4*5
cmp #20*4 cmp #20*4
bge endloop&part bge endloop&part
sta idx
jmp loop&part jmp loop&part
endloop&part anop endloop&part anop
mend mend