src/crypto/sha3/sha3_256.bend
1import Base
2import bend-collections@1.0.0.0/src/crypto/sha3/core.bend as Core
3
4# SHA3-256 (FIPS 202) on the Keccak-f[1600] permutation of src/crypto/keccak.
5# It differs from Ethereum's Keccak-256 (src/crypto/keccak/keccak.bend) only in
6# the domain padding: SHA-3 appends 0x06 where Keccak-256 appends 0x01.
7# Bytes are U32 values, each < 256; the digest is 32 bytes. Proved equal to
8# spec/crypto/sha3.bend for every input: proofs/crypto/sha3/laws.bend.
9def sha3_256(bytes: List<&2, U32>) -> List<&2, U32>:
10 Core.sha3_256(bytes)