check.bend checks
raw source on the hub · import bend-osdev-cast5@0.1.0.0/check.bend as Check
CAST-128: RFC 2144 B.1's three vectors, both ways (the ciphertext, then the plaintext decrypted back), and CAST-128 through modes64.bend's CBC over 16 KB both ways.
5 imports
import Base import bend-osdev-bytes@0.1.1.0/bytes.bend as B import bend-osdev-cipher-core@0.1.0.0/cipher_core.bend as L import bend-osdev-cipher-core@0.1.0.0/modes64.bend as X import ./cast5.bend as C5
Definitions
def err source · line 10 · raw
@e:0x5c26418ab13c9e565c5b1309d2f085a0/cipher_core.LcError -> String
def b64.of source · line 19 · raw
@m:Maybe<&2, 0x5c26418ab13c9e565c5b1309d2f085a0/cipher_core.LcBlock64> -> 0x5c26418ab13c9e565c5b1309d2f085a0/cipher_core.LcBlock64
def b64 source · line 26 · raw
@o:0xe0217e1ab38629fddf738452c1f2a82e/bytes.Octets -> 0x5c26418ab13c9e565c5b1309d2f085a0/cipher_core.LcBlock64
def cast5_key source · line 40 · raw
@k:0xe0217e1ab38629fddf738452c1f2a82e/bytes.Octets -> 0x09727f2e3edd91028d60228469c8929b/cast5.LcCast5Key
def cast5 source · line 43 · raw
@k:0xe0217e1ab38629fddf738452c1f2a82e/bytes.Octets -> @b:0xe0217e1ab38629fddf738452c1f2a82e/bytes.Octets -> String
def big.go source · line 47 · raw
@n:Nat -> @+i:U32 -> @acc:List<&2, U32> -> List<&2, U32>
n bytes, byte i = 7i + 3 (mod 256)
def big source · line 54 · raw
@n:Nat -> 0xe0217e1ab38629fddf738452c1f2a82e/bytes.Octets
def verdict source · line 57 · raw
@b:Bool -> String
def last8 source · line 64 · raw
@r:Result<&2, &2, 0x5c26418ab13c9e565c5b1309d2f085a0/cipher_core.LcError, 0xe0217e1ab38629fddf738452c1f2a82e/bytes.Octets> -> String
def same64 source · line 71 · raw
@r:Result<&2, &2, 0x5c26418ab13c9e565c5b1309d2f085a0/cipher_core.LcError, 0xe0217e1ab38629fddf738452c1f2a82e/bytes.Octets> -> @+m:0xe0217e1ab38629fddf738452c1f2a82e/bytes.Octets -> String
def cast5_cbc source · line 83 · raw
@k:0xe0217e1ab38629fddf738452c1f2a82e/bytes.Octets -> @n:Nat -> String
def main source · line 87 · raw
IO(Unit)
BEGIN GENERATED by gen/vectors.py: check
Templates
template key source · line 29 · raw
@-K:Data -> @r:Result<&2, &2, 0x5c26418ab13c9e565c5b1309d2f085a0/cipher_core.LcError, K> -> @d:K -> K
template both64 source · line 36 · raw
@-K:Data -> @-enc:(@_:K -> @_:0x5c26418ab13c9e565c5b1309d2f085a0/cipher_core.LcBlock64 -> 0x5c26418ab13c9e565c5b1309d2f085a0/cipher_core.LcBlock64) -> @-dec:(@_:K -> @_:0x5c26418ab13c9e565c5b1309d2f085a0/cipher_core.LcBlock64 -> 0x5c26418ab13c9e565c5b1309d2f085a0/cipher_core.LcBlock64) -> @+k:K -> @b:0x5c26418ab13c9e565c5b1309d2f085a0/cipher_core.LcBlock64 -> String
template cbc64 source · line 78 · raw
@-K:Data -> @-enc:(@_:K -> @_:0x5c26418ab13c9e565c5b1309d2f085a0/cipher_core.LcBlock64 -> 0x5c26418ab13c9e565c5b1309d2f085a0/cipher_core.LcBlock64) -> @-dec:(@_:K -> @_:0x5c26418ab13c9e565c5b1309d2f085a0/cipher_core.LcBlock64 -> 0x5c26418ab13c9e565c5b1309d2f085a0/cipher_core.LcBlock64) -> @+k:K -> @n:Nat -> String