Difference between revisions of "83Plus:BCALLs:8090"

From WikiTI
Jump to: navigation, search
(Example)
(Comments)
Line 21: Line 21:
  
 
== Comments ==
 
== Comments ==
This B_CALL incrementally changes the md5 "registers" for the data you give it. But it does not add the size word that is required to generate official MD5 hashes, you have to do this yourself if you want official hashes.
+
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|808D]] 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|8018]].
  
 
== Example ==
 
== Example ==

Revision as of 18:25, 27 March 2005

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: (4 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 808D 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 8018.

Example

B_CALL InitializeMD5
ld bc,0040h
ld hl,SomeAddress
B_CALL CalculateMD5
B_CALL FinishMD5

Credits and Contributions

  • FloppusMaximus: For testing that this B_CALL also work with lengths unequal to 64 bytes