ItemValue
NameSHA-256-DIGEST (spec document BIND SHA-256-DIGEST)
TAG ID0x07CL
Codec ID0x000007C0
Spec document0x00000000/codecs/0x000007C0/ (DECLARE target 07C0)
Section3 0011 (Value), offset within section C = 28
KindValue · family: BINARY
TAG WORD0000 0111 1100 LLLL (000K KKKC CCCC LLLL)
Index descriptionSHA-256 result in a fixed Payload of 16 WORDs
Hugo pathvalue/binary/sha-256-digest.md

Fields (spec document)

The order of FIELDs in the document is the order of Payload fields (Codec spec document).

OrderField (BIND)FIELDWidthAccepted format (CODEC)ENUM
1digest#2raw 16 WORDs

SHA-256-DIGEST is a fixed-width Value that holds the entire result of SHA-256 of the SHA-2 family. It is the Value direct code 0x07CL, family BINARY. The Payload is exactly 16 WORDs (256 bits), and truncation is not allowed.

Layout

TAG WORD          0x07CE (0000 0111 1100 1110)  LLLL=1110
Length ext. TAG   1 WORD  0x0012 (18 WORDs in total)
Payload           16 WORDs  SHA-256 Digest

Interpretation and validity

  • Read the 32 Payload octets in the SHA-256 output order as is. Within each WORD, the upper octet comes first.
  • No separate GEUL endian conversion is applied to the digest bit string. The output octet sequence is simply grouped two octets at a time in order and framed as 16-bit big-endian WORDs.
  • A Payload that is not 16 WORDs, or a representation in which the result is arbitrarily cut, is rejected. There is no descriptor or padding.

Standards basis

  • The SHA-256 algorithm and its 256-bit result follow NIST FIPS 180-4, Secure Hash Standard (SHS).
  • The GEUL TAG, Length, and 16-bit WORD framing are rules this format adds and are not part of the SHA-2 algorithm.

Length

  • The total is exactly 18 WORDs, the TAG 1 WORD, the Length extension TAG 1 WORD, and the Payload 16 WORDs added together, and uses LLLL=1110. There is no descriptor or padding.
  • If the Payload is not exactly 16 WORDs, it is rejected.

Example

  • The digest octets d[0] through d[31] are placed in order as Payload WORDs (d[0]<<8)|d[1] through (d[30]<<8)|d[31]. The total Length is always 18 WORDs.

Spec document source

This is the spec document 0x00000000/codecs/0x000007C0/latest.geul as read with geul show (hex in uppercase).

SPEC-VERSION 0x0001
DOC-ID 0x042600000000000007C000000000
BODY
#1 DECLARE 0x07C0
#2 FIELD #1 0x0010
#3 BIND #1 "SHA-256-DIGEST"
#4 BIND #2 "digest"