Documentation ¶
Overview ¶
Package evmprecompiles implements the Ethereum VM precompile contracts.
This package collects all the precompile functions into a single location for easier integration. The main functionality is implemented elsewhere. This package right now implements:
- ECRECOVER ✅ -- function ECRecover
- SHA256 ❌ -- in progress
- RIPEMD160 ❌ -- postponed
- ID ❌ -- trivial to implement without function
- EXPMOD ❌ -- in progress
- BN_ADD ✅ -- function ECAdd
- BN_MUL ✅ -- function ECMul
- SNARKV ✅ -- function ECPair
- BLAKE2F ❌ -- postponed
This package uses local representation for the arguments. It is up to the user to instantiate corresponding types from their application-specific data.
Index ¶
- func ECAdd(api frontend.API, P, Q *sw_emulated.AffinePoint[emulated.BN254Fp]) *sw_emulated.AffinePoint[emulated.BN254Fp]
- func ECMul(api frontend.API, P *sw_emulated.AffinePoint[emulated.BN254Fp], ...) *sw_emulated.AffinePoint[emulated.BN254Fp]
- func ECPair(api frontend.API, P []*sw_bn254.G1Affine, Q []*sw_bn254.G2Affine)
- func ECRecover(api frontend.API, msg emulated.Element[emulated.Secp256k1Fr], ...) *sw_emulated.AffinePoint[emulated.Secp256k1Fp]
- func GetHints() []solver.Hint
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ECAdd ¶
func ECAdd(api frontend.API, P, Q *sw_emulated.AffinePoint[emulated.BN254Fp]) *sw_emulated.AffinePoint[emulated.BN254Fp]
ECAdd implements ALT_BN128_ADD precompile contract at address 0x06.
func ECMul ¶
func ECMul(api frontend.API, P *sw_emulated.AffinePoint[emulated.BN254Fp], u *emulated.Element[emulated.BN254Fr]) *sw_emulated.AffinePoint[emulated.BN254Fp]
ECMul implements ALT_BN128_MUL precompile contract at address 0x07.
func ECRecover ¶
func ECRecover(api frontend.API, msg emulated.Element[emulated.Secp256k1Fr], v frontend.Variable, r, s emulated.Element[emulated.Secp256k1Fr], strictRange frontend.Variable) *sw_emulated.AffinePoint[emulated.Secp256k1Fp]
ECRecover implements ECRECOVER precompile contract at address 0x01.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.