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))
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))
def h(input1, input2): return fc.hash_bytearray( fc.int2bytearray(input1) + fc.int2bytearray(input2))
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'))
def transform_func(hex): return fc.hash_bytearray(fc.hex_to_bytearray(hex))
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))