diff --git a/sha1.asm b/sha1.asm index c18ab58..88769ba 100644 --- a/sha1.asm +++ b/sha1.asm @@ -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 diff --git a/sha1.macros b/sha1.macros index d4275c6..3d8a063 100644 --- a/sha1.macros +++ b/sha1.macros @@ -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