0

In Wikipedia pseudo code of SHA-512 the padding section says pad 1 bit then 0 bits. It then goes on to say append length without 1 or 0 padding. What does that mean?

https://en.wikipedia.org/wiki/SHA-2#Pseudocode

append length of message (without the '1' bit or padding), in bits, as 64-bit big-endian integer

The appending of message length in sha-2 as a 64 bit integer without 1 and 0 padding is a bit confusing. How is it different from SHA-1?

Maarten Bodewes
  • 96,351
  • 14
  • 169
  • 323

1 Answers1

1

Richie is of course correct; the padding needs to be done to form a final block that can also contain the length. As the length encoding is itself static in size, there is no need to pad the length itself.

This is the same as SHA-1 except that the size of the various elements (block size, length encoding) differs.

Maarten Bodewes
  • 96,351
  • 14
  • 169
  • 323