Interchangeability of hash outputs I'm looking at tweetnacl, its crypto_sign_keypair, crypto_sign, and crypto_sign_open functions modify and use the output of crypto_hash in various ways.

I would like to swap crypto_hash for another hash function with the same length output. While I would normally avoid doing something like this due to lack of knowledge, in this case it seems like it might be fine. The output of crypto_hash is presumably uniformly distributed, seemingly random, and so tweetnacl is surely not making any assumptions about the output of its hash function. If it's replaced by another function with the same length output, then I assume tweetnacl will use its output just as happily?
If it's replaced by another function with the same length output, then I assume tweetnacl will use its output just as happily?


Yes, it seems to be a normal collision-resistant cryptographic hash function, replacing it by any other will not significantly alter the security properties (unless one of them is broken) but will of course break interopability.

In fact if you could find a security-relevant difference between two secure hash functions (given only oracle-access) at least one of them would be broken.