def aria.ops

bend-osdev-legacy-ciphers@0.1.0.0 · aria.bend:4556

import bend-osdev-legacy-ciphers@0.1.0.0/aria.bend as Aria
import Base
import bend-osdev-cipher-modes@0.1.0.0/cipher_modes.bend as M

4556# the steps of the rounds from round i (odd True for odd rounds), n rounds
4557# but the last left, round keys eks
4558def aria.ops(n: Nat, eks: List<&2, M.CmBlock>, odd: Bool) -> List<&2, LcAriaOp>:
4559  match n eks:
4560    case 0n Con{k1, Con{k2, rest}}:
4561      [LcAriaRk{k1}, LcAriaSl2{}, LcAriaRk{k2}]
4562    case 1n+p Con{k, rest}:
4563      match odd:
4564        case True{}:
4565          Con{LcAriaRk{k}, Con{LcAriaSl1{}, Con{LcAriaDiff{}, aria.ops(p, rest, False{})}}}
4566        case False{}:
4567          Con{LcAriaRk{k}, Con{LcAriaSl2{}, Con{LcAriaDiff{}, aria.ops(p, rest, True{})}}}
4568    case _ _:
4569      Nil{}

Uses (5)

Used by (1)