[Paper Review] Instruction sequence expressions for the secure hash algorithm SHA-256
This paper presents a mathematically precise, instruction sequence-based implementation of SHA-256 using program algebra (PGA), modeling the hash function as finite, single-pass instruction sequences composed of Boolean register operations, jumps, and termination. The key contribution is a uniform algebraic description of SHA-256 restricted to bit strings of any length, with a proven linear instruction sequence size of 729,464·N + 1,025 for messages of N 32-bit words.
The secure hash function SHA-256 is a function on bit strings. This means that its restriction to the bit strings of any given length can be computed by a finite instruction sequence that contains only instructions to set and get the content of Boolean registers, forward jump instructions, and a termination instruction. We describe such instruction sequences for the restrictions to bit strings of the different possible lengths by means of uniform terms from an algebraic theory.
Motivation & Objective
- To provide a mathematically precise, formal alternative to the pseudo-code description of SHA-256 in the NIST standard.
- To model the computation of SHA-256 restricted to fixed-length bit strings using only basic instruction sequence primitives: register operations, forward jumps, and termination.
- To demonstrate the feasibility and scalability of expressing complex cryptographic primitives like SHA-256 within the framework of program algebra (PGA).
- To establish a foundation for analyzing computational complexity and algorithmic equivalence of cryptographic algorithms using instruction sequence theory.
Proposed method
- Employing program algebra (PGA) to define instruction sequences using only basic instructions: setting/getting Boolean register values, forward jumps, and termination.
- Encoding 32-bit words as sequences of 32 Boolean registers, enabling bit-level manipulation using algebraic operations.
- Defining core operations (e.g., modular addition, bitwise shifts, rotations, XOR) on 32-bit words using parameterized instruction sequences.
- Constructing the full SHA-256 computation as a composition of parameterized instruction sequences for each stage of the algorithm (message expansion, compression function).
- Using uniform algebraic terms to describe the instruction sequence for any input length N, ensuring modularity and scalability.
- Validating correctness by aligning the instruction sequence structure precisely with the NIST standard’s algorithmic description.
Experimental results
Research questions
- RQ1Can the SHA-256 hash function be formally and precisely described using only basic instruction sequence operations within program algebra?
- RQ2What is the exact instruction sequence size required to compute SHA-256 for inputs of arbitrary length N?
- RQ3How do instruction sequence size and computation time relate in this model, and is this relationship polynomial?
- RQ4Can the algebraic structure of PGA support the formal specification of complex cryptographic primitives like SHA-256 in a scalable and verifiable way?
- RQ5To what extent does this formalization enable new analyses of algorithmic complexity and equivalence in cryptographic algorithms?
Key findings
- The instruction sequence for SHA-256 restricted to N 32-bit words has a total length of 729,464·N + 1,025 instructions, derived from a precise structural breakdown of the algorithm’s stages.
- The model uses only basic operations—register setting, testing, forward jumps, and termination—proving that SHA-256 can be computed in a single-pass, finite instruction sequence with no recursion or complex control structures.
- The number of auxiliary registers used is constant at 2,945, independent of input length, indicating efficient state management.
- The maximum number of input registers required is 2^64, reflecting the theoretical upper bound on message length (up to 2^64 - 1 bits).
- The number of output registers is fixed at 256, corresponding to the 256-bit hash output.
- Results suggest that instruction sequence size and computation time are polynomially related in this model, supporting the use of size as a complexity measure for cryptographic algorithms.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.