Documentation ¶
Index ¶
- Constants
- func IsLowS(s *big.Int) bool
- func MarshalECDSASignature(r, s *big.Int) ([]byte, error)
- func SerializePrivateKey(p *ecdsa.PrivateKey) []byte
- func SerializePublicKey(p *ecdsa.PublicKey) []byte
- func ToLowS(k *ecdsa.PublicKey, s *big.Int) *big.Int
- func UnmarshalECDSASignature(raw []byte) (*big.Int, *big.Int, error)
- type Driver
- type PrivKeyECDSA
- type PubKeyECDSA
- type SignatureECDSA
- type SignatureS
Constants ¶
const ID = 257
ID id
const Name = "auth_ecdsa"
Name name
Variables ¶
This section is empty.
Functions ¶
func MarshalECDSASignature ¶
MarshalECDSASignature marshal ECDSA signature
func SerializePrivateKey ¶
func SerializePrivateKey(p *ecdsa.PrivateKey) []byte
SerializePrivateKey serialize private key
func SerializePublicKey ¶
SerializePublicKey serialize public key
Types ¶
type Driver ¶
type Driver struct{}
Driver driver
func (Driver) PrivKeyFromBytes ¶
PrivKeyFromBytes create private key from bytes
func (Driver) PubKeyFromBytes ¶
PubKeyFromBytes create public key from bytes
type PrivKeyECDSA ¶
type PrivKeyECDSA [privateKeyECDSALength]byte
PrivKeyECDSA PrivKey
func (PrivKeyECDSA) Equals ¶
func (privKey PrivKeyECDSA) Equals(other crypto.PrivKey) bool
Equals check privkey is equal
func (PrivKeyECDSA) PubKey ¶
func (privKey PrivKeyECDSA) PubKey() crypto.PubKey
PubKey convert to public key
type PubKeyECDSA ¶
type PubKeyECDSA [publicKeyECDSALength]byte
PubKeyECDSA PubKey prefixed with 0x02 or 0x03, depending on the y-cord.
func (PubKeyECDSA) Equals ¶
func (pubKey PubKeyECDSA) Equals(other crypto.PubKey) bool
Equals check public key is equal
func (PubKeyECDSA) KeyString ¶
func (pubKey PubKeyECDSA) KeyString() string
KeyString Must return the full bytes in hex. Used for map keying, etc.
func (PubKeyECDSA) VerifyBytes ¶
func (pubKey PubKeyECDSA) VerifyBytes(msg []byte, sig crypto.Signature) bool
VerifyBytes verify signature
type SignatureECDSA ¶
type SignatureECDSA []byte
SignatureECDSA Signature
func (SignatureECDSA) Bytes ¶
func (sig SignatureECDSA) Bytes() []byte
Bytes convert signature to bytes
func (SignatureECDSA) Equals ¶
func (sig SignatureECDSA) Equals(other crypto.Signature) bool
Equals check signature equals
func (SignatureECDSA) IsZero ¶
func (sig SignatureECDSA) IsZero() bool
IsZero check signature is zero
func (SignatureECDSA) String ¶
func (sig SignatureECDSA) String() string
String convert signature to string