Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

answered 0 years ago

Max Alekseyev gravatar image

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

g, u, v = xgcd(poly_elem.change_ring(ZZ), poly_modulus.change_ring(ZZ))
click to hide/show revision 2
No.2 Revision

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