3

I've looked at this file https://github.com/monero-project/monero/blob/master/src/crypto/slow-hash.c#L543

What does it mean when it says " CryptoNight Step 1: Use Keccak1600 to initialize the 'state' (and 'text') buffers from the data. */?"

7

The Cryptonight description by the Cryptonote team states that

First, the input is hashed using Keccak [KECCAK] with parameters b = 1600 and c = 512.

In the primitive family Keccak, b is the width of bit block of the permutation function.

Given an input bit string N, a padding function pad, a permutation function f that operates on bit blocks of width b, a rate r and an output length d, we have capacity c = b − r and the sponge construction Z = spongef,pad,r, yielding a bit string Z of length d, works as follows

This value of b is also used by SHA-3 for instance.

EDIT

Regarding your question about the location of the value 1600 in the code:

Function keccak1600 is defined as a special case of function keccak with parameter mdlen equal to the size in bits of the type state_t. This type is an array of 25 uint64_t so the total size is 25*64=1600.

  • Sorry, I am new to programming, so I put that where in this script? hash_process(&state.hs, data, length); memcpy(text, state.init, INIT_SIZE_BYTE); – user168783 Jan 2 '18 at 17:44
  • I replied by editing the answer. Please accept the answer if you think it solve your problem. – Clement J. Jan 2 '18 at 18:17

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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