LogoLogo
LogoLogo
  • Introduction
    • About Us
    • Notations & Definitions
      • MPC
      • ZK
    • Contribute to this Site!
  • Primitives
    • Multiplication
      • Karatsuba Multiplication
      • Toom-Cook Multiplication
    • NAF (Non-adjacent form)
    • Chinese Remainder Theorem (CRT)
    • Euclidean Algorithm
      • Extended Euclidean Algorithm
      • Binary Euclidean Algorithm
      • Extended Binary Euclidean Algorithm
    • Coding Theory
      • Linear Code
    • Number Theoretic Transform
    • Abstract Algebra
      • Group
        • -Morphisms
        • Batch Inverse
      • Elliptic Curve
        • Weierstrass Curve
          • Coordinate Forms
          • Fast Elliptic Curve Arithmetic and Improved WEIL Pairing Evaluation
        • Edwards Curve
          • Coordinate Forms
          • Twisted Edwards ↔ Short Weierstrass Transformation
        • Batch Inverse for Batch Point Additions
        • Scalar Multiplication
          • Double-and-add
          • GLV Decomposition
        • MSM
          • Pippenger's Algorithm
          • Signed Bucket Index
          • CycloneMSM
          • EdMSM
          • cuZK
        • 2-Chain and 2-Cycle of Elliptic Curves
    • Encryption Scheme
      • ElGamal Encryption
    • Modular Arithmetic
      • Modular Reduction
        • Barrett Reduction
        • Montgomery Reduction
      • Modular Inverse
        • Bernstein-Yang's Inverse
    • Multiset Check
    • Sumcheck
    • Commitment Scheme
      • Fflonk
      • SHPlonk
      • Zeromorph
  • MPC
    • Yao's Garbled Circuits
    • GMW
    • BMR
  • ZK
    • Arithmetization
      • R1CS
      • PLONK
      • AIR
    • Folding
      • LatticeFold
      • Nova
        • Nova over Cycles of Curves
    • Lookup
      • Lasso
      • LogUp-GKR
    • SNARK
      • Groth16
      • HyperPlonk
      • Spartan
        • SPARK
    • STARK
      • Additive NTT
      • Basefold
      • Binius
      • Brakedown
      • CircleSTARK
      • FRI
        • FRI Security Features and Optimizations
      • DEEP FRI
      • STIR
      • WHIR
    • Distributed ZK
      • Ryan's Trick for Distributed Groth16
  • Application
    • zkLogin
    • zkHoldem
    • zkTLS
      • DECO
      • Proxying is enough
  • zkVM
Powered by GitBook
On this page
  • Motivation
  • Algorithm Process
Export as PDF
  1. Primitives
  2. Abstract Algebra
  3. Elliptic Curve
  4. Scalar Multiplication

Double-and-add

Reduction of scalar multiplication into double and add operations

PreviousScalar MultiplicationNextGLV Decomposition

Last updated 1 month ago

Motivation

Additions (including doubles) are cheap for elliptic curve points. As such, we try to reduce scalar multiplication (or elliptic curve points multiplied by a scalar) to a series of additions.

Algorithm Process

In practice, Double-and-add is implemented as follows:

// Scalar multiplication: Double-and-Add
Point ScalarMultiply(Point p, int k) {
    Point result; // point at infinity
    while (k > 0) {
        result = result.Double();
        if (k & 1) result += p;
        k >>= 1;
    }
    return result;
}

For example, let's take a look at 6:

6=0⏟201⏟211⏟226 = \underbrace{0}_{2^0}\underbrace{1}_{2^1}\underbrace{1}_{2^2}6=200​​211​​221​​
k = 6
result = 0;

// 1st while loop:
result = result.Double() // 1 double => 0

// 2nd while loop:
result += p              // 1 add    => p
result = result.Double() // 1 double => 2p

// 3rd while loop:
result += p              // 1 add    => 3p
result = result.Double() // 1 double => 6p

= 2 adds + 3 doubles

Written by of A41

Ashley Jeong