3

I'm reading the PearlDiver class written in the IRI.
Each 243 trits long block of the transaction is absorbed except the last one.
Now only 243 trits remain: 162 are absorbed, then the workers are initialized for the nonce search.

Just before the beginning of the "hunt", these values are hard-coded:

     midCurlStateLow[162 + 0]  = 0b1101101101101101101101101101101101101101101101101101101101101101L;
     midCurlStateHigh[162 + 0] = 0b1011011011011011011011011011011011011011011011011011011011011011L;
     midCurlStateLow[162 + 1]  = 0b1111000111111000111111000111111000111111000111111000111111000111L;
     midCurlStateHigh[162 + 1] = 0b1000111111000111111000111111000111111000111111000111111000111111L;
     midCurlStateLow[162 + 2]  = 0b0111111111111111111000000000111111111111111111000000000111111111L;
     midCurlStateHigh[162 + 2] = 0b1111111111000000000111111111111111111000000000111111111111111111L;
     midCurlStateLow[162 + 3]  = 0b1111111111000000000000000000000000000111111111111111111111111111L;
     midCurlStateHigh[162 + 3] = 0b0000000000111111111111111111111111111111111111111111111111111111L;

Why? How do they interact with the rest of the trit-bit conversions and transformations?

2

PearlDiver computes 64 hashes at once. Those hardcoded values make the hashes be distinct by initializing the fragment not affected by the incrementing routine to values which are distinct.

An example for 3 hashes:

First we have: A00000 B00000 C00000

After the first increment we get: A00100 B00100 C00100

After the second increment we get: A00200 B00200 C00200

...and so on.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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