Ether Binder
Set of utilities for interacting with Ethereum and it's smart contracts with PHP, with generating ABI bindings and Ethereum-related types
Loading...
Searching...
No Matches
M8B\EtherBinder\Crypto\EC Class Reference

Static Public Member Functions

static Recover (Hash $hash, OOGmp $r, OOGmp $s, OOGmp $v)
 
static keyFromPrivate (#[SensitiveParameter] string $key)
 
static EC ()
 

Detailed Description

EC is a wrapper class for Elliptic Curve operations, specifically secp256k1 which is one specifically used for Ethereum. Internally it statically caches EC object, as it's instantiation has high runtime cost.

Author
DubbaThony

Member Function Documentation

◆ EC()

static M8B\EtherBinder\Crypto\EC::EC ( )
static

Returns the underlying cached Elliptic\EC context.

Returns
\Elliptic\EC The Elliptic\EC context.

◆ keyFromPrivate()

static M8B\EtherBinder\Crypto\EC::keyFromPrivate ( # string $key[SensitiveParameter])
static

Creates a KeyPair object from a private key.

Parameters
string$keyHex-encoded private key.
Returns
KeyPair Elliptic Curve KeyPair.

◆ Recover()

static M8B\EtherBinder\Crypto\EC::Recover ( Hash $hash,
OOGmp $r,
OOGmp $s,
OOGmp $v )
static

Recovers the Ethereum Address from a hash and signature parameters.

Parameters
Hash$hashHash object to be verified.
OOGmp$rThe 'r' part of the signature.
OOGmp$sThe 's' part of the signature.
OOGmp$vThe 'v' part of the signature.
Returns
Address The Ethereum address.
Exceptions
EthBinderRuntimeException
EthBinderLogicException

The documentation for this class was generated from the following file: