Versions in this module Expand all Collapse all v1 v1.0.2 Sep 21, 2020 Changes in this version + const PrivKeyBytesLen + const PubKeyBytesLenCompressed + const PubKeyBytesLenUncompressed + var ErrInvalidMAC = errors.New("invalid mac hash") + func Decrypt(priv *PrivateKey, in []byte) ([]byte, error) + func Encrypt(pubkey *PublicKey, in []byte) ([]byte, error) + func GenerateKey(rand io.Reader) (priv []byte, x, y *big.Int, err error) + func GenerateSharedSecret(privkey *PrivateKey, pubkey *PublicKey) []byte + func NAF(k []byte) ([]byte, []byte) + func NonceRFC6979(privkey *big.Int, hash []byte, extra []byte, version []byte) *big.Int + func PrivKeyFromBytes(pk []byte) (*PrivateKey, *PublicKey) + func PrivKeyFromScalar(s []byte) (*PrivateKey, *PublicKey) + func SignCompact(key *PrivateKey, hash []byte, isCompressedKey bool) ([]byte, error) + type KoblitzCurve struct + H int + func S256() *KoblitzCurve + func (curve *KoblitzCurve) Add(x1, y1, x2, y2 *big.Int) (*big.Int, *big.Int) + func (curve *KoblitzCurve) Double(x1, y1 *big.Int) (*big.Int, *big.Int) + func (curve *KoblitzCurve) IsOnCurve(x, y *big.Int) bool + func (curve *KoblitzCurve) Params() *elliptic.CurveParams + func (curve *KoblitzCurve) QPlus1Div4() *big.Int + func (curve *KoblitzCurve) ScalarBaseMult(k []byte) (*big.Int, *big.Int) + func (curve *KoblitzCurve) ScalarMult(Bx, By *big.Int, k []byte) (*big.Int, *big.Int) + type PrivateKey ecdsa.PrivateKey + func GeneratePrivateKey() (*PrivateKey, error) + func NewPrivateKey(d *big.Int) *PrivateKey + func (p *PrivateKey) PubKey() *PublicKey + func (p *PrivateKey) Sign(hash []byte) (*Signature, error) + func (p *PrivateKey) ToECDSA() *ecdsa.PrivateKey + func (p PrivateKey) GetD() *big.Int + func (p PrivateKey) GetType() int + func (p PrivateKey) Public() (*big.Int, *big.Int) + func (p PrivateKey) Serialize() []byte + func (p PrivateKey) SerializeSecret() []byte + type PublicKey ecdsa.PublicKey + func NewPublicKey(x *big.Int, y *big.Int) *PublicKey + func ParsePubKey(pubKeyStr []byte) (key *PublicKey, err error) + func RecoverCompact(signature, hash []byte) (*PublicKey, bool, error) + func (p *PublicKey) IsEqual(otherPubKey *PublicKey) bool + func (p PublicKey) GetCurve() interface{} + func (p PublicKey) GetType() int + func (p PublicKey) GetX() *big.Int + func (p PublicKey) GetY() *big.Int + func (p PublicKey) Serialize() []byte + func (p PublicKey) SerializeCompressed() []byte + func (p PublicKey) SerializeUncompressed() []byte + func (p PublicKey) ToECDSA() *ecdsa.PublicKey + type Signature struct + R *big.Int + S *big.Int + func NewSignature(r, s *big.Int) *Signature + func ParseDERSignature(sigStr []byte) (*Signature, error) + func ParseSignature(sigStr []byte) (*Signature, error) + func (sig *Signature) IsEqual(otherSig *Signature) bool + func (sig *Signature) Serialize() []byte + func (sig *Signature) Verify(hash []byte, pubKey *PublicKey) bool + func (sig Signature) GetR() *big.Int + func (sig Signature) GetS() *big.Int + func (sig Signature) GetType() int