I am trying to measure the cycles per byte for $\mathop{SHA-3}$ reference implementation. I am using recommendations from Microsoft querying the performance counter. As you can see in the first snippet, cycles are measured before converting into microseconds. My code looks like the following:
QueryPerformanceCounter(&StartingTime);
SHA3_256(K_OUT, K_IN, length);
QueryPerformanceCounter(&EndingTime);
ElapsedMicroseconds.QuadPart = EndingTime.QuadPart - StartingTime.QuadPart;
printf("Elapsed ticks: %.20f \n", ElapsedMicroseconds.QuadPart / (float)(length));
But the results are definitively wrong. It is mostly something smaller than $0.9$. I would guess a value around $30$ Cycles per Byte. What am I doing wrong?
QueryPerformanceFrequency(&Frequency);
is useless in your case. $\endgroup$ – Biv Oct 30 '16 at 11:52