Thanks to the introduction of EIP 198, RSA signature verification is now feasible in Ethereum.
How much gas is required for such a verification?
Thanks to the introduction of EIP 198, RSA signature verification is now feasible in Ethereum.
How much gas is required for such a verification?
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 = 22853376gas in the worst case, though RSA verification in practice usually uses an exponent of 3 or 65537, which would reduce the gas consumption to5580or89292, 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.