I want to find truth table and Algebraic Normal Form of a Maiorana McFarland type bent function with the support set. I do a sample function by hand from F4xF4 to F2 such that the Finite Field F4 is generated by the irreducible polynomial a2+a+1 so that a2=a+1.
F4xF4={(0,0),(0,1),(0,a),(0,a+1),(1,0),(1,1),(1,a),(1,a+1),(a,0),(a,1),(a,a),(a,a+1),(a+1,0),(a+1,1),(a+1,a),(a+1,a+1)}
Take the support set as S={(0,a+1),(1,a),(a,a+1),(a+1,0),(a+1,1),(a+1,a+1)}. I want to find the boolean function which has the support set S. The whole elements of F4xF4 and the corresponding elements of F42 and Truth Table results are given in table. 0=00, 1=01, a=10, a+1=11 [(0,0)(00,00)00000(0,1)(00,01)00010(0,a)(00,10)00100(0,a+1)(00,11)00111(1,0)(01,00)01000(1,1)(01,01)01010(1,a)(01,10)01101(1,a+1)(01,11)01110(a,0)(10,00)10000(a,1)(10,01)100010(a,a)(10,10)10100(a,a+1)(10,11)10111(a+1,0)(11,00)11001(a+1,1) (11,01)11011(a+1,a)(11,10)11100(a+1,a+1) (11,11)11111] By the truth table, I can find whether this function is bent or not with the codes below:
from sage.crypto.boolean_function import BooleanFunction
B = BooleanFunction([0,0,0,1,0,0,1,0,0,0,0,1,1,1,0,1])
P = B.algebraic_normal_form()
print (P)
f = BooleanFunction(P)
print ("Bent :", f.is_bent())
The problem is how I can get the truth table if I have the support set of a function from F64xF64 to F2.
FF=FiniteField(64,"a")
a=FF.gen()
tr= [a, a^2, a^4, a^5, a^5 + a^4 + a^2 + a + 1, a^5 + a^4 + 1, a^4 + a + 1, a^5 + a^2 + a, a^2 + a + 1, a^5 + a^4 + a^2, a^5 + a^4 + a, a^5 + a^2 + 1, a^4 + a^2 + 1, a^5 + a + 1, a^4 + a^2 + a, 1, a^3, a^5 + a^3 + 1, a^3 + a^2 + a, a^4 + a^3 + a^2, a^5 + a^4 + a^3, a^3 + a^2 + 1, a^4 + a^3 + a, a^5 + a^4 + a^3 + a^2 + 1, a^4 + a^3 + 1, a^4 + a^3 + a^2 + a + 1, a^5 + a^4 + a^3 + a^2 + a, a^5 + a^3 + a, a^5 + a^3 + a^2 + a + 1, a^3 + a + 1, a^5 + a^3 + a^2, a^5 + a^4 + a^3 + a + 1]
FF=[x for x in FF]
U_s=[]
for s in tr:
for x in FF:
if x!=0:
U_s.append([(x,s*x^5) for x in FF])
I generated the support set U_s in F64xF64 . How can I find the truth table of the corresponding function?
Thanks in advance.