Ask Your Question
1

Square root of polynomial modulo another irreducible polynomial

asked 2018-04-16 02:57:45 -0500

tobiasBora gravatar image

updated 2018-04-16 02:59:49 -0500

Hello,

If I'm not wrong, it is always possible to compute the square root of a polynomial $P$ modulo an irreducible polynomial $g$ when the base field is in $GF(2^m)$, i.e. find $Q \in GF(2^m)$ such that $Q^2 \equiv P \mod g$. Indeed, the operation $Q \rightarrow Q^2 \pmod g$ should be linear (because we are in $GF(2^m)$) so an idea would be to compute the matrix $T$ that perform this operation, and then invert it, but I'd like to find an embedded operation in sage. I tried the sagemath $P.sqrt()$ method, but the problem is that because it does not take into account the modulo, it fails most of the time when the polynomial has some terms with odd power of $X$.

Any idea?

Thanks!

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
1

answered 2018-04-23 17:37:41 -0500

dan_fulea gravatar image

updated 2018-04-23 17:38:12 -0500

Let us start with some finite field $F$ of characteristic $2$ with $q = 2^r$ elements, and some irreducible polynomial $g$ of (small) degree $s$ over this field.

Then $L=F[Y]/g(Y)$ is a field with $q^s=2^{rs}$ elements, so the corresponding Frobenius morphism is the identity isomorphism of $L$.

Now let us fix $P=P(y)=P(Y)\mod g(Y)$. Let $$ Q=P^{\displaystyle 2^{rs-1}}\ . $$ Then $$ Q^2=\left(P^{\displaystyle 2^{rs-1}}\right)^2 =P^{\displaystyle 2^{rs}}=P\ . $$

Example:

F.<a> = GF(2^5)
R.<Y> = PolynomialRing(F)
g     = Y^3 + Y + 1
print "Is g = %s irreducible? %s" % ( g, g.is_irreducible() )
S.<y> = R.quotient(g)

P = a*y
Q = P^(2^(3*5-1))

print "P = %s" % P
print "Q = %s" % Q
print "Is Q^2 == P? %s" % bool( Q^2 == P )

This gives:

Is g = Y^3 + Y + 1 irreducible? True
Q = (a^4 + a^3 + a + 1)*y^2 + (a^4 + a^3 + a + 1)*y
Is Q^2 == P? True
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2018-04-16 02:57:45 -0500

Seen: 83 times

Last updated: Apr 23