Thank you very much for your reply!

The output for y which you sent below is exactly what I am looking
for. Can you please paste also the SAGE definitions which you use to
construct the field GF(2^8) (mod z^8+z^4+z^3+z+1), the polynomial ring
S, and finally the quotient of S by the 8 relations (x0^2=x0,
x1^2=x1, ..., x7^2=x7)?

Here is how I try to define the above constructions, but as my SAGE
programming is not very good I don't seem to get it right:

Z =
IntegerModRing(2^8)
R =
PolynomialRing(F256,'z');
S = R.quotient(z^8+z^4+z^3+z+1,
'x');
P.<x0,x1,x2,x3,x4,x5,x6,x7> =
PolynomialRing(S)

When I try to construct an element of P like this:

b = (x0+x1*z^1+x2*z^2+x3*z^3+x4*z^4+x5*z^5+x6*z^6+x7*z^7)

I get the following error in SAGE:

"TypeError: unsupported operand parent(s) for '*': 'Multivariate
Polynomial Ring in x0, x1, x2, x3, x4, x5, x6, x7 over Univariate
Quotient Polynomial Ring in x over Integer Ring with modulus z^8 + z^4
+ z^3 + z + 1' and 'Univariate Polynomial Ring in z over Boolean
PolynomialRing in x0, x1, x2, x3, x4, x5, x6, x7'"

Thanks for your help!


On May 28, 11:58 pm, "John Cremona" <[EMAIL PROTECTED]> wrote:
> You could define GF(2^8) using your polynomial as modulus, then define
> the polynomial ring S in 8 variables x0,...,x7 over that, write x as
> an element in that ring.   The inverse of x is also x^254, but you
> want to evaluate this with the side conditions xi^2=xi.  So take the
> quotient of S by those 8 relations first.  This might be better
> handled by the PlyBori package, but I am not familiar with that.
>
> I tried this and it worked.  The output (your y) starts like this,
> where xibar is your xi and a is your z.
>
> (a^6 + a^4 + a)*x0bar*x1bar*x2bar*x3bar*x4bar*x5bar*x6bar + (a^7 + a^5
> + a^2)*x0bar*x1bar*x2bar*x3bar*x4bar*x5bar*x7bar + (a^6 + a^4 + a +
> 1)*x0bar*x1bar*x2bar*x3bar*x4bar*x6bar*x7bar + (a^7 + a^5 + a^2 +
> a)*x0bar*x1bar*x2bar*x3bar*x5bar*x6bar*x7bar + (a^2 +
> 1)*x0bar*x1bar*x2bar*x4bar*x5bar*x6bar*x7bar + (a^6 + a^4 +
> a^3)*x0bar*x1bar*x3bar*x4bar*x5bar*x6bar*x7bar + (a^7 + a^5 +
> a^4)*x0bar*x2bar*x3bar*x4bar*x5bar*x6bar*x7bar + (a^5 + a^3 +
> 1)*x1bar*x2bar*x3bar*x4bar*x5bar*x6bar*x7bar + (a^7 + a^6 +
> a^2)*x0bar*x1bar*x2bar*x3bar*x4bar*x5bar + (a^7 + a^5 + a^2 +
> 1)*x0bar*x1bar*x2bar*x3bar*x4bar*x6bar + (a^7 +
> a^4)*x0bar*x1bar*x2bar*x3bar*x5bar*x6bar + (a^6 + a^4 + a^2 +
> a)*x0bar*x1bar*x2bar*x4bar*x5bar*x6bar + (a^7 + a^5 +
> a)*x0bar*x1bar*x3bar*x4bar*x5bar*x6bar + (a^7 + a^6 + a^4 +
> a)*x0bar*x2bar*x3bar*x4bar*x5bar*x6bar + (a^6 + a^5 +
> a)*x1bar*x2bar*x3bar*x4bar*x5bar*x6bar + (a^7 + a^4 + a +
> 1)*x0bar*x1bar*x2bar*x3bar*x4bar*x7bar + (a^6 + a^4 +
> 1)*x0bar*x1bar*x2bar*x3bar*x5bar*x7bar + (a^6 + a^4 + a^3 + a +
> 1)*x0bar*x1bar*x2bar*x4bar*x5bar*x7bar + (a^7 + a^6 + a^3 +
> a^2)*x0bar*x1bar*x3bar*x4bar*x5bar*x7bar + (a^6 + a^4 + a^3 + a^2 + a
> + 1)*x0bar*x2bar*x3bar*x4bar*x5bar*x7bar + (a^7 + a^6 + a^4 + a^3 +
> a^2 + a + 1)*x1bar*x2bar*x3bar*x4bar*x5bar*x7bar + (a^5 + a^4 + a^3 +
> a^2 + 1)*x0bar*x1bar*x2bar*x3bar*x6bar*x7bar + (a^6 + a^4 +
> a^2)*x0bar*x1bar*x2bar*x4bar*x6bar*x7bar +
> (a^6)*x0bar*x1bar*x3bar*x4bar*x6bar*x7bar + (a^7 + a +
> 1)*x0bar*x2bar*x3bar*x4bar*x6bar*x7bar + (a^6 +
> a^3)*x1bar*x2bar*x3bar*x4bar*x6bar*x7bar +
>
> John Cremona
>
> 2008/5/28 David Joyner <[EMAIL PROTECTED]>:
>
>
>
> > It seems you should be able to represent multiplication by y as a
> > matrix equation,
> > which you might have luck inverting.
>
> > On Wed, May 28, 2008 at 5:27 PM, vpv <[EMAIL PROTECTED]> wrote:
>
> >> Hello,
>
> >> I am trying to solve the following equation for y in SAGE:
>
> >> x*y = 1 (mod z^8+z^4+z^3+z+1)
>
> >> where
>
> >> x = x0+x1*z^1+x2*z^2+x3*z^3+x4*z^4+x5*z^5+x6*z^6+x7*z^7
> >> y = ?
>
> >> x0,...,x7 are elements of GF(2). I do not know their values. I am
> >> searching for y in parametric form i.e. as a polynomial of z of degree
> >> 7 with coefficients - some functions of x0,...,x7.
>
> >> I define in SAGE:
>
> >> P.<x0,x1,x2,x3,x4,x5,x6,x7> = BooleanPolynomialRing(8, order='lex')
> >> Z.<z> = PolynomialRing(P)
>
> >> I try to do the following in SAGE
>
> >> y = inverse_mod(x0+x1*z^1+x2*z^2+x3*z^3+x4*z^4+x5*z^5+x6*z^6+x7*z^7,
> >> z^8+z^4+z^3+z+1)
>
> >> but it does not work.
>
> >> Alternatively, I try to define a ring of univariate polynomials of z
> >> with coeffients in P, every element of which is reduced (mod
> >> z^8+z^4+z^3+z+1), but I am not able to get the right syntax to do this
> >> in SAGE.
>
> >> Any help is appreciated.
>
> >> Thanks!

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to