Add zero bytes to optimize some rotates in MD5.

This commit is contained in:
Stephen Heumann 2017-07-04 14:09:41 -05:00
parent 1d1d5251f6
commit 129f371902
2 changed files with 11 additions and 19 deletions

10
md5.asm
View File

@ -26,9 +26,10 @@ a_ gequ 12 ; elements of state
b gequ 16
c gequ 20
d gequ 24
temp2 gequ 28
;unused gequ 32
temp gequ 36
zero1 gequ 28
temp gequ 30
zero2 gequ 34
;unused gequ 36
h0 gequ 40
h1 gequ 44
h2 gequ 48
@ -96,6 +97,9 @@ MD5_INIT start
stz length+4
stz length+6
stz extra
stz zero1
stz zero2
rtl
end

View File

@ -141,11 +141,7 @@
aif &n>7,.skip2
ldx &loc+1
lda &loc+3
and #$00FF
sta temp2
lda &loc-1
and #$FF00
ora temp2
ora &loc-1
sta &loc
stx &loc+2
txa
@ -155,11 +151,7 @@
aif &n>11,.skip3
ldx &loc+1
lda &loc+3
and #$00FF
sta temp2
lda &loc-1
and #$FF00
ora temp2
ora &loc-1
sta &loc
stx &loc+2
ROTL4CONT &loc,&n-8
@ -180,7 +172,7 @@
sty &loc
mexit
.skip5
aif &n>21,.skip6
aif &n>20,.skip6
lda &loc+2
ldy &loc
sta &loc
@ -190,11 +182,7 @@
.skip6
ldx &loc+1
lda &loc+3
and #$00FF
sta temp2
lda &loc-1
and #$FF00
ora temp2
ora &loc-1
sta &loc+2
stx &loc
ROTR4CONT &loc,24-&n