Example #1
0
def compute_shared_secret(dh_secret, shared_password):
    g_x1x2_bytes = fc.int2bytearray(dh_secret)
    sp_bytes = bytearray(shared_password.encode('utf-8'))
    return fc.hex_to_int(fc.hash_bytearray(g_x1x2_bytes + sp_bytes))
Example #2
0
def f(x_i, y_i):
    x_bytearray = fc.hex_to_bytearray(x_i)
    y_bytearray = fc.hex_to_bytearray(y_i)
    return fc.hex_to_int(fc.hash_bytearray(x_bytearray + y_bytearray))
Example #3
0
def h(input1, input2):
    return fc.hash_bytearray(
        fc.int2bytearray(input1) + fc.int2bytearray(input2))
Example #4
0
def shared_passphrase(g_xy):
    #g_xy and secret passphrase are byte arrays
    return fc.hash_bytearray(
        fc.int2bytearray(g_xy) + "eitn41 <3".encode('utf-8'))
Example #5
0
def transform_func(hex):
    return fc.hash_bytearray(fc.hex_to_bytearray(hex))
Example #6
0
def f(x_i, y_i):
    #return fc.bytearray_to_int(fc.hash_bytearray(fc.hex_to_bytearray(x_i) + fc.hex_to_bytearray(y_i)))
    x_bytearray = fc.hex_to_bytearray(x_i)
    y_bytearray = fc.hex_to_bytearray(y_i)
    return fc.hex_to_int(fc.hash_bytearray(x_bytearray + y_bytearray))