New answers tagged

0

The Problem was as following: The code works vor Polynomimals f(x) mod p, where p is prime (or gcd(p,coeff(f(x))) = 1), but I wanted the inverse modulo 32, which is in fact: 2^5, so I had to calculate the inverse mod 2 and then lift it to 2^5 The solution was in thread: inverse of polynomials


1

newR: [ -1, 1, 1, 0, -1, 0, 1, 0, 0, 1, -1 ] This polynomial is $f = -x^{10} + x^9 + x^6 - x^4 + x^2 + x - 1$ where you wanted: $f=x^{10}+x^9+x^6−x^4+x^2+x−1$ The sign for the $x^{10}$ was opposite. Your algorithm/code is actually correct. See the following calculation from sage: sage: f -x^10 + x^9 + x^6 - x^4 + x^2 + x - 1 sage: f_inv 30*x^10 ...



Top 50 recent answers are included