EdMSM
ZPrize "Accelerating MSM on Mobile" winner
Multiplication Optimization
Normal CIOS
Implementation in Python
def cios(a, b, n, n_prime, w, t, l):
"""
Montgomery Multiplication Step.
Args:
a (list[int]): \bar{a} = aR
b (list[int]): \bar{b} = bR
n (list[int]): modulus
n_prime (list[int]): n' = -inv(n) mod R
w (int): bit size of limb
t (list[int]): REDC(toMont(a) * toMont(b)) = toMont(ab)
l (int): number of limbs
Returns:
list[int]: result after multiplication using CIOS
"""
for i in range(l):
carry = 0
# Step 1: t[j] = t[j] + a[j] * b[i] + carry
for j in range(l):
total = t[j] + a[j] * b[i] + carry
# divmod(p, q) divides p by q and returns a tuple (quotient, remainder)
carry, t[j] = divmod(total, w)
# (1)
t[l + 1], t[l] = divmod(t[l] + carry, w)
# Step 2: Compute m
m = (t[0] * n_prime[0]) % w
# (carry, _) := t[0] + m * n[0]
total = t[0] + m * n[0]
carry, _ = divmod(total, w)
# (t + m * n) >> w
for j in range(1, l):
total = t[j] + m * n[j] + carry
carry, t[j - 1] = divmod(total, w)
# (carry, t[l - 1]) := t[l] + carry
total = t[l] + carry
carry, t[l - 1] = divmod(total, w)
# (2)
t[l] = t[l + 1] + carry
return tOptimization
Proof Sketch
Performance improvement
CIOS
CIOS + EdMSM
SOS
SOS + Ingonyama
Pippenger optimization
2-chain and 2-cycle of elliptic curves
Lemma 2.
Pippenger's Algorithm (Bucket method)
Known optimizations
Curve forms and coordinate systems


Performance improvement

References
Last updated