~/bend-docscommunity

inst_sha3.bend checks

raw source on the hub · import bend-osdev-crypto@0.1.0.0/inst_sha3.bend as Inst_sha3

SHA3-256 (FIPS 202) as a hash: bend-collections' SHA3-256, adapted to Octets, as inst_sha2.bend adapts SHA-256 and SHA-512. The code is bend-collections@1.0.0.0's src/crypto (hash.bend and the keccak and sha3 files it imports), imported from bend-collections-laws-crypto@1.0.0.0, which ships the same files with their proofs (Split.sha3_256, Incremental.sha3_256, Sha3_256.length, Sha3_256.value); LAWS.bend cites them. The state is wrapped in CrSha3State, and bytes cross as Octets.

The instance (block size 136 bytes, the SHA3-256 rate, which is HMAC's B for SHA3-256; digest 32): ~CrSha3State, ~136n, ~32n, ~CrSha3.init(), ~CrSha3.update, ~CrSha3.final, ~CrSha3.sha3_256

3 imports
import Base
import bend-osdev-bytes@0.1.0.0/bytes.bend as B
import bend-collections-laws-crypto@1.0.0.0/src/crypto/hash.bend as Hc

Types

type CrSha3State source · line 19 · raw

Data

A hash state (opaque): the Keccak state, the bytes of the unfinished block, and the length so far

Definitions

def CrSha3.init source · line 22 · raw

CrSha3State

def CrSha3.update source · line 26 · raw

@s:CrSha3State -> @o:0x9df7f91779a4a1c215bfa96cd0864601/bytes.Octets -> CrSha3State

the state after more bytes

def CrSha3.final source · line 32 · raw

@s:CrSha3State -> 0x9df7f91779a4a1c215bfa96cd0864601/bytes.Octets

the digest of the bytes so far

def CrSha3.sha3_256 source · line 38 · raw

@o:0x9df7f91779a4a1c215bfa96cd0864601/bytes.Octets -> 0x9df7f91779a4a1c215bfa96cd0864601/bytes.Octets

the digest in one call