xts.bend checks
raw source on the hub · import bend-osdev-cipher-modes@0.1.0.0/xts.bend as Xts
XTS (IEEE Std 1619-2007, XTS-AES; NIST SP 800-38E), the tweakable mode for storage, over any 128-bit block cipher (see cipher-modes.bend for the template arguments). A data unit (a sector) is encrypted under two keys: k1 for the data and k2 for the tweak. With i the data unit's 128-bit sequence number, as 16 little-endian bytes: T_0 = E(k2, i), T_(j+1) = T_j * alpha (in GF(2^128), below) C_j = E(k1, P_j xor T_j) xor T_j A data unit of at least 16 bytes whose length is not a multiple of 16 ends with ciphertext stealing (IEEE 1619, 5.3.2): the last full block's ciphertext lends its tail to pad the partial block.
4 imports
import Base import bend-osdev-bytes@0.1.0.0/bytes.bend as B import bend-osdev-word64@0.1.0.0/word64.bend as W import ./cipher_modes.bend as M
Definitions
def xts.shift source · line 22 · raw
@+w:U32 -> U32
each byte of w shifted left, with the carries between w's own bytes
def xts.carry source · line 26 · raw
@w:U32 -> U32
the carry out of w's last byte, into the first byte of the next word
def Xts.mul_alpha source · line 29 · raw
@t:0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmBlock -> 0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmBlock
def Xts.sector source · line 94 · raw
@n:0x44cf1401f78136bfc15c4c5be1cd20f0/word64.W64 -> 0x9df7f91779a4a1c215bfa96cd0864601/bytes.Octets
the 16-byte sequence number of data unit n (a sector number): n in little-endian order, then zeros
def xts.alpha_n source · line 104 · raw
@n:Nat -> @+t:0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmBlock -> 0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmBlock
T_0 * alpha^n
def xts.init source · line 146 · raw
@rest:List<&2, 0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmBlock> -> @p:0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmBlock -> List<&2, 0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmBlock>
all but the last of p then rest; and the last
def xts.last source · line 153 · raw
@rest:List<&2, 0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmBlock> -> @p:0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmBlock -> 0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmBlock
def xts.init.go source · line 215 · raw
@rest:List<&2, 0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmBlock> -> @p:0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmBlock -> @acc:List<&2, 0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmBlock> -> List<&2, 0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmBlock>
def xts.init.fast source · line 222 · raw
@rest:List<&2, 0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmBlock> -> @p:0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmBlock -> List<&2, 0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmBlock>
Templates
template xts.benc source · line 36 · raw
@-K:Data -> @-enc:(@_:K -> @_:0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmBlock -> 0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmBlock) -> @+k:K -> @p:0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmBlock -> @+t:0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmBlock -> 0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmBlock
template xts.bdec source · line 39 · raw
@-K:Data -> @-dec:(@_:K -> @_:0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmBlock -> 0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmBlock) -> @+k:K -> @c:0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmBlock -> @+t:0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmBlock -> 0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmBlock
template xts.enc source · line 44 · raw
@-K:Data -> @-enc:(@_:K -> @_:0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmBlock -> 0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmBlock) -> @+k:K -> @bs:List<&2, 0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmBlock> -> @+t:0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmBlock -> List<&2, 0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmBlock>
template xts.dec source · line 51 · raw
@-K:Data -> @-dec:(@_:K -> @_:0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmBlock -> 0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmBlock) -> @+k:K -> @bs:List<&2, 0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmBlock> -> @+t:0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmBlock -> List<&2, 0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmBlock>
template xts.enc.go source · line 62 · raw
@-K:Data -> @-enc:(@_:K -> @_:0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmBlock -> 0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmBlock) -> @+k:K -> @bs:List<&2, 0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmBlock> -> @+t:0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmBlock -> @acc:List<&2, 0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmBlock> -> List<&2, 0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmBlock>
template xts.enc.fast source · line 69 · raw
@-K:Data -> @-enc:(@_:K -> @_:0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmBlock -> 0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmBlock) -> @+k:K -> @bs:List<&2, 0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmBlock> -> @+t:0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmBlock -> List<&2, 0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmBlock>
template xts.dec.go source · line 72 · raw
@-K:Data -> @-dec:(@_:K -> @_:0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmBlock -> 0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmBlock) -> @+k:K -> @bs:List<&2, 0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmBlock> -> @+t:0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmBlock -> @acc:List<&2, 0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmBlock> -> List<&2, 0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmBlock>
template xts.dec.fast source · line 79 · raw
@-K:Data -> @-dec:(@_:K -> @_:0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmBlock -> 0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmBlock) -> @+k:K -> @bs:List<&2, 0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmBlock> -> @+t:0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmBlock -> List<&2, 0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmBlock>
template Xts.encrypt_blocks source · line 82 · raw
@-K:Data -> @-enc:(@_:K -> @_:0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmBlock -> 0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmBlock) -> @+k1:K -> @t:0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmBlock -> @bs:List<&2, 0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmBlock> -> List<&2, 0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmBlock>
template Xts.decrypt_blocks source · line 85 · raw
@-K:Data -> @-dec:(@_:K -> @_:0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmBlock -> 0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmBlock) -> @+k1:K -> @t:0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmBlock -> @bs:List<&2, 0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmBlock> -> List<&2, 0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmBlock>
template Xts.tweak source · line 89 · raw
@-K:Data -> @-enc:(@_:K -> @_:0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmBlock -> 0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmBlock) -> @+k2:K -> @i:0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmBlock -> 0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmBlock
T_0: the encrypted sequence number
template xts.steal_c.go source · line 111 · raw
@-K:Data -> @-enc:(@_:K -> @_:0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmBlock -> 0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmBlock) -> @partial:Bool -> @+k:K -> @p:0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmBlock -> @+tail:List<&2, U32> -> @+t:0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmBlock -> 0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmBlock
template xts.steal_t.go source · line 119 · raw
@-K:Data -> @-enc:(@_:K -> @_:0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmBlock -> 0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmBlock) -> @partial:Bool -> @+k:K -> @p:0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmBlock -> @+tail:List<&2, U32> -> @+t:0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmBlock -> List<&2, U32>
template xts.steal_c source · line 127 · raw
@-K:Data -> @-enc:(@_:K -> @_:0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmBlock -> 0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmBlock) -> @+k:K -> @p:0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmBlock -> @+tail:List<&2, U32> -> @+t:0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmBlock -> 0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmBlock
the ciphertext of the last whole block p and the tail, under tweak t
template xts.steal_t source · line 130 · raw
@-K:Data -> @-enc:(@_:K -> @_:0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmBlock -> 0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmBlock) -> @+k:K -> @p:0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmBlock -> @+tail:List<&2, U32> -> @+t:0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmBlock -> List<&2, U32>
template xts.dsteal.go source · line 134 · raw
@-K:Data -> @-dec:(@_:K -> @_:0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmBlock -> 0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmBlock) -> @partial:Bool -> @+k:K -> @c:0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmBlock -> @+tail:List<&2, U32> -> @+t:0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmBlock -> List<&2, U32>
the plaintext of the last whole ciphertext block c and the tail
template xts.dsteal source · line 142 · raw
@-K:Data -> @-dec:(@_:K -> @_:0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmBlock -> 0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmBlock) -> @+k:K -> @c:0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmBlock -> @+tail:List<&2, U32> -> @+t:0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmBlock -> List<&2, U32>
template xts.eout source · line 160 · raw
@-K:Data -> @-enc:(@_:K -> @_:0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmBlock -> 0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmBlock) -> @+k:K -> @+t:0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmBlock -> @+init:List<&2, 0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmBlock> -> @+last:0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmBlock -> @+tail:List<&2, U32> -> List<&2, U32>
template xts.dout source · line 164 · raw
@-K:Data -> @-dec:(@_:K -> @_:0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmBlock -> 0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmBlock) -> @+k:K -> @+t:0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmBlock -> @+init:List<&2, 0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmBlock> -> @+last:0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmBlock -> @+tail:List<&2, U32> -> List<&2, U32>
template xts.e2 source · line 167 · raw
@-K:Data -> @-enc:(@_:K -> @_:0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmBlock -> 0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmBlock) -> @+k:K -> @+t:0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmBlock -> @s:0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmSplit -> @+n:Nat -> Result<&2, &2, 0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmError, 0x9df7f91779a4a1c215bfa96cd0864601/bytes.Octets>
template xts.d2 source · line 176 · raw
@-K:Data -> @-dec:(@_:K -> @_:0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmBlock -> 0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmBlock) -> @+k:K -> @+t:0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmBlock -> @s:0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmSplit -> @+n:Nat -> Result<&2, &2, 0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmError, 0x9df7f91779a4a1c215bfa96cd0864601/bytes.Octets>
template xts.e1 source · line 185 · raw
@-K:Data -> @-enc:(@_:K -> @_:0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmBlock -> 0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmBlock) -> @+k:K -> @r:Result<&2, &2, 0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmError, 0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmBlock> -> @+xs:List<&2, U32> -> Result<&2, &2, 0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmError, 0x9df7f91779a4a1c215bfa96cd0864601/bytes.Octets>
template xts.d1 source · line 192 · raw
@-K:Data -> @-dec:(@_:K -> @_:0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmBlock -> 0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmBlock) -> @+k:K -> @r:Result<&2, &2, 0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmError, 0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmBlock> -> @+xs:List<&2, U32> -> Result<&2, &2, 0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmError, 0x9df7f91779a4a1c215bfa96cd0864601/bytes.Octets>
template xts.tweak.go source · line 199 · raw
@-K:Data -> @-enc:(@_:K -> @_:0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmBlock -> 0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmBlock) -> @+k2:K -> @r:Result<&2, &2, 0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmError, 0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmBlock> -> Result<&2, &2, 0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmError, 0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmBlock>
template xts.tweak source · line 207 · raw
@-K:Data -> @-enc:(@_:K -> @_:0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmBlock -> 0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmBlock) -> @+k2:K -> @i:0x9df7f91779a4a1c215bfa96cd0864601/bytes.Octets -> Result<&2, &2, 0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmError, 0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmBlock>
T_0, from the 16-byte sequence number i
template xts.eout.fast source · line 225 · raw
@-K:Data -> @-enc:(@_:K -> @_:0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmBlock -> 0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmBlock) -> @+k:K -> @+t:0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmBlock -> @+init:List<&2, 0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmBlock> -> @+last:0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmBlock -> @+tail:List<&2, U32> -> List<&2, U32>
template xts.dout.fast source · line 229 · raw
@-K:Data -> @-dec:(@_:K -> @_:0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmBlock -> 0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmBlock) -> @+k:K -> @+t:0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmBlock -> @+init:List<&2, 0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmBlock> -> @+last:0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmBlock -> @+tail:List<&2, U32> -> List<&2, U32>
template xts.e2.fast source · line 232 · raw
@-K:Data -> @-enc:(@_:K -> @_:0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmBlock -> 0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmBlock) -> @+k:K -> @+t:0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmBlock -> @s:0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmSplit -> @+n:Nat -> Result<&2, &2, 0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmError, 0x9df7f91779a4a1c215bfa96cd0864601/bytes.Octets>
template xts.d2.fast source · line 241 · raw
@-K:Data -> @-dec:(@_:K -> @_:0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmBlock -> 0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmBlock) -> @+k:K -> @+t:0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmBlock -> @s:0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmSplit -> @+n:Nat -> Result<&2, &2, 0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmError, 0x9df7f91779a4a1c215bfa96cd0864601/bytes.Octets>
template xts.e1.fast source · line 250 · raw
@-K:Data -> @-enc:(@_:K -> @_:0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmBlock -> 0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmBlock) -> @+k:K -> @r:Result<&2, &2, 0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmError, 0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmBlock> -> @+xs:List<&2, U32> -> Result<&2, &2, 0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmError, 0x9df7f91779a4a1c215bfa96cd0864601/bytes.Octets>
template xts.d1.fast source · line 257 · raw
@-K:Data -> @-dec:(@_:K -> @_:0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmBlock -> 0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmBlock) -> @+k:K -> @r:Result<&2, &2, 0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmError, 0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmBlock> -> @+xs:List<&2, U32> -> Result<&2, &2, 0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmError, 0x9df7f91779a4a1c215bfa96cd0864601/bytes.Octets>
template Xts.encrypt.ref source · line 266 · raw
@-K:Data -> @-enc:(@_:K -> @_:0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmBlock -> 0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmBlock) -> @+k1:K -> @+k2:K -> @i:0x9df7f91779a4a1c215bfa96cd0864601/bytes.Octets -> @p:0x9df7f91779a4a1c215bfa96cd0864601/bytes.Octets -> Result<&2, &2, 0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmError, 0x9df7f91779a4a1c215bfa96cd0864601/bytes.Octets>
Xts.encrypt and Xts.decrypt through the structural forms (the laws' proofs reason about these; PROOF.bend proves them equal to the public defs)
template Xts.decrypt.ref source · line 269 · raw
@-K:Data -> @-enc:(@_:K -> @_:0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmBlock -> 0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmBlock) -> @-dec:(@_:K -> @_:0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmBlock -> 0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmBlock) -> @+k1:K -> @+k2:K -> @i:0x9df7f91779a4a1c215bfa96cd0864601/bytes.Octets -> @c:0x9df7f91779a4a1c215bfa96cd0864601/bytes.Octets -> Result<&2, &2, 0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmError, 0x9df7f91779a4a1c215bfa96cd0864601/bytes.Octets>
template Xts.encrypt source · line 273 · raw
@-K:Data -> @-enc:(@_:K -> @_:0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmBlock -> 0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmBlock) -> @+k1:K -> @+k2:K -> @i:0x9df7f91779a4a1c215bfa96cd0864601/bytes.Octets -> @p:0x9df7f91779a4a1c215bfa96cd0864601/bytes.Octets -> Result<&2, &2, 0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmError, 0x9df7f91779a4a1c215bfa96cd0864601/bytes.Octets>
the data unit p (at least 16 bytes) with sequence number i (16 bytes)
template Xts.decrypt source · line 277 · raw
@-K:Data -> @-enc:(@_:K -> @_:0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmBlock -> 0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmBlock) -> @-dec:(@_:K -> @_:0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmBlock -> 0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmBlock) -> @+k1:K -> @+k2:K -> @i:0x9df7f91779a4a1c215bfa96cd0864601/bytes.Octets -> @c:0x9df7f91779a4a1c215bfa96cd0864601/bytes.Octets -> Result<&2, &2, 0xf4b936e0e6b2608080d2f02bb3ce9abe/cipher_modes.CmError, 0x9df7f91779a4a1c215bfa96cd0864601/bytes.Octets>
decryption needs enc too: the tweak is always encrypted