Documentation ¶
Index ¶
Constants ¶
View Source
const ( // VerifyGas is the secp256r1 elliptic curve signature verifier gas price. VerifyGas uint64 = 3450 // VerifyInputLength defines the required input length (160 bytes). VerifyInputLength = 160 )
View Source
const PrecompileAddress = "0x0000000000000000000000000000000000000100"
PrecompileAddress defines the hex address of the p256 precompiled contract.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Precompile ¶
type Precompile struct{}
Precompile secp256r1 (P256) signature verification implemented as a native contract as per EIP-7212. See https://eips.ethereum.org/EIPS/eip-7212 for details
func (Precompile) Address ¶
func (Precompile) Address() common.Address
Address defines the address of the p256 precompiled contract.
func (Precompile) RequiredGas ¶
func (p Precompile) RequiredGas(_ []byte) uint64
RequiredGas returns the static gas required to execute the precompiled contract.
func (*Precompile) Run ¶
Run executes the p256 signature verification using ECDSA.
Input data: 160 bytes of data including:
- 32 bytes of the signed data hash
- 32 bytes of the r component of the signature
- 32 bytes of the s component of the signature
- 32 bytes of the x coordinate of the public key
- 32 bytes of the y coordinate of the public key
Output data: 32 bytes of result data and error
- If the signature verification process succeeds, it returns 1 in 32 bytes format
Click to show internal directories.
Click to hide internal directories.