An improved Las Vegas primality test

We present a modification of the Goldwasser-Kilian-Atkin primality test, which, when given an input <italic>n</italic>, outputs either <italic>prime</italic> or <italic>composite</italic>, along with a certificate of correctness which may be verified in polynomial time. Atkin's method computes the order of an elliptic curve whose endomorphism ring is isomorphic to the ring of integers of a given imaginary quadratic field <italic>Q</italic>(√—<italic>D</italic>). Once an appropriate order is found, the parameters of the curve are computed as a function of a root modulo <italic>n</italic> of the Hilbert class equation for the Hilbert class field of <italic>Q</italic>(√—<italic>D</italic>). The modification we propose determines instead a root of the Watson class equation for <italic>Q</italic>(√—<italic>D</italic>) and applies a transformation to get a root of the corresponding Hilbert equation. This is a substantial improvement, in that the Watson equations have much smaller coefficients than do the Hilbert equations.