5

Thanks to the introduction of EIP 198, RSA signature verification is now feasible in Ethereum.

How much gas is required for such a verification?

1 Answer 1

3

You can read about it here: https://github.com/ethereum/EIPs/blob/master/EIPS/eip-198.md

A 4096-bit RSA exponentiation would cost mult_complexity(512) * 4095 / 100 = 22853376 gas in the worst case, though RSA verification in practice usually uses an exponent of 3 or 65537, which would reduce the gas consumption to 5580 or89292, respectively.


According with the first example of the EIP, the function modExp() implemented here and the inputs:

0x03
0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2e
0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f

the execution cost was 14248 gas.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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