Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

xgcd should be computed over ZZ, not R - e.g.:

g, u, v = xgcd(poly_elem.change_ring(ZZ), poly_modulus.change_ring(ZZ))

xgcd should be computed over ZZ, not R - e.g.:

g, u, v = xgcd(poly_elem.change_ring(ZZ), poly_modulus.change_ring(ZZ))

and the formula for inverse should be changed to

inverse = GaloisRing(u)/g