# Where can I find a description of the CryptoNight hash algorithm?

Where can I find a description of the CryptoNight hash algorithm?

Both a thorough and ELI5 description of the hash algorithm would be appreciated

• (hello, this is my first post) in the code I see just at the beginning… > #define MEMORY (1 << 21) // 2MB scratchpad > #define ITER (1 << 20) Question… is the 2MB "chunk" fixed… or can I use an other value as well ? in the mean Time, I learned that "Monero" with 1MB already exists… it is called "aeon"… an other crypto currency. Jan 25, 2018 at 21:28

The description of the CryptoNight hash algorithm and the steps it performs can be found in the code as well as in a written file by the CryptoNote team, which can be found here. Lastly, in his blog, professor David Anderson also briefly describes the CryptoNight algorithm with an accompanying graph that illustrates it. From the blog:

This was a brilliantly designed proof-of-work function targeting the strengths of modern CPUs -- native AES encryption and fast 64 bit multipliers -- tuned to use a scratchpad exactly the size of the per-core L3 cache on Intel CPUs (about 2MB) that someone then wrapped in such a thick blanket of crap it was nearly unrecognizable until you started jumping in, tearing it apart, and putting it back together again.

Here's what it looks like without the crud (diagram shows one round): Some initial 128 bit values are determined by hashing the block state using a Keccak (sha3) variant - call them A and B. The big lookup table is also populated using that same state, mixed around using AES. Then, executed 500,000 times, are rounds of mixing as shown at the right: Use A to determine a pseudorandom location in the scratchpad, take that, mix it in, AES encrypt it (one round), use the result to determine a second location, use that in a 64 bit multiply, store it back, and repeat. Elegantly simple.

• original article here Jun 9, 2018 at 14:28

The algorithm is described in Cryptonote Standard 008.