On Apr 5, 2015, at 11:39 , absinthe wrote:
> Dear all, thanks for your replies. In general I don't want others to do the
> dirty work for me, so I ask the actual problem. Anyway, since I have to
> give more details to get the actual help... The case is that I want to
> implement NTRU (see here for details
> <
http://en.wikipedia.org/wiki/NTRUEncrypt>)
> As you see, I have to construct polynomials, similar to the ones I was
> refering to and compute their inverse... So it is definite that I'm going
> to have zero-divisors and the like...
Thanks for your clarifications. I think the issue at the root of your problem is that Sage's algorithm implementing "foo.inverse_mod(bar)" uses the Euclidean algorithm (use the "?" or "??" operators as follows to see details:
sage: foo.inverse_mod? or foo.inverse_mod??)
I believe that the Euclidean algorithm assumes the underlying ring is Euclidean (which in turns requires no zero divisors). In the Hoffstein-et al article, they mention using an "easy modification" of said algorithm to compute inverses, an exercise, I suppose, for the really-interested reader.
HTH
Justin
--
Justin C. Walker
Curmudgeon-at-large
Director
Institute for the Absorption of Federal Funds
----
186,000 Miles per Second
Not just a good idea:
it's the law!
----