SHA-2 2026-11-05
SHA-2 is a family of cryptographic hash functions including SHA-224, SHA-256, SHA-384, SHA-512, SHA-512/224 and SHA-512/256. NIST specifies these algorithms in FIPS 180-4. Their digest lengths are respectively 224, 256, 384, 512, 224 and 256 bits; the algorithm name therefore matters as well as the output size.[ref]
The SHA-224/SHA-256 branch uses 32-bit words and 512-bit message blocks. The SHA-384/SHA-512 branch and its specified truncation variants use 64-bit words and 1024-bit message blocks. Different initial values are part of the definitions. In particular, SHA-512/256 is not simply the first 256 bits of an ordinary SHA-512 digest.[ref]
For a computed example, hashing the three ASCII bytes 61 62 63 with SHA-512/256 produces
53048e2681941ef99b2e29b76b4c7dabe4c2d0c634fc6d46e0e2f13107e7af23.
Taking the first 256 bits of the SHA-512 digest of those same bytes instead gives
ddaf35a193617abacc417349ae20413112e6fa4e89a97ea20a9eeee64b55d39a.
Both outputs occupy 32 bytes and require 64 hexadecimal digits, yet they differ. An interface identifying its hash only as a 256-bit digest leaves the selected algorithm ambiguous.
A digest is deterministic and does not conceal low-entropy inputs by itself. Nor does an unkeyed digest establish who supplied a message: a sender-authentication mechanism such as HMAC uses a cryptographic key and an appropriate security definition. Preimage resistance, second-preimage resistance and collision resistance are distinct properties; their meanings should not be replaced by the mere observation that two displayed examples have different outputs.
SHA-224 2026-11-05
SHA-224 is a SHA-2 cryptographic hash function producing a 224-bit digest. It follows the SHA-256 computation with a different hash initialization vector and a final output shortened to its first seven 32-bit state words.[ref]
If the final state words are , the digest is
This is bits, or 28 bytes and 56 hexadecimal digits. The input is still padded into 512-bit blocks, and each block still undergoes the SHA-256 family's 64-round computation. Output width and internal processing width are different quantities.
For a computed example, the ASCII bytes 61 62 63 give
23097d223405d8228642a477bda255b32aadbce4bda0b3f7e36c9da7.
A SHA-256 digest of the same bytes begins ba7816bf8f01cfea. Keeping only its first 28 bytes therefore does not give SHA-224. The algorithm's different initial values are applied before processing any message block.
The same output length also does not make SHA-224 identical to SHA-512/224. The latter uses the 64-bit SHA-512 family structure, a different initial state and a different padding/length-field convention. For instance, a 56-byte input takes two padded blocks in SHA-224 but only one in the SHA-512-based variant. Both results have 28 bytes, so a digest field's size cannot identify which function produced it.
The intended cryptographic protocol must select the hash explicitly. A cryptographic test vector for SHA-224 checks that defined function, whereas an HMAC vector also specifies its key and keyed construction.
SHA-512 2026-11-05
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.
SHA-512/t 2026-11-05
SHA-512/t is the family of -bit cryptographic hash functions built using the SHA-512 computation with a -specific hash initialization vector and final truncation. The FIPS 180-4 construction takes a positive integer , excluding ; SHA-384 has its separately specified initialization. The 2015 standard explicitly specifies SHA-512/224 and SHA-512/256 as the approved members, rather than treating every permissible parameter as a standardized choice.[ref]
The initialization procedure first XORs each ordinary SHA-512 initial word with hexadecimal a5a5a5a5a5a5a5a5. It then hashes the ASCII label SHA-512/t, replacing t with its decimal value without leading zeros, using that modified initial state. The resulting full 512-bit value becomes the selected member's fixed initial state.[ref]
For a concrete word calculation,
where denotes bitwise exclusive or. All eight words are modified, not just this first one. At , the label is the eleven ASCII bytes 53 48 41 2d 35 31 32 2f 32 35 36. At , its final three bytes are instead 32 32 34. The slash is an actual label byte, not a division operation or a parser instruction.
The generated initial state's first word is 22312194fc2bf72c for SHA-512/256 and 8c3d37c819544da2 for SHA-512/224. These fixed values separate the algorithms before the user's message is processed. Hashing the label with ordinary SHA-512 initialization would follow a different procedure.[ref]
After processing the message with its member-specific initialization, retain the first bits of the final state. For an abstract serialization exercise, a state beginning with bytes ab cd would yield bits 1010101111001; the lower three bits of the second byte are excluded. This illustrates bit truncation, not a recommendation to use a 13-bit digest. Output length, initialization and protocol selection all remain part of the algorithm's identity.