KEVOS
ArticlesServicesCase studiesAboutContact
ArticlesServicesCase studiesAboutContact
← ArticlesAtkin-Morain Elliptic Curve Primality ProvingEngineering · Engineering MathematicsLesson 865/884← PrevNext →
ArticlePublished 7 Aug 20262 min readBy Kevin JoginECPPAtkin Moraincomplex multiplicationHilbert class polynomial
On this page

Ask about this page

KEVOS AIAtkin-Morain Elliptic Curve Primality Proving

KEVOS knowledge first · trusted web sources when needed

Modern Primality Tests

Atkin-Morain Elliptic Curve Primality Proving

ECPP: using complex multiplication to construct curves of known order, avoiding point counting entirely.

Engineering / MathematicsModern Primality Tests2 min readKV-MATH-0663

Atkin-Morain primality proving replaces point counting with curve construction. Curves with complex multiplication have orders given by a formula, so a suitable order can be sought before any curve is built.

The reversal

ECPP inverts the search
Goldwasser-KilianAtkin-Morain
Choose a curveChoose a discriminant
Count its points — expensiveCompute the order from a formula — cheap
Hope the order is suitableTest suitability before building anything
Repeat with a new curveRepeat with a new discriminant

Key point

The reversal is the whole idea. Testing an order costs a factorisation attempt; counting points costs a full run of Schoof's algorithm. Moving the test before the expensive step changes the economics completely.

The order formula

If the candidate is represented by the principal form of a discriminant, the curve orders with complex multiplication by that discriminant are given directly in terms of that representation.

4n = u^2 + |D| v^2 => curve order n + 1 - u, for suitable sign choicesSeveral orders arise from the twists; each is tested.

The algorithm

Atkin-Morain ECPP

  1. Choose a discriminantSmall absolute value and small class number, tried in increasing order.
  2. Represent the candidateSolve the norm equation — this succeeds only for suitable discriminants.
  3. Compute candidate ordersFrom the representation.
  4. Test for a suitable factorisationA small part times a large probable prime.
  5. Build the curveVia the Hilbert class polynomial, finding a root modulo the candidate.
  6. Find a point and recurseAs in Goldwasser-Kilian.

Why the curve is built last

Cost

Constructing the curve requires the Hilbert class polynomial, which is expensive for large class numbers. Building it only after a suitable order has been found means it is built once per recursion level rather than once per attempt.

Class invariants

Key point

The Hilbert class polynomial has enormous coefficients. Weber and other class invariants give much smaller polynomials generating the same field, and converting back is a simple algebraic step. Every practical implementation uses them.

Discriminant ordering

Discriminants are tried in order of class number, since small class number means a small class polynomial. Most candidates are settled by one of the first few discriminants tried.

Practical performance

Note

ECPP has proved primality for numbers of tens of thousands of digits. Its running time is variable, depending on how quickly a suitable discriminant and order are found, which makes it less predictable than the Jacobi sum test even where it is faster on average.

The certificate

The certificate is a chain of curve, point, discriminant and order factorisation at each level, verifiable independently and cheaply.

Source. Henri Cohen, A Course in Computational Algebraic Number Theory, Springer GTM 138 — 9.2.2. Structural reference unverified: the source file was not available during authoring; chapter and section numbers are taken from the published edition and have not been checked against a physical copy.

Related pages

  • Complex Multiplication and Class Numbers
  • Modular Equations and the j-Invariant
  • The Goldwasser-Kilian Primality Test
  • Primality Certificates and Independent Verification

Continue learning

The Goldwasser-Kilian Primality TestArticle · Engineering MathematicsNEXT LESSON →Primality Certificates and Independent VerificationArticle · Engineering MathematicsImplementing the Jacobi Sum TestArticle · Engineering MathematicsSmoothness and Sub-exponential ComplexityArticle · Engineering Mathematics
KEVOS · Engineering, manufacturing and project improvement
ArticlesServicesCase studiesAboutContact
© 2026 KEVOS®