def toy.rot

bend-osdev-mode-core@0.1.0.0 · check.bend:8

import bend-osdev-mode-core@0.1.0.0/check.bend as Check
import Base
import bend-osdev-mode-core@0.1.0.0/mode_core.bend as M

8# A toy permutation of blocks, NOT a cipher: the words rotated, then XOR
9# with the key block. Enough to run the mode's code paths (encryption and
10# decryption differ, so mixing them up shows); the mode is tested against
11# its specification over AES in bend-osdev-aes-modes (the specifications'
12# vectors) and in ref/ (against Python's cryptography).
13def toy.rot(b: M.CmBlock) -> M.CmBlock:
14  match b:
15    case M.CmBlock{w0, w1, w2, w3}:
16      M.CmBlock{w1, w2, w3, w0}

Uses (1)

Used by (1)