Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

I am doing some research for which I intend to insert some (external) function i

ID: 651734 • Letter: I

Question

I am doing some research for which I intend to insert some (external) function in different cryptographic hash functions and I would like to analyse how the insertion of this extra code in the hash function affects its performance, especially its speed in hashing and any other performance measures.

I came across SUPERCOP and SMHasher (a test suite for non-cryptographic hash functions) but I have no idea whatsoever how to go about using either.

Anyone have any idea how any of these tools is used? Otherwise, does anyone know any other tool which I can use and how it is used?

Thanks in advance for your help.

Edit: My code is written in C under Linux.

Explanation / Answer

The performance can be configuration specific, so beware that any outcome is specific to a machine. Take care that you test on the right configuration(s).

The performance may also be specific to a certain input size. So test for specific amounts of data while keeping in mind that most hash methods operate on blocks (it doesn't make much sense to test 1 byte input and then 2 byte input, one block will be hashed regardless).

You don't need a lot more than a timer to measure such performance. First do x rounds of hashing just to make sure you are not left with startup flukes (hash code not loaded in cache of CPU yet). Note that this is specifically required when running on a VM. So for C / Linux it may not be that relevant - you can choose a smaller x.

Now let it run n rounds, divide by n. Choose a large number for n. That's about it.