Skip to main content
. 2019 Feb 10;19(3):720. doi: 10.3390/s19030720
Algorithm 3 Itoh-Tsujii Inversion for Generic Binary Fields Where Extra Storage is Used.
Input:A(x)F2m, U=u0,u1,ur1 the binary representation of m, f(x) the irreducible polynomial of F2m
Output: C(x)=A1(x)modf(x)
C(x)A(x)
for i=0 to r1 do
  B(x)C(x)
  for j=0 to 2i do
   B(x)B2(x)modf(x)
  end for
  C(x)C(x)B(x)modf(x)
  Di(x)C(x)
end for
for i=r2 to 1 do
  if ui=1 then
   B(x)C(x)
   for j=0 to 2i do
    B(x)B2(x)modf(x)
   end for
   C(x)C(x)Di(x)modf(x)
  end if
end for
C(x)C2(x)modf(x)

return C(x)