Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- sha_hw_lock: db 0
- _hw_sha256_init := 000035Ch
- hash_hwsha256_init:
- ld a, (sha_hw_lock)
- cp 0
- .smc_sha_hw_lock := $-1
- jr nz, .exit0
- call port_unlock
- call _hw_sha256_init
- call port_lock
- ld a, 1
- ld (.smc_sha_hw_lock), a
- jr .exit
- .exit0:
- ld a, 0
- .exit:
- ret
- _hw_sha256_update := 0000360h
- hash_hwsha256_update:
- call ti._frameset0
- ; (ix + 0) RV
- ; (ix + 3) old IX
- ; (ix + 6) arg1: ctx
- ; (ix + 9) arg2: data
- ; (ix + 12) arg3: len
- ; get data, len in proper imm24s
- call port_unlock
- ld hl, (ix + 9)
- ld bc, (ix + 12)
- call _hw_sha256_update
- call port_lock
- pop ix
- ret
- _hw_sha256_final := 0000364h
- hash_hwsha256_final:
- call ti._frameset0
- ; (ix + 6) arg1: digest
- ; get digest in proper imm24s
- call port_unlock
- ld hl, (ix + 6)
- call _hw_sha256_final
- call port_lock
- ld a, 0
- ld (sha_hw_lock), a
- pop ix
- ret
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement