~/bend-docscommunity

check.bend checks

raw source on the hub · import bend-osdev-mode-core@0.1.0.0/check.bend as Check

mode-core on its own: a block's hex and byte forms, XOR, the round-trip hypothesis over a toy permutation, and the refusal of a byte string that is not 16 bytes. The modes' own packages test the modes.

3 imports
import Base
import bend-osdev-bytes@0.1.1.0/bytes.bend as B
import ./mode_core.bend as M

Definitions

def toy.rot source · line 13 · raw

@b:0x999adc34209a88c2495b3a5407a5ad25/mode_core.CmBlock -> 0x999adc34209a88c2495b3a5407a5ad25/mode_core.CmBlock

A toy permutation of blocks, NOT a cipher: the words rotated, then XOR with the key block. Enough to run the mode's code paths (encryption and decryption differ, so mixing them up shows); the mode is tested against its specification over AES in bend-osdev-aes-modes (the specifications' vectors) and in ref/ (against Python's cryptography).

def toy.unrot source · line 18 · raw

@b:0x999adc34209a88c2495b3a5407a5ad25/mode_core.CmBlock -> 0x999adc34209a88c2495b3a5407a5ad25/mode_core.CmBlock

def toy.enc source · line 23 · raw

@k:0x999adc34209a88c2495b3a5407a5ad25/mode_core.CmBlock -> @b:0x999adc34209a88c2495b3a5407a5ad25/mode_core.CmBlock -> 0x999adc34209a88c2495b3a5407a5ad25/mode_core.CmBlock

def toy.dec source · line 26 · raw

@k:0x999adc34209a88c2495b3a5407a5ad25/mode_core.CmBlock -> @c:0x999adc34209a88c2495b3a5407a5ad25/mode_core.CmBlock -> 0x999adc34209a88c2495b3a5407a5ad25/mode_core.CmBlock

def key source · line 29 · raw

0x999adc34209a88c2495b3a5407a5ad25/mode_core.CmBlock

def key2 source · line 32 · raw

0x999adc34209a88c2495b3a5407a5ad25/mode_core.CmBlock

def hexs source · line 35 · raw

@bs:List<&2, 0x999adc34209a88c2495b3a5407a5ad25/mode_core.CmBlock> -> String

def maybe source · line 42 · raw

@m:Maybe<&2, 0x999adc34209a88c2495b3a5407a5ad25/mode_core.CmBlock> -> String

def main source · line 49 · raw

IO(Unit)