Additionally, if I wanted to put together my own implementation of the Monero CryptoNight PoW, specifically for mining, and was using one of those (with the corresponding tests on GitHub) to validate my implementation, which one should I use? Would it matter? I ask because after using the slow hash, it produces the correct output for the given slow hash tests but it doesn't produce the correct output for the given fast hash tests.

1 Answer 1


cn_slow_hash is CryptoNight. cn_fast_hash is Keccak. As the names imply, the former is much slower than the latter. Both hash a contiguous buffer. Cryptonight is used for PoW and KDF, while Keccak is used for everything else.

tree_hash is a merkle tree hasher: it works on a binary tree of hashes, and uses cn_fast_hash for the actual buffer hashing.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.