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

View File

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