Documentation ¶
Overview ¶
Package secp256k1 secp256k1系统加密包
Index ¶
Constants ¶
View Source
const ( Name = "secp256k1" ID = 1 )
const
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Driver ¶
type Driver struct{}
Driver 驱动
func (Driver) PrivKeyFromBytes ¶
PrivKeyFromBytes 字节转为私钥
func (Driver) PubKeyFromBytes ¶
PubKeyFromBytes 字节转为公钥
type PrivKeySecp256k1 ¶
type PrivKeySecp256k1 [32]byte
PrivKeySecp256k1 PrivKey
func (PrivKeySecp256k1) Equals ¶
func (privKey PrivKeySecp256k1) Equals(other crypto.PrivKey) bool
Equals 私钥是否相等
func (PrivKeySecp256k1) PubKey ¶
func (privKey PrivKeySecp256k1) PubKey() crypto.PubKey
PubKey 私钥生成公钥
func (PrivKeySecp256k1) Sign ¶
func (privKey PrivKeySecp256k1) Sign(msg []byte) crypto.Signature
Sign 签名
func (PrivKeySecp256k1) String ¶
func (privKey PrivKeySecp256k1) String() string
type PubKeySecp256k1 ¶
type PubKeySecp256k1 [33]byte
PubKeySecp256k1 Compressed pubkey (just the x-cord), prefixed with 0x02 or 0x03, depending on the y-cord.
func (PubKeySecp256k1) Equals ¶
func (pubKey PubKeySecp256k1) Equals(other crypto.PubKey) bool
Equals 公钥相等
func (PubKeySecp256k1) KeyString ¶
func (pubKey PubKeySecp256k1) KeyString() string
KeyString Must return the full bytes in hex. Used for map keying, etc.
func (PubKeySecp256k1) String ¶
func (pubKey PubKeySecp256k1) String() string
func (PubKeySecp256k1) VerifyBytes ¶
func (pubKey PubKeySecp256k1) VerifyBytes(msg []byte, sig crypto.Signature) bool
VerifyBytes 验证字节
type SignatureSecp256k1 ¶
type SignatureSecp256k1 []byte
SignatureSecp256k1 Signature
func (SignatureSecp256k1) Equals ¶
func (sig SignatureSecp256k1) Equals(other crypto.Signature) bool
Equals 相等
func (SignatureSecp256k1) String ¶
func (sig SignatureSecp256k1) String() string
Click to show internal directories.
Click to hide internal directories.