/* Global assumption:
E<e> := GF(2,6);
V6 := VectorSpace(GF(2), 6);
V24 := VectorSpace(GF(2), 24); */

RoundInv := function(a, unlambda, k)

  a := a + k;
  a := Divide(a,4);
  a := Matrix(E, 1, 4, [Vector2Element(a[1]),
Vector2Element(a[2]), Vector2Element(a[3]),
Vector2Element(a[4])]);
  a := E4!(a * unlambda);
  a := SBinv(a);
  a := Matrix(GF(2), 4, 6, [Element2Vector(a[1][1]),
Element2Vector(a[1][2]), Element2Vector(a[1][3]),
Element2Vector(a[1][4])]);
  a := V24!Join(a);
  
  return a;
end function;