I have the same problem. My output (Mac OS 10.8.4 with sage 5.11) for #!/usr/bin/env sage
from sage.crypto.boolean_function import BooleanFunction P = BooleanPolynomialRing(4,'x') P.inject_variables() f = BooleanFunction(x0*x2 + x2*x3 + 1) print "f.algebraic_immunity() = {0}".format(f.algebraic_immunity()) print "f.annihilator(f.algebraic_immunity()) = {0}".format(f.annihilator(f.algebraic_immunity())) print "f.algebraic_immunity(annihilator=True) = {0}".format(f.algebraic_immunity(annihilator=True)) g = BooleanFunction(f.algebraic_immunity(annihilator=True)[1]) print "f = {0}".format(f.algebraic_normal_form()) print "g = {0}".format(g.algebraic_normal_form()) print "g*f = {0}".format(g.algebraic_normal_form()*f.algebraic_normal_form()) is Defining x0, x1, x2, x3 f.algebraic_immunity() = 1 f.annihilator(f.algebraic_immunity()) = None f.algebraic_immunity(annihilator=True) = (1, x2 + 1) f = x0*x2 + x2*x3 + 1 g = x2 + 1 g*f = x2 + 1 Therefore algebraic_immunity returns wrong degree. g*f = 0 for degree 2, which is the correct answer. On Tuesday, February 12, 2013 6:35:05 PM UTC+1, akhil wrote: > > 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 sage-support+unsubscr...@googlegroups.com. To post to this group, send email to sage-support@googlegroups.com. Visit this group at http://groups.google.com/group/sage-support. For more options, visit https://groups.google.com/groups/opt_out.
Main.sage
Description: Binary data