First time here? Check out the FAQ!

Ask Your Question
0

inverse of a polynomial modulo another polynomial

asked 13 years ago

anonymous user

Anonymous

updated 13 years ago

DSM gravatar image

Hi, I'm trying to implement the Baby Step Giant Step algorithm in the group of units of prime fields. I would like to generate the field provided one generator polynomial. But I need to calculate p^(-1) (where p is a polynomial), but can't find a function to do so. This is what I'm doing,

F.<a> = GF(2)[];
R.<b> = PolynomialRing(F)
S.<x> = R.quotient(b^4+b+1)

m = sqrt(S.modulus().degree()); 
gamma = S.modulus();
alpha = x^3+1;

now i need to calculate (alpha)^(-1) modulo gamma

Any help? Better ways to do the same thing?

Thanks!

Preview: (hide)

Comments

You should look up the extended gcd algorithm. This is implemented by the xgcd() function in Sage.

burcin gravatar imageburcin ( 13 years ago )

Burcin, xgcd doesn't work. It fails with a type error, "cannot coerce nonconstant polynomial".

Simon King gravatar imageSimon King ( 13 years ago )
1

If you define R over the fraction field of F, or simply over GF(2), then alpha^-1 yields the answer.

Francis Clarke gravatar imageFrancis Clarke ( 13 years ago )

1 Answer

Sort by » oldest newest most voted
0

answered 8 years ago

dan_fulea gravatar image
sage: F.<b> = GF(2)[]
sage: S.<x> = GF( 2**4, modulus = b^4 + b + 1 )
sage: 1/(x^3+1)
x
Preview: (hide)
link

Your Answer

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

Add Answer

Question Tools

Stats

Asked: 13 years ago

Seen: 5,280 times

Last updated: Mar 05 '17