Hash initialization vector 2026-11-05
A hash initialization vector is the initial internal state from which a specified cryptographic hash function begins processing a message. For the SHA-2 algorithms, it is a public, algorithm-defined sequence of state words. It is not a fresh per-message cryptographic nonce, a secret key or a cryptographic salt.[ref]
Secure Hash Standard by National Institute of Standards and Technology. §5.3, setting the initial hash value
For an iterative hash, write the state update schematically aswhere is one padded message block and is the algorithm's hash compression function. The digest is derived from the final state by the algorithm's output rule. Initial state, padding, compression and output rule together specify the function; agreeing on only the output width does not specify a hash.
An original comparison uses two specified algorithms. SHA-256 starts with the 32-bit word
6a09e667, while SHA-224 starts with c1059ed8. Both subsequently use the SHA-256-family compression structure, but their full initial states differ. Even the empty message is padded and processed, so its digest is not simply a printed initial state.[ref]Computing the empty-message digests gives SHA-256
e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855and SHA-224
d14a028c2a3a2bc9476102bb288234c415a2b01f828ea62ac5b3e42f.Keeping the first 28 bytes of the first result does not produce the second. Initialization acts before every subsequent block transformation; final truncation cannot substitute for it.
This also matters when implementing several hash variants with one compression routine. Resetting a context must restore the chosen variant's complete initial state and length counters. Accidentally reusing a previous message's final state computes a different function. A known-answer test for empty and short messages can expose such state-management mistakes, although passing finitely many vectors does not prove every update sequence correct.
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]
53048e2681941ef99b2e29b76b4c7dabe4c2d0c634fc6d46e0e2f13107e7af23.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-512/224 2026-11-05
SHA-512/224 is a SHA-2 cryptographic hash function returning 224 bits. It uses the SHA-512 computation with its own hash initialization vector and outputs the first 224 bits of the final state. The SHA-512/t initialization procedure uses the ASCII label
SHA-512/224, so its initial state differs from that of SHA-512/256 as well as ordinary SHA-512.[ref]Output serialization needs care because . If the final eight 64-bit words are , the digest containswhere denotes concatenation in the standard's most-significant-bit-first order. It has 28 bytes, or 56 hexadecimal digits. For a simple serialization example, if were
89abcdef01234567, its contribution would be the four bytes 89 ab cd ef. Taking the four bytes 01 23 45 67 would keep the wrong half. An implementation's machine endianness does not change the specified digest bytes.4634270f707b6a54daae7530460842e20e37ed265ceee9a43e8924aa.SHA-224 of the same bytes begins
23097d223405d822, despite having the same 224-bit output size. The two functions use different compression structures, initial states and message-padding conventions. Taking a prefix of the ordinary SHA-512 digest also gives a different result.The distinction matters in a cryptographic test vector: a 28-byte expected digest cannot identify the intended algorithm by its size alone. The vector must name SHA-512/224 and specify the exact input bytes. The different label used during initialization is fixed by the algorithm; applications do not choose it separately for each hash.