Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to calculate the time needed to calculate a SHA-256 hash?

I need to find a SHA-256 hash function delay on a device which has 200 MHz CPU speed. How could I do that, is there anyone who has the answer for much faster or slower device?

like image 578
Can Leloğlu Avatar asked Jun 12 '12 16:06

Can Leloğlu


1 Answers

The speed depends largely on the implementation and on the CPU specifics. A very rough estimate of the speed to be expected is to extrapolate cycles per byte numbers to your particular device.

The numbers do vary, but let's be conservative and assume your SHA-256 implementation takes about 25 cycles/byte. Taking the reciprocal tells you that you get 1/25 of a byte per cyle. A 200 MHz processor has 200 mio cycles per second, so this gives you a theoretical throughput of 8 mio bytes/s, which is ~ 7,63 MB/s.

But this is just a very rough guess, if you want exact numbers, then the best thing you can do is to just benchmark the whole thing yourself.

like image 186
emboss Avatar answered Sep 27 '22 20:09

emboss