law unpack_get_i

lawful-bytes@0.1.1.0 · proof_core.bend:126

import lawful-bytes@0.1.1.0/proof_core.bend as ProofCore
import Base
import lawful-bytes@0.1.1.0/defs.bend as D

126# The same for a U32 index: word i >> 2, byte i & 3.
127law unpack_get_i:
128  for +ws: List<&2, U32>
129  for +i: U32
130  {List.get(&2, U32, D.unpack(ws), U32.to_nat(i)) == mb(List.get(&2, U32, ws, U32.to_nat((i >> 2n : U32))), U32.to_nat((i .&. 3 : U32))) : Maybe<&2, U32>}

Uses (16)

Used by (1)