Documentation ¶
Index ¶
- Constants
- func CaculCoinsEvmAccountKey(addr string) []byte
- func GetEvmChainID() int64
- type Driver
- func (d Driver) GenKey() (crypto.PrivKey, error)
- func (d Driver) PrivKeyFromBytes(b []byte) (crypto.PrivKey, error)
- func (d Driver) PubKeyFromBytes(b []byte) (crypto.PubKey, error)
- func (d Driver) SignatureFromBytes(b []byte) (crypto.Signature, error)
- func (d Driver) Validate(msg, pub, sig []byte) error
- type PrivKeySecp256k1Eth
- type PubKeySecp256k1Eth
- type SignatureS
- type SignatureSecp256k1Eth
Constants ¶
View Source
const ( Name = "secp256k1eth" ID = 260 )
const
Variables ¶
This section is empty.
Functions ¶
func CaculCoinsEvmAccountKey ¶
CaculCoinsEvmAccountKey 兼容eth 账户的nonce 的key
Types ¶
type Driver ¶
type Driver struct{}
Driver 驱动
func (Driver) PrivKeyFromBytes ¶
PrivKeyFromBytes 字节转为私钥
func (Driver) PubKeyFromBytes ¶
PubKeyFromBytes must 65 bytes uncompress key
func (Driver) SignatureFromBytes ¶
SignatureFromBytes 对字节数组签名
type PrivKeySecp256k1Eth ¶
type PrivKeySecp256k1Eth [32]byte
PrivKeySecp256k1Eth PrivKey
func (PrivKeySecp256k1Eth) Equals ¶
func (privKey PrivKeySecp256k1Eth) Equals(other crypto.PrivKey) bool
Equals 私钥是否相等
func (PrivKeySecp256k1Eth) PubKey ¶
func (privKey PrivKeySecp256k1Eth) PubKey() crypto.PubKey
PubKey 私钥生成公钥 非压缩 65 bytes 0x04+pub.X+pub.Y
func (PrivKeySecp256k1Eth) Sign ¶
func (privKey PrivKeySecp256k1Eth) Sign(msg []byte) crypto.Signature
Sign 签名 The produced signature is in the [R || S || V] format where V is 0 or 1.
func (PrivKeySecp256k1Eth) String ¶
func (privKey PrivKeySecp256k1Eth) String() string
type PubKeySecp256k1Eth ¶
type PubKeySecp256k1Eth [65]byte
PubKeySecp256k1Eth uncompressed pubkey (just the x-cord), prefixed with 0x04
func (PubKeySecp256k1Eth) Equals ¶
func (pubKey PubKeySecp256k1Eth) Equals(other crypto.PubKey) bool
Equals 公钥相等
func (PubKeySecp256k1Eth) KeyString ¶
func (pubKey PubKeySecp256k1Eth) KeyString() string
KeyString Must return the full bytes in hex. Used for map keying, etc.
func (PubKeySecp256k1Eth) String ¶
func (pubKey PubKeySecp256k1Eth) String() string
func (PubKeySecp256k1Eth) VerifyBytes ¶
func (pubKey PubKeySecp256k1Eth) VerifyBytes(msg []byte, sig crypto.Signature) bool
VerifyBytes 验证字节
type SignatureSecp256k1Eth ¶
type SignatureSecp256k1Eth []byte
SignatureSecp256k1Eth Signature
func (SignatureSecp256k1Eth) Equals ¶
func (sig SignatureSecp256k1Eth) Equals(other crypto.Signature) bool
Equals 相等
func (SignatureSecp256k1Eth) String ¶
func (sig SignatureSecp256k1Eth) String() string
Click to show internal directories.
Click to hide internal directories.