On Dec 12, 7:03 am, Santanu Sarkar <sarkar.santanu....@gmail.com>
wrote:
> Sorry I meant to write
> " But it does not work...."
> apologies for the typo
>
> On 12 December 2011 07:49, Santanu Sarkar <sarkar.santanu....@gmail.com> 
> wrote:
>
> > I have a set of Boolean functions like
> > A[0]=x1*x2+x3*x4
> > A[1]=x3+x7+x10
> > A[2]=x19*x36+x43*x45*x50
> > over variables x_1,.. x_50.
> > But each function contains at most 10 variables.
> > I want to calculate the balancedness of each function.
>
> > I have done the following:
>
> > from sage.crypto.boolean_function import BooleanFunction
> > R=PolynomialRing(GF(2),'x',2^8)
> > x=R.gens()
> > S1=A[0]
> > xx=S1.variables()
> > l=len(xx)
> > P=BooleanPolynomialRing(l,map(str,xx))
> > f=BooleanFunction(A[0])
> > f.is_balanced()
>
> > But it does now work.
> > How can it be possible in Sage?
>
>

from sage.crypto.boolean_function import BooleanFunction
R=PolynomialRing(GF(2),'x',50)
x=R.gens()
A0=x[0]*x[1]+x[2]*x[3]
xx=S1.variables()
l=len(xx)
P=BooleanPolynomialRing(l,map(str,xx))
a0=P(xx[0]*xx[1]+xx[2]*xx[3])
f=BooleanFunction(a0)
print f.is_balanced()
#False

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org

Reply via email to