def byte_bits

bend-collections-laws-crypto@1.0.0.0 · spec/crypto/aes/gcm.bend:13

import bend-collections-laws-crypto@1.0.0.0/spec/crypto/aes/gcm.bend as Gcm
import Base

13# The bits of a byte, the most significant (leftmost) first.
14def byte_bits(x: U32) -> List<&2, Bool>:
15  match x:
16    case U32{WCon{b0, WCon{b1, WCon{b2, WCon{b3, WCon{b4, WCon{b5, WCon{b6, WCon{b7, rest}}}}}}}}}:
17      [b7, b6, b5, b4, b3, b2, b1, b0]

Uses (4)

Used by (3)