Conformance.Builtin.Semantics.Sha2256

Conformance tests generated from plutus-conformance/test-cases/uplc/evaluation/builtin/semantics/sha2_256. See Conformance.Eval for how they are run.

module Conformance.Builtin.Semantics.Sha2256 where

open import Conformance.Eval

sha2_256-empty

-- builtin/semantics/sha2_256/sha2_256-empty
-- Test vector (0-bit input) from SHA256ShortMessage.rsp in
-- https://csrc.nist.gov/CSRC/media/Projects/Cryptographic-Algorithm-Validation-Program/documents/shs/shabytetestvectors.zip
test-sha2-256-empty : Untyped
test-sha2-256-empty = (UApp (UApp (UBuiltin equalsByteString) (UApp (UBuiltin sha2-256) (UCon (tagCon bytestring (mkByteString ""))))) (UCon (tagCon bytestring (mkByteString "\227\176\196B\152\252\FS\DC4\154\251\244\200\153o\185$'\174A\228d\155\147L\164\149\153\ESCxR\184U"))))

expected-sha2-256-empty : Result
expected-sha2-256-empty = success (UCon (tagCon bool true))

-- Pending: bytestring constant; postulated builtin `equalsByteString`; postulated builtin `sha2-256`.
pending-sha2-256-empty : Set
pending-sha2-256-empty = Pending (evalRaw test-sha2-256-empty ≡ expected-sha2-256-empty)

sha2_256-length-200

-- builtin/semantics/sha2_256/sha2_256-length-200
-- Test vector (200-bit input) from SHA256ShortMessage.rsp in
-- https://csrc.nist.gov/CSRC/media/Projects/Cryptographic-Algorithm-Validation-Program/documents/shs/shabytetestvectors.zip
test-sha2-256-length-200 : Untyped
test-sha2-256-length-200 = (UApp (UApp (UBuiltin equalsByteString) (UApp (UBuiltin sha2-256) (UCon (tagCon bytestring (mkByteString ".~\168M\164\188M|\251F>?,\134G\ENQz\255\243\251\236\236\161\210\NUL"))))) (UCon (tagCon bytestring (mkByteString "v\227\172\188q\136\&6\242\223\138\210\208\210\215o\f\250_\234\t\134\190\145\143\DLE\188\238s\r\244A\185"))))

expected-sha2-256-length-200 : Result
expected-sha2-256-length-200 = success (UCon (tagCon bool true))

-- Pending: bytestring constant; postulated builtin `equalsByteString`; postulated builtin `sha2-256`.
pending-sha2-256-length-200 : Set
pending-sha2-256-length-200 = Pending (evalRaw test-sha2-256-length-200 ≡ expected-sha2-256-length-200)