Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it possible to use EIP-192 precompile? #1

Open
k06a opened this issue May 3, 2021 · 3 comments
Open

Is it possible to use EIP-192 precompile? #1

k06a opened this issue May 3, 2021 · 3 comments

Comments

@k06a
Copy link

k06a commented May 3, 2021

Is it possible to use EIP-192 precompiled smart contract to make verification even cheaper? https://github.com/ethereum/EIPs/blob/master/EIPS/eip-198.md

Rationale

This allows for efficient RSA verification inside of the EVM, as well as other forms of number theory-based cryptography. Note that adding precompiles for addition and subtraction is not required, as the in-EVM algorithm is efficient enough, and multiplication can be done through this precompile via a * b = ((a + b)**2 - (a - b)**2) / 4.

The bit-based exponent calculation is done specifically to fairly charge for the often-used exponents of 2 (for multiplication) and 3 and 65537 (for RSA verification).

@kilic
Copy link
Owner

kilic commented May 3, 2021

It is already in use for modular exponentiations see here and here

@k06a
Copy link
Author

k06a commented May 3, 2021

@kilic I meant it could be used for mul2048()

@k06a
Copy link
Author

k06a commented May 3, 2021

@kilic also you could try to use uint256[8] instead of bytes it is stored similar way but without length prefix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants