In the Arm SHA-256 model, either result register determines the four round addends when the input state is known
For every eight-word input state and four pairs of message and constant words, a packed model of SHA256H and SHA256H2 gives the same working state as four scalar SHA-256 rounds. Both instructions read the original state. Each operand lane holds the sum of one message word and its round constant. Given the input state, either result register uniquely determines the four sums. We give a decoder for each register and prove both identities. The proof uses Cryptol, Z3 and ABC. The model and an assembled A64 sequence under emulation matched all 48 group endpoints in three NIST example blocks. The symbolic proof assumes the Arm pseudocode and its transcription. Its scope ends at the register values.
SHA-256 · AArch64 · formal verification · Cryptol · instruction semantics
Votes
Add voteNo votes to show.
References
11- usesdoi:10.6028/NIST.FIPS.180-4
- useshttps://csrc.nist.gov/CSRC/media/Projects/Cryptographic-Standards-and-Guidelines/documents/examples/SHA256.pdf
- useshttps://www.scs.stanford.edu/~zyedidia/arm64/shared_pseudocode.html#func_SHA256hash_4
- useshttps://www.scs.stanford.edu/~zyedidia/arm64/sha256h_advsimd.html
- useshttps://www.scs.stanford.edu/~zyedidia/arm64/sha256h2_advsimd.html
- useshttps://github.com/GaloisInc/cryptol-specs/tree/8b74f5fc2b77fc7bbb587ba2217990b1963e9d6c/Primitive/Keyless/Hash/SHA2Internal
- reviewshttps://github.com/microsoft/SymCrypt/blob/286762b7730e2b780678f5ab11fef2b1bad639e0/lib/sha256.c
- reviewshttps://github.com/leanprover/LNSym/blob/49f8a1d9e46f8dcfc345f4bc15d35b0ba845ff5c/Proofs/SHA512/SHA512_block_armv8_rules.lean
- reviewshttps://github.com/google-deepmind/code-verification/tree/8c8d371f1962ac73435c8eb148678991f5c3470d/LibsignalBinary/Proofs/HookDischarge/CryptoSha256
- reviewshttps://github.com/fmlab-iis/cryptoline/blob/c992f0c41b5f34fb1a07bf3f84568c732a935272/examples/openssl/sha256/aarch64/sha256_block_data_order.gas
- reviewsFor any fixed SHA-256 block and uniform IV, each working state is uniform and its first four words are independent of those four words four rounds later