# How do I convert KECCAK-256 to FLOPS? (Ethereum)

I wanted to know how much one Ethereum KECCAK-256(hash) is in FLOPS. I know bitcoin is 12,697 flops per hash.

• keccak and bitcoin do not use algorithms based on floating point math, they use integer math – Richie Frame Jun 15 '18 at 23:34
• FLOPS is floating point operations per second, so it makes no sense to ask how many FLOPS a hash is. And as @RichieFrame says, these hashes operate on integers and not floating point values. – forest Jun 17 '18 at 2:54
• I have a hardware that performs 32 bit FLOPS, I wanted to calculate the hash power or what the equivalent mega hash would be. If I worded it right. @RichieFrame So what would be the math equivalent compute number? lets say if I had 1 Teraflop compute power. – Cyril Lutterodt Jun 17 '18 at 3:57
• If your question is specifically about the cost of one Keccak-256 evaluation on the EVM (or something like that), you may want to ask on Ethereum instead. – SEJPM Jun 17 '18 at 12:45

## 1 Answer

I wanted to know how much one Ethereum KECCAK-256(hash) is in FLOPS

This question question makes no sense, for multiple reasons:

• FLOPS means Floating Operations Per Second, so first we have a missmatch of units, one or mutliple operation(s) can't be compared to operations per second.
• Second Cryptography (almost) always uses integer arithmetic for its computations and not floating point operations and so the measure of floating operations per second doesn't relate at all to the computation cost of (most) cryptographic algorithms.
• If however you were to ask how many integer operations / instructions one needs, then (sometimes) cryptographers use Million Instructions Per Second (MIPS) to express the power of a particular CPU. Then you could measure how many MIPS a CPU provides and then measure the time it takes for a particular crypto algorithm to execute and then multiply these numbers to get a rough estimate for the number of instructions a given operation requires.
• Finally, usually cryptographers these days tend to measure in cycles per byte (cpb), that is, for a given CPU architecture and a given input length $l$, how many CPU cycles did it take to finish the computation of eg $H(1^l)$ and then divide this time by $l$. Examples of this style of measurements can be found here.
• If you have your own runtime environment (eg the Ethereum VM?), then the best approach to get the cost of a particular function evaluation is either to a) look it up in some documentation or on some website where somebody has already done the math b) try to count instructions and add them together with the appropriate weights or c) just measure it.
• Okay, in that case. What would be the MIPS for KECCAK-256 algorithm? – Cyril Lutterodt Jul 9 '18 at 21:18