def generate_shared_key(our_private, their_public):
    """
    generate_shared_key uses the private key and the other party's public key
    to generate the shared secret.
    """
    return our_private.exchange(their_public)