Skip to main content
. 2021 Jun 26;21(13):4388. doi: 10.3390/s21134388
Algorithm 1 SHA-256.
  • 1:

    for Compression Function do

  • 2:

        Message Schedule module (Equation (1))

  • 3:

        Words are prepared for each round Maj (Equation (2))

  • 4:

        for First 16 rounds Wn do (Equation (3))

  • 5:

            Six registers b,c,d,f,g,h are updated with the previous registers

  • 6:

            K are a set of 64 constant words (Equations (4) and (5))

  • 7:

            After 64 rounds of operation H1 to H7

  • 8:

            if thenH7i=H7i7

  • 9:

                  Final 256-bit Hash value is obtained by concatenating 32-bit values

  • 10:

            end if

  • 11:

            Hash digest = H0M to H1M

  • 12:

        end for

  • 13:

    end for