>From the doc of .algebrais_immunity :

   Returns the algebraic immunity of the Boolean function. This is the
   smallest integer i such that there exists a non trivial annihilator
   for self or ~self.

The annihilator you get is for ~f1 (or if you prefer 1+f1)

You can check that: (1+f1)*annihilator_f1 == 0

Best regards

Le mardi 12 février 2013 18:35:05 UTC+1, akhil a écrit :
>
> Hello,
>
> SAGE returns an incorrect annihilator when algebraic_immunity(annihilator 
> = True) is used in the following code:
>
> from  sage.crypto.boolean_function import BooleanFunction
> R = BooleanPolynomialRing(4,'x')
> f1 = R.gen(0)*R.gen(1)*R.gen(2) + R.gen(0)*R.gen(1)*R.gen(3) + 
> R.gen(0)*R.gen(2)*R.gen(3) + R.gen(1)*R.gen(2)*R.gen(3) + 1
> annihilator_f1 = BooleanFunction(f1).algebraic_immunity(annihilator = 
> True)[1]
> print (annihilator_f1 * f1)
>
> annihilator_f1 is incorrect, because the response comes as:
>
> x0 + x1 + x2 + x3 + 1
>
>
> and not 0 as expected.
>
> The annihilator( ) function however, returns the correct answer, as 
> checked with the following code:
>
> for i in range(1,f1.total_degree() + 1):
>     if BooleanFunction(f1).annihilator(i) == None:
>         continue
>     else:
>         p =  BooleanFunction(f1).annihilator(i)
>         print p
>         print (p*f1 == 0)
>         break
>        
> Output:
>
> x0*x1*x2 + x1*x2*x3
> True
>
>
> The above code was written in online notebook version of SAGE.
>
> Thanks,
> AKHIL.
>
>
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to