def c6.w

bend-osdev-legacy-ciphers@0.1.0.0 · cast6.bend:122

import bend-osdev-legacy-ciphers@0.1.0.0/cast6.bend as Cast6
import Base
import bend-osdev-legacy-ciphers@0.1.0.0/legacy_ciphers.bend as L
import bend-osdev-legacy-ciphers@0.1.0.0/cast5.bend as C5

122# one step of an octave: word dst ^= f_ty(word src), with the next Tm, Tr
123def c6.w(+t: C5.LcCastTabs, ty: C5.LcCastTy, +dst: Nat, src: Nat, st: LcCast6Kst) -> LcCast6Kst:
124  match st:
125    case LcCast6Kst{+k, +cm, +cr}:
126      LcCast6Kst{c6.set(k, dst, U32.xor(L.lc.at(k, dst), C5.cast.f(ty, t, L.lc.at(k, src), cm, cr))), U32.add(cm, 1859775393), U32.and(31, U32.add(cr, 17))}

Uses (10)

Used by (1)