

def generate_shared_public_key(my_private_key, their_public_pair, generator):
    """
    Generate a shared public pair. Two parties each generate a private key and share
    their public key with the other party over an insecure channel. The shared public
    key can be generated by either side, but not by eavesdroppers.
    """
    p = generator.Point(*their_public_pair)
    return my_private_key * p
