dmarman/sha256algorithm

Incorrect instructions in step 0 with hex input

acut3 opened this issue · 1 comments

acut3 commented

There are two issues with the instructions displayed for step 0 when an hex input is used:

  1. Sub-step 1, where a single bit is added after the input data, is missing
  2. The message length used in the instructions is computed incorrectly. For example, for hex input "ff", message length is said to be 2 when it should be 8. Consequently, the numbers of zeroes to add is also stated incorrectly (445 when it should be 439)

Note that it's only the instructions (in the leftmost column, under the message block) that are incorrect. Everything else is fine and the hash is computed correctly.

Oh and thank you so much for this tool, it's brilliant!

Clarifying the issue about the incorrect message length ("10" instead of "01000") in the text in the 3 step, I'm informing that there is the correct binary representation (00001000 in green) in the message block section shown:
image