I’m looking for an algorithm (or code) to help me compute the inverse a polynomial, I need it for implementing NTRUEncrypt. An algorithm that is easily understandable is what I prefer, there are pseudo-codes for doing this, but they are confusing and difficult to implement, furthermore I can not really understand the procedure from pseudo-code alone.
Any algorithms for computing the inverse of a polynomial with respect to a ring of truncated polynomials?
I work for Security Innovation, which owns NTRU, so I’m glad to see this interest.
The IEEE standard 1363.1-2008 specifies how to implement NTRUEncrypt with the most current parameter sets. It gives the following specifications to invert polynomials:
Division:
Inputs are a and b, two polynomials, where b is of degree N-1 and b_N is the leading coefficient of b. Outputs are q and r such that a = q*b + r and deg(r) < deg(b). r_d denotes the coefficient of r of degree d, i.e. the leading coefficient of r.
Here, r_d is the coefficient of r of degree d.
Extended Euclidean Algorithm:
Inverse in Z_p, p a prime:
Inverse in Z_p^e / (M(X), p a prime, M(X) a suitable polynomial such as X^N-1
If you’re doing a full implementation of NTRU you should see if you can get your institution to buy 1363.1, as raw NTRU encryption isn’t secure against an active attacker and 1363.1 describes message processing techniques to fix that.
(Update 2013-04-18: Thanks to Sonel Sharam for spotting some errors in the previous version)