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
  • References
Export as PDF
  1. Primitives
  2. Abstract Algebra
  3. Elliptic Curve

Batch Inverse for Batch Point Additions

PreviousTwisted Edwards ↔ Short Weierstrass TransformationNextScalar Multiplication

Last updated 1 month ago

Motivation

The addition of two elliptic curve points P=(xP,yP)P=(x_P,y_P)P=(xP​,yP​) and Q=(xQ,yQ)Q=(x_Q,y_Q)Q=(xQ​,yQ​) to receive R=P+Q=(xR,yR)R = P+Q = (x_R, y_R)R=P+Q=(xR​,yR​) must be done like so ():

m=yQ−yPxQ−xPxR=m2−xP−xQyR=m(xP−xR)−yPm = \frac{y_Q - y_P}{x_Q - x_P} \\ x_R=m^2-x_P-x_Q\\ y_R=m(x_P-x_R)-y_Pm=xQ​−xP​yQ​−yP​​xR​=m2−xP​−xQ​yR​=m(xP​−xR​)−yP​

We see that the calculation of the slope mmm always includes the field inverse operation of (xQ−xP)−1(x_Q-x_P)^{-1}(xQ​−xP​)−1, but we know that field inverse operations are expensive. Thus, when computing multiple point additions at once, we want to find a way to only require a singular field inverse operation in total. This can simply be done with our previously established concept of .

Algorithm Process

We apply to our point additions. Suppose we have two sets of nnn total points as {P0,P1,…,Pn−1}\{P_0, P_1, \dots ,P_{n-1}\}{P0​,P1​,…,Pn−1​} and {Q0,Q1,…,Qn−1}\{Q_0, Q_1, \dots ,Q_{n-1}\}{Q0​,Q1​,…,Qn−1​} where we are attempting to obtain the sums {R0,R1,…,Rn−1}\{R_0, R_1, \dots ,R_{n-1}\}{R0​,R1​,…,Rn−1​} where Ri=Pi+QiR_i = P_i + Q_iRi​=Pi​+Qi​.

Note that the points PiP_iPi​ and QiQ_iQi​ are defined as follows:

Pi=(xPi,yPi)Qi=(xQi,yQi)\begin{align*} P_i &= (x_{P_i}, y_{P_i}) \\ Q_i &= (x_{Q_i}, y_{Q_i}) \\ \end{align*}Pi​Qi​​=(xPi​​,yPi​​)=(xQi​​,yQi​​)​

As per definition, for a single point addition, computing mim_imi​ requires computing (xQi−xPi)−1(x_{Q_i}-x_{P_i})^{-1}(xQi​​−xPi​​)−1.

Thus, we define the following instead:

λi=xQi−xPi(xQi−xPi)−1=1λi=∏j≠iλj∏k=0n−1λk\begin{align*} \lambda_i &= x_{Q_i} - x_{P_i} \\ (x_{Q_i} -x_{P_i})^{-1} &= \frac{1}{\lambda_i} =\frac{\prod_{j\neq i}\lambda_j}{\prod_{k=0}^{n-1}\lambda_k} \end{align*}λi​(xQi​​−xPi​​)−1​=xQi​​−xPi​​=λi​1​=∏k=0n−1​λk​∏j=i​λj​​​

References

With this definition, the only field inverse operation required across all (xQi−xPi)−1(x_{Q_i} -x_{P_i})^{-1}(xQi​​−xPi​​)−1 calculations is (∏k=0n−1λk)−1(\prod_{k=0}^{n-1} \lambda_k)^{-1}(∏k=0n−1​λk​)−1. As ∏k=0n−1λk\prod_{k=0}^{n-1} \lambda_k∏k=0n−1​λk​ is the total product of all λ\lambdaλ values, it only needs to be calculated once across all inverses (xQi−xPi)−1(x_{Q_i} -x_{P_i})^{-1}(xQi​​−xPi​​)−1. Therefore, we now require the inverse of only one value when computing multiple point additions at once.

Note that the numerator ∏j≠iλj\prod_{j\neq i}\lambda_j∏j=i​λj​ will introduce new field multiplication operations, but this is fine as the cost of these multiplications is far less than computing more field inverse operations.

Refer to the of to learn more about the total cost.

Written by of

https://hackmd.io/1mpavmFmQNWrahBi8mHBjQ
https://hackmd.io/@tazAymRSQCGXTUKkbh1BAg/Sk27liTW9#Optimization-1-Batch-Affine-for-Point-Addition
See here for more information on elliptic curves
Batch Inverse
Batch Inversion
Batch Inversion
A41
Ashley Jeong
Computational Complexity Section