def xts.tweak
import bend-osdev-cipher-modes@0.1.0.0/xts.bend as Xtsimport Base
import bend-osdev-bytes@0.1.0.0/bytes.bend as B
import bend-osdev-cipher-modes@0.1.0.0/cipher_modes.bend as M
206# T_0, from the 16-byte sequence number i
207def xts.tweak(~K: Data, ~enc: K -> M.CmBlock -> M.CmBlock, +k2: K, i: B.Octets) -> Result<&2, &2, M.CmError, M.CmBlock>:
208 +xs = B.Octets.to_list(i)
209 xts.tweak.go(~K, ~enc, k2, M.cm.need_block(xs, M.CmBadTweakLength{B.len(xs)}))