def CmBlock.of_octets

bend-osdev-mode-core@0.1.0.0 · mode_core.bend:304

import bend-osdev-mode-core@0.1.0.0/mode_core.bend as ModeCore
import Base
import bend-osdev-bytes@0.1.1.0/bytes.bend as B

304# a 16-byte string as a block; None for any other length
305def CmBlock.of_octets(o: B.Octets) -> Maybe<&2, CmBlock>:
306  +xs = B.Octets.to_list(o)
307  CmBlock.of_octets.pick(Nat.is_eq(B.len(xs), 16n), xs)

Uses (7)

Used by (2)