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
  • Algorithm Process
  • 1. Find a scalar
  • 2. Decompose the scalar
  • 3. Calculate the total
  • Comparison of Cost
  • GLV Advantages
  • Parallelization
  • Reduced overhead from shared memory
  • MSM
  • References
Export as PDF
  1. Primitives
  2. Abstract Algebra
  3. Elliptic Curve
  4. Scalar Multiplication

GLV Decomposition

Splitting a scalar multiplication into 2 and reducing count of double operations

PreviousDouble-and-addNextMSM

Last updated 1 month ago

Note 1. The elliptic curve in use should have efficiently-computable

Note 2. The elliptic curve in use must have the y2=x3+by^2= x^3 + by2=x3+b, where a=0a=0a=0

Algorithm Process

We attempt to calculate the following elliptic curve point-scalar multiplication:

kPkPkP

...where kkk is the scalar and point PPP is (x,y)(x,y)(x,y).

1. Find a scalar λ\lambdaλ

...that satisfies the following:

λP=(βx,y)=P′\lambda P = (\beta x , y) = P'λP=(βx,y)=P′

β\betaβ will be a cubic root of the base field or in other words for a base field Fp\mathbb{F}_pFp​ we have β3≡1mod  p\beta^3 \equiv 1 \mod{p}β3≡1modp

As β\betaβ is a 3rd root of unity, the elliptic curve equation (with a=0a=0a=0) holds:

y2=(β⋅x)3+b=x3+by^2 =(\beta \cdot x)^3 + b = x^3 + by2=(β⋅x)3+b=x3+b

TODO: Explain how to find λ\lambdaλ

2. Decompose the scalar kkk

k=k1+λk2mod  pk = k_1 + \lambda k_2 \mod{p}k=k1​+λk2​modp

...where k1k_1k1​ and k2k_2k2​ are around half the bits of kkk.

3. Calculate the total

This means, by definition, the following is true:

kP=k1P+λk2P=k1P+k2P′kP = k_1P + \lambda k_2 P = k_1P + k_2P'kP=k1​P+λk2​P=k1​P+k2​P′

Comparison of Cost

By this description, we can conclude that GLV severely decreases the total number of point doubles, but can slightly increase the number of point additions.

GLV Advantages

Parallelization

The separation of one scalar multiplication into smaller parts introduces the possibility for running parallelization.

Reduced overhead from shared memory

Memory for intermediate computations can be shared by first calculating k1Pk_1Pk1​P and k2Pk_2Pk2​P. After calculations are finished, β\betaβ can be simply multiplied to k2Pk_2Pk2​P's result.

Point ScalarMultiply(const Point& p, int k) {
    auto [k1, k2] = Point::Split(k); // GLV scalar decomposition

    Point s = p;
    Point p1, p2;

    int max_bits = std::max(
        static_cast<int>(std::bit_width(static_cast<unsigned int>(k1))),
        static_cast<int>(std::bit_width(static_cast<unsigned int>(k2)))
    );
    
    // Share intermediate computations when running Double-and-add on 2 parts
    for (int i = 0; i < max_bits; ++i) {
        if (k1 & (1 << i)) p1 += s;
        if (k2 & (1 << i)) p2 += s;
        s = s.Double();
    }

    return p1 + Point::Endo(p2);
}

MSM

References

Note that the property of is used for this process.

In the , they mention their algorithm reduces the number of double operations by around half in comparison to other algorithms due to the decomposed scalar. However, determining the exact cost benefit of GLV proves quite difficult. The authors of GLV state the following in their (which has been paraphrased for simplicity):

Whereas a current "" that uses exponent recoding and a sliding window algorithm costs 157 point doubles and 24 point additions for 160-bit scalar multiplication, with GLV, it costs around 79 point doubles and 38 point additions. If a point double costs 8 field multiplications and a point addition costs 11 field multiplications (per ), then GLV has a run time of around 66% the "highly efficient algorithm." With an increase in bit length, the comparative run time percentage gets better. For example, 512-bit scalar multiplication reduces with percentage to 62%.

GLV is essential for optimization of as it can be used to decompose MSM multiplications before running separate MSM's on the smaller parts. Moreover, when utilizing a bucket optimization technique (like ) for MSM, if GLV is used before , the number of buckets required per window is reduced to 14\frac{1}{4}41​ of the original number.

Written by and of A41

GLV paper
analysis section
Multi-scalar multiplication (MSM)
Pippenger's
Signed Bucket Indexes
https://hackmd.io/@drouyang/glv#GLV-Decomposition-for-Multi-Scalar-Multiplication-MSM
https://www.iacr.org/archive/crypto2001/21390189.pdf
highly efficient algorithm
equation
Jacobian point form
Ashley Jeong
endomorphisms
endomorphism
ryan Kim