Esempio n. 1
0
def create_table(start_value, end_value):
    # create a table:  f(x) => G * x
    P = ec.Scalar_Multiplication(start_value, G)
    baby_steps = []
    for x in range(start_value, end_value):
        baby_steps.append(P.x)
        P = ec.Point_Addition(P, G)
    baby_steps.append(P.x)  # last element
    return baby_steps
Esempio n. 2
0
def create_table(this_list):
    start_value, end_value, m = this_list
    print('[+] Working on Chunk {} ...'.format(m))
    # create a table:  f(x) => G * x
    P = ec.Scalar_Multiplication(start_value, G)
    baby_steps = []
    for x in range(start_value, end_value):
        baby_steps.append(P.x)
        P = ec.Point_Addition(P, G)
    baby_steps.append(P.x)  # last element
    return baby_steps
Esempio n. 3
0
# We have to solve P = k.G, we know that k lies in the range ]k1,k2]
k1 = randk(a, b)  # start from
k2 = k1 + seq

print('[+] seq value:', seq, '   m value :', m)
G = ec.G
Zp = ec.Point.IDENTITY_ELEMENT
print('[+] Search Range:', hex(a), ' to ', hex(b))
###############################################################################

print(
    '                                                                [+] k1:',
    hex(k1))

k1G = ec.Scalar_Multiplication(k1, G)
mG = ec.Scalar_Multiplication(m, G)

st = time.time()

###############################################################################
# =============================================================================
# def secondary_table(end_value):
#     P = G
#     baby_steps = []
#     for i in range(1, end_value):
#         baby_steps.append(P.x)
#         P = ec.Point_Addition(P, G)
#     baby_steps.append(P.x)              # last element
#     return baby_steps
# =============================================================================