Difference between revisions of "83Plus:BCALLs:8090"
From WikiTI
m (Changed official name to MD5Update) |
m (→Example) |
||
(12 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
+ | [[Category:83Plus:BCALLs:By Name:Cryptography|MD5Update]] [[Category:83Plus:BCALLs:By Name|MD5Update]] [[Category:83Plus:BCALLs:By Address|8090 - MD5Update]] | ||
== Synopsis == | == Synopsis == | ||
'''Official Name:''' MD5Update | '''Official Name:''' MD5Update | ||
Line 13: | Line 14: | ||
=== Outputs === | === Outputs === | ||
− | * [[83Plus:RAM:8269|8269]]: | + | * [[83Plus:RAM:8269|8269]]: (8 bytes) Holds the length in bits of the data hashed so far. |
− | * [[83Plus:RAM:8292|8292]]: Will be changed to contain the new | + | * [[83Plus:RAM:8292|8292]]: (16 bytes) Will be changed to contain the new (incremental) MD5 hash of the data you gave it |
=== Destroys === | === Destroys === | ||
− | + | * [[83Plus:RAM:8259|8259]]: (16 bytes) Alternate registers (roughly equivalent to the AA, BB, CC, and DD registers specified in the MD5 standard.) | |
+ | * [[83Plus:RAM:83A5|83A5]]: (64 bytes) Buffer holding data to be hashed. | ||
== Comments == | == Comments == | ||
− | This B_CALL incrementally changes the | + | This B_CALL incrementally changes the MD5 "registers" for the data you give it. Note that the registers must be initialized using [[83Plus:BCALLs:808D|MD5Init]] first. You can call this B_CALL as many times as you want to add many separate chunks of data to the hash. To complete the MD5 hash, use [[83Plus:BCALLs:8018|MD5Final]]. |
== Example == | == Example == | ||
− | + | B_CALL [[83Plus:BCALLs:808D|MD5Init]] | |
− | ld bc, | + | ld bc,14 |
− | ld hl, | + | ld hl,String |
− | B_CALL | + | B_CALL MD5Update |
+ | B_CALL [[83Plus:BCALLs:8018|MD5Final]] | ||
+ | ; should give: f96b697d7cb7938d525a2f31aaf161d0 | ||
+ | |||
+ | String: .db "message digest" | ||
== Credits and Contributions == | == Credits and Contributions == | ||
* '''FloppusMaximus:''' For testing that this B_CALL also work with lengths unequal to 64 bytes | * '''FloppusMaximus:''' For testing that this B_CALL also work with lengths unequal to 64 bytes |
Latest revision as of 14:34, 30 March 2005
Contents
Synopsis
Official Name: MD5Update
Other Name: CalculateMD5
BCALL Address: 8090
Calculates the MD5 checksum
Inputs
- BC: The length of the data
- HL: The location of the data
Outputs
- 8269: (8 bytes) Holds the length in bits of the data hashed so far.
- 8292: (16 bytes) Will be changed to contain the new (incremental) MD5 hash of the data you gave it
Destroys
- 8259: (16 bytes) Alternate registers (roughly equivalent to the AA, BB, CC, and DD registers specified in the MD5 standard.)
- 83A5: (64 bytes) Buffer holding data to be hashed.
Comments
This B_CALL incrementally changes the MD5 "registers" for the data you give it. Note that the registers must be initialized using MD5Init first. You can call this B_CALL as many times as you want to add many separate chunks of data to the hash. To complete the MD5 hash, use MD5Final.
Example
B_CALL MD5Init ld bc,14 ld hl,String B_CALL MD5Update B_CALL MD5Final ; should give: f96b697d7cb7938d525a2f31aaf161d0 String: .db "message digest"
Credits and Contributions
- FloppusMaximus: For testing that this B_CALL also work with lengths unequal to 64 bytes