(x, y)
return (hmac_sha256(CRYPTOVARIABLE_EQUALITY_COMPARISON_NONCE, x) ==
            hmac_sha256(CRYPTOVARIABLE_EQUALITY_COMPARISON_NONCE, y))
Taken from rransom's tor-utils git repository, to compare two
    hashes in something resembling constant time (or at least, not
    leaking timing info?)
Taken from rransom's tor-utils git repository, to compare two
    hashes in something resembling constant time (or at least, not
    leaking timing info?)
Taken from rransom s tor - utils git repository to compare two hashes in something resembling constant time ( or at least not leaking timing info? )
def compare_via_hash(x, y):
    """
    Taken from rransom's tor-utils git repository, to compare two
    hashes in something resembling constant time (or at least, not
    leaking timing info?)
    """
    return (hmac_sha256(CRYPTOVARIABLE_EQUALITY_COMPARISON_NONCE, x) ==
            hmac_sha256(CRYPTOVARIABLE_EQUALITY_COMPARISON_NONCE, y))
def compare_via_hash ( x , y ) : return ( hmac_sha256 ( CRYPTOVARIABLE_EQUALITY_COMPARISON_NONCE , x ) == hmac_sha256 ( CRYPTOVARIABLE_EQUALITY_COMPARISON_NONCE , y ) )