Design of SHA-256

SHA-256 has the input message size < 264-bits. Block size is 512-bits, and it has a word size of 32-bits. The output is a 256-bit digest.

The compression function processes a 512-bit message block and a 256-bit intermediate hash value. There are two main components of this function: the compression function and a message schedule.

The algorithm works as follows, in eight steps:

  1. Preprocessing:
    1. Padding of the message is used to adjust the length of a block to 512-bits if it is smaller than the required block size of 512-bits.
    2. Parsing the message into message blocks, which ensures that the message and its padding is divided into equal blocks of 512-bits.
    3. Setting up the initial hash value, which consists of the eight 32-bit ...

Get Mastering Blockchain - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.