def lane_bytes

bend-collections-laws-crypto@1.0.0.0 · spec/crypto/sha3.bend:93

import bend-collections-laws-crypto@1.0.0.0/spec/crypto/sha3.bend as Sha3
import Base
import bend-collections-laws-crypto@1.0.0.0/src/crypto/keccak/types.bend as T

93# Section 4, steps 7-10: d = 256 <= r, so Z is the first 32 bytes of S.
94def lane_bytes(l: T.Lane) -> List<&2, U32>:
95  match l:
96    case T.W{+lo, +hi}:
97      [U32.and(lo, 255), U32.and(U32.shrn(lo, 8n), 255), U32.and(U32.shrn(lo, 16n), 255), U32.shrn(lo, 24n),
98       U32.and(hi, 255), U32.and(U32.shrn(hi, 8n), 255), U32.and(U32.shrn(hi, 16n), 255), U32.shrn(hi, 24n)]

Uses (5)

Used by (1)