KEVOS
ArticlesServicesCase studiesAboutContact
ArticlesServicesCase studiesAboutContact
← ArticlesElliptic Curve Arithmetic Modulo NEngineering · Engineering MathematicsLesson 871/884← PrevNext →
ArticlePublished 7 Aug 20262 min readBy Kevin Jogincurve arithmeticMontgomery formprojective coordinatesinversion
On this page

Ask about this page

KEVOS AIElliptic Curve Arithmetic Modulo N

KEVOS knowledge first · trusted web sources when needed

Modern Factoring Methods

Elliptic Curve Arithmetic Modulo N

Implementing curve arithmetic over a composite modulus: coordinate systems, inversion handling, and Montgomery form.

Engineering / MathematicsModern Factoring Methods2 min readKV-MATH-0669

The inner loop of ECM is scalar multiplication on a curve modulo a composite. Since inversions are both expensive and the source of the answer, how they are handled determines both speed and correctness.

The inversion dilemma

Key point

Inversions are what reveal factors, but they are also the most expensive operation. The resolution is to avoid inversions during the computation using projective coordinates, then perform a single GCD check at the end of each stage.

Coordinate systems

Coordinate systems for ECM
SystemInversionsCost per doubling
AffineOne per operationFewest multiplications
ProjectiveNoneMore multiplications
Montgomery formNoneVery efficient; ideal for scalar multiplication

Montgomery form

Montgomery curves admit a scalar multiplication using only the first coordinate, via a ladder that performs one doubling and one differential addition per bit.

B y^2 = x^3 + A x^2 + xThe Montgomery form; arithmetic uses x and z only.

Key point

Dropping the second coordinate entirely is what makes Montgomery form the standard choice for ECM. The full point is never needed — only whether a component has reached the identity, which the z coordinate records.

Note

This is unrelated to Montgomery reduction beyond sharing a name. Both are due to Peter Montgomery and both are used together in ECM implementations, which is a frequent source of confusion.

The identity check

In projective coordinates a point is the identity exactly when its final coordinate is zero modulo the relevant prime. Taking the GCD of that coordinate with the modulus is the factor test.

Detecting a factor without inversions

  1. Run the scalar multiplicationEntirely in projective coordinates; no inversions.
  2. Take the GCDOf the final coordinate with the modulus.
  3. InterpretOne means no factor; the modulus means restart; anything else is a factor.

Curve and point generation

Pitfall

Choosing a curve and then searching for a point on it requires a square root modulo a composite, which cannot be done. The standard fix is Suyama's parametrisation: generate the point first and derive the curve coefficient from it, so a point is known by construction.

Batching

Cost

When many curves are run in parallel, simultaneous inversion converts many inversions into one plus a few multiplications each. This matters when a final conversion to affine form is required across a batch.

Modular arithmetic

Every operation is a modular multiplication, so that is where the time goes. Montgomery reduction is standard, and for a fixed modulus used across millions of operations the setup cost is entirely amortised.

Source. Henri Cohen, A Course in Computational Algebraic Number Theory, Springer GTM 138 — 10.3.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

  • Modular Arithmetic and Montgomery Reduction
  • Modular Inversion and Simultaneous Inversion
  • The Group Law on an Elliptic Curve
  • Elliptic Curves Modulo N
  • The Elliptic Curve Method: Stage One

Continue learning

Elliptic Curves Modulo NArticle · Engineering MathematicsNEXT LESSON →The Elliptic Curve Method: Stage OneArticle · Engineering MathematicsThe Schnorr-Lenstra Class Group Factoring MethodArticle · Engineering MathematicsECM Stage Two and Practical TuningArticle · Engineering Mathematics
KEVOS · Engineering, manufacturing and project improvement
ArticlesServicesCase studiesAboutContact
© 2026 KEVOS®