avoid a sign-extension bug in crypto_hash_function