def aes_mix_column
qasim-bend-kit@0.1.0.2 · libs/AES256GCMCore.bend:166
import qasim-bend-kit@0.1.0.2/libs/AES256GCMCore.bend as AES256GCMCore
import Base
166def aes_mix_column(col: AesColumn) -> AesColumn:
167 match col:
168 case AesColumn{+a, +b, +c, +d}:
169 AesColumn{
170 U32.xor(U32.xor(U32.xor(gf8_mul(a, 2), gf8_mul(b, 3)), c), d),
171 U32.xor(U32.xor(U32.xor(a, gf8_mul(b, 2)), gf8_mul(c, 3)), d),
172 U32.xor(U32.xor(U32.xor(a, b), gf8_mul(c, 2)), gf8_mul(d, 3)),
173 U32.xor(U32.xor(U32.xor(gf8_mul(a, 3), b), c), gf8_mul(d, 2))}