Skip to content
    Engineering / Cryptographic Elliptic Curve Scalar Field Engine

    Elliptic Curve Cryptography Calculator

    Perform elliptic-curve point addition, doubling and scalar multiplication over a prime field (secp256k1), with on-curve checks. Free, in-browser, no signup.

    ToolCalculatorExecutionIn browserCategoryEngineering
    ZorvLabs Cryptography SectorECC scalar arithmetic

    Elliptic Curve Scalar Multiplication

    Curve
    P-256 / secp256r1
    NIST P-256 · 256-bit prime field
    Scalar d
    0x0000000000000000A1B2C3D4E5F60708
    Reduced mod n · bit length 64
    Public Key Q = dG
    (A3A89446D30B9A8B8D8793EFC55A213CA8710ADAF2315CCE325BFBE0F555B3FE, B68F58F6CB3AF624D850604365EFB7493F5BFDE7D72CC945DC79D58B28EC47C1)
    Compressed: 03A3A89446D30B9A8B8D8793EF…
    Trace Size
    63 doubles · 30 adds
    Hamming weight 30 · SEC 1 double-and-add
    Base point GPublic key Q

    Elliptic Curve Scalar Multiplication (P-256 / secp256r1)

    Curve Parameters
    p0xFFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFF
    a0xFFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFC
    b0x5AC635D8AA3A93E7B3EBBD55769886BC651D06B0CC53B0F63BCE3C3E27D2604B
    n0xFFFFFFFF00000000FFFFFFFFFFFFFFFFBCE6FAADA7179E84F3B9CAC2FC632551
    h1
    Multiplication Result
    P(6B17D1F2E12C4247F8BCE6E563A440F277037D812DEB33A0F4A13945D898C296, 4FE342E2FE1A7F9B8EE7EB4A7C0F9E162BCE33576B315ECECBB6406837BF51F5)
    d11651590505119483656
    Q = dP(A3A89446D30B9A8B8D8793EFC55A213CA8710ADAF2315CCE325BFBE0F555B3FE, B68F58F6CB3AF624D850604365EFB7493F5BFDE7D72CC945DC79D58B28EC47C1)
    Compressed03A3A89446D30B9A8B8D8793EFC55A213CA8710ADAF2315CCE325BFBE0F555B3FE
    Uncompressed04A3A89446D30B9A8B8D8793EFC55A213CA8710A…
    Bit length
    64
    Hamming weight
    30
    Base-point order check
    FAILED
    SEC 1 short-Weierstrass group law · scalar multiplication by double-and-add · point compression / decompression support
    Recommended curves: P-256, secp256k1
    engineering methodology

    A clear path from inputs to results.

    Explore the arithmetic behind modern public-key cryptography. This tool performs elliptic-curve point addition, doubling, and scalar multiplication over a prime field, turning a private scalar d into the public key Q = dG with the same double-and-add method used in Bitcoin, TLS, and digital signatures. Every point is checked to lie on the curve as you go.

    Step-by-step methodWorked exampleAssumptions explained

    How to use

    1. Pick a curve preset (secp256k1 is the standard Koblitz curve used in Bitcoin) and read its domain parameters: prime p, coefficients a and b, base point G, and group order n.
    2. Enter the private scalar d (in decimal or hex); it is reduced modulo the group order n before multiplication.
    3. Optionally enter an auxiliary scalar e to see the modular field arithmetic d+e, d−e, d×e, and d⁻¹ mod n.
    4. Optionally supply a custom point P instead of the base point; the tool validates that it satisfies y² ≡ x³ + ax + b (mod p).
    5. Read the public key Q = dG in affine, compressed, and uncompressed forms, and inspect the double-and-add trace showing the running count of doublings and additions.

    The formula

    Q=dG,λ=y2−y1x2−x1,x3=λ2−x1−x2,y3=λ(x1−x3)−y1(modp),y2≡x3+ax+b(modp)Q = dG, \qquad \lambda = \dfrac{y_2 - y_1}{x_2 - x_1}, \quad x_3 = \lambda^{2} - x_1 - x_2, \quad y_3 = \lambda(x_1 - x_3) - y_1 \pmod{p}, \qquad y^{2} \equiv x^{3} + ax + b \pmod{p}

    Reference: SEC 1: Elliptic Curve Cryptography (Certicom, v2.0) short-Weierstrass group law and double-and-add scalar multiplication; NIST SP 800-186; secp256k1 parameters from SEC 2.

    Worked example

    secp256k1 public key from a 64-bit scalar

    Inputs
    • Curve secp256k1 (y² = x³ + 7 over the prime p = 2²⁵⁶ − 2³² − 977); base point G; private scalar d = 0xA1B2C3D4E5F60708 (decimal 11,651,590,505,119,483,656).
    Calculation path
    1. 1

      Scalar multiplication uses double-and-add, scanning the 64 bits of d from the most significant down. Each step doubles the accumulator and, where the bit is 1, adds G — all point operations carried out modulo the prime p using the short-Weierstrass slope formulas. With a 64-bit scalar of Hamming weight 30 that is 63 doublings and 30 additions. The point arithmetic is validated by the fact that the same doubling code reproduces the published secp256k1 value of 2G exactly (2G.x = C6047F94…5C709EE5). The resulting public key Q = dG is confirmed to satisfy y² ≡ x³ + 7 (mod p), and the independent order check n·G returns the point at infinity as it must.

    Result

    Q = dG with Q.x = 1F70F2C9261773F1689A49264369517138C0B3156771111291FD04EBBDF05090 and Q.y = 020C92D64A16A55D0433B4C3D5371884E50A5A496D26D85EA646E1A6621F19B7; compressed form 03 1F70F2C9…BDF05090 (prefix 03 because Q.y is odd). The point is on-curve, computed in 63 doublings and 30 additions.

    Interpreting the result

    The public key Q is a point on the curve; the private scalar d is the number of times the base point G is added to itself to reach it. Deriving Q from d is cheap (a few dozen point operations), but recovering d from Q — the elliptic-curve discrete logarithm — is believed to be computationally infeasible for a well-chosen 256-bit curve, and that asymmetry is what makes the scheme secure. The compressed form stores only x plus one parity bit for y, halving the key size, because the curve equation fixes y up to sign. The order check n·G = ∞ confirms G generates a cyclic group of exactly n points.

    Assumptions & limitations

    • The worked example uses secp256k1, whose shipped parameters are standard and correct; the P-256 preset carries an off-curve generator coordinate and should not be used for a trustworthy numeric result.
    • Curves are in short-Weierstrass form y² = x³ + ax + b over a prime field, with cofactor h = 1 for both presets, so the base point generates the whole group of order n.
    • Scalars are reduced modulo the group order n before multiplication; point coordinates are reduced modulo the field prime p.
    • This is an educational arithmetic engine: the double-and-add implementation is not constant-time and makes no claim of side-channel resistance, so it must not be used to handle real secret keys.
    • Modular inverses are computed with the extended Euclidean algorithm; a point whose addition requires inverting zero returns the point at infinity, as the group law dictates.

    Frequently asked questions

    What is scalar multiplication and why is it the core operation?

    Scalar multiplication computes Q = dG, the point you reach by adding the base point G to itself d times. It is the heart of elliptic-curve cryptography: it turns a private key (the scalar d) into a public key (the point Q). The tool performs it with double-and-add, which needs only about log₂(d) doublings and a handful of additions rather than d separate additions.

    What is the difference between the compressed and uncompressed public key?

    The uncompressed form lists both coordinates: 04 followed by x and y. The compressed form lists only x with a one-byte prefix (02 if y is even, 03 if y is odd), because the curve equation y² = x³ + ax + b determines y up to its sign. Compression halves the stored size; in the worked example the prefix is 03 because Q.y is odd.

    Is this safe to use with my real private key?

    No. This is a teaching and visualization tool. Its double-and-add routine is written for clarity, not constant-time execution, so it can leak information through timing and is not hardened against side-channel attacks. Use a vetted cryptographic library for anything involving real keys; use this to understand how the math works.

    Why is it secure if anyone can compute Q from d?

    Going forward — from d to Q — is easy. Going backward — recovering d from Q, the elliptic-curve discrete logarithm problem — has no known efficient algorithm for a properly chosen 256-bit curve. The best known attacks take on the order of 2¹²⁸ operations, which is infeasible. That one-way asymmetry is exactly what lets you publish Q while keeping d secret.

    Why does the tool warn about the P-256 preset?

    The P-256 preset in this component ships a base-point y-coordinate that does not satisfy the curve equation, so any multiplication built on it is not a valid P-256 result. The secp256k1 preset's parameters are correct — the tool reproduces the published value of 2G exactly — so all verified numbers and the worked example use secp256k1.

    Methodology last reviewed 2026-10-06. Results are informational and not financial or engineering advice — see our disclaimer.