Skip to main content
Challenges Scalar multiplication: double-and-add
Cryptography Medium Scalar multiplication Solves: 5

Scalar multiplication: double-and-add

Author: CyberSamSU
Points
30

k·P means adding P to itself k times. But if k is a 15-digit number, adding k times will take a lifetime. The solution is the double-and-add algorithm: we use the binary representation of k.

def mul(k, P):
    R = None      # cheksizlikdagi nuqta O
    Q = P
    while k:
        if k & 1:
            R = add(R, Q)
        Q = add(Q, Q)   # ikkilantirish
        k >>= 1
    return R

This algorithm works proportionally to the number of bits of k: ~50 operations for a 15-digit number, ~380 operations for a 256-bit number. This is exactly what makes ECC practical.

Curve parameters:

p = 1098468064591
a = 769028742397
b = 244606442593
G = (494479121669, 79857172577)
k = 824859232408359

Calculate the point Q = k·G.

Test values to check your code:

2G  = (1003950165171, 134579601300)
3G  = (580092589564, 420105781590)
10G = (562678552088, 53852536727)

Answer: the coordinates of the point in the format x,y — first x, then a comma, then y (e.g. 1234,5678).

Hints 3
Opening a hint reduces the points you get for solving this challenge.
Hint 1 −3 pts Log in
Hint 2 −6 pts Log in
Hint 3 −9 pts Log in
To submit a flag, log in.

First solvers

1. Лазиз 04.10.2026
2. Mirjaxon Qaxxarov 27.10.2026
3. Odam 05.11.2026
4. arcanum 11.11.2026
5. Jasmin Xuseinova 15.11.2026