SHA-512 is a SHA-2 cryptographic hash function with a 512-bit digest. It processes 1024-bit message blocks through eighty rounds using eight 64-bit state words and additions modulo . Its message-length field is 128 bits.[ref]
For bit length , padding appends one bit and zero bits so that
then appends the 128-bit original length. The hash initialization vector is fixed by the algorithm; it is not a fresh secret for each message. The padded blocks update the state in order, and the final eight words form the digest.
For a computed example, hash the three ASCII bytes 61 62 63. Here , so and . One padded 128-byte block is processed. Its digest, in hexadecimal, is
ddaf35a193617abacc417349ae20413112e6fa4e89a97ea20a9eeee64b55d39a2192992a274fc1a836ba3c23a3feebbd454d4423643ce80e2a9ac94fa54ca49f.
The 128 hexadecimal digits represent 64 bytes. They do not represent the 128-byte padded input. For another padding-count example, 111 input bytes fit into one padded block, while 112 input bytes require two; the digest remains 64 bytes in either case.
SHA-384, SHA-512/224 and SHA-512/256 reuse the SHA-512 compression structure but have specified different initial states and output rules. Taking a prefix of an ordinary SHA-512 digest therefore does not implement those algorithms. A cryptographic test vector must identify the exact hash, input encoding and expected output rather than only a digest length.

Articles by others on the same topic (0)

There are currently no matching articles.