Versions in this module Expand all Collapse all v1 v1.9.25 Mar 25, 2021 v1.9.24 Mar 24, 2021 Changes in this version + const PrivKeyBytesLen + const PubKeyBytesLenCompressed + const PubKeyBytesLenHybrid + const PubKeyBytesLenUncompressed + var D logg.LevelPrinter = logg.GetLogPrinterSet(subsystem) + var E logg.LevelPrinter = logg.GetLogPrinterSet(subsystem) + var ErrInvalidMAC = errors.New("invalid mac hash") + var F logg.LevelPrinter = logg.GetLogPrinterSet(subsystem) + var I logg.LevelPrinter = logg.GetLogPrinterSet(subsystem) + var T logg.LevelPrinter = logg.GetLogPrinterSet(subsystem) + var W logg.LevelPrinter = logg.GetLogPrinterSet(subsystem) + func Decrypt(priv *PrivateKey, in []byte) (b []byte, e error) + func Encrypt(pubkey *PublicKey, in []byte) (out []byte, e error) + func GenerateSharedSecret(privkey *PrivateKey, pubkey *PublicKey) []byte + func IsCompressedPubKey(pubKey []byte) bool + func NAF(k []byte) ([]byte, []byte) + func PrivKeyFromBytes(curve elliptic.Curve, pk []byte) (*PrivateKey, *PublicKey) + func SignCompact(curve *KoblitzCurve, key *PrivateKey, hash []byte, isCompressedKey bool) (sh []byte, e 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 NewPrivateKey(curve elliptic.Curve) (pk *PrivateKey, e error) + func (p *PrivateKey) PubKey() *PublicKey + func (p *PrivateKey) Serialize() []byte + func (p *PrivateKey) Sign(hash []byte) (*Signature, error) + func (p *PrivateKey) ToECDSA() *ecdsa.PrivateKey + type PublicKey ecdsa.PublicKey + func ParsePubKey(pubKeyStr []byte, curve *KoblitzCurve) (key *PublicKey, e error) + func RecoverCompact(curve *KoblitzCurve, signature, hash []byte) (key *PublicKey, b bool, e error) + func (p *PublicKey) IsEqual(otherPubKey *PublicKey) bool + func (p *PublicKey) SerializeCompressed() []byte + func (p *PublicKey) SerializeHybrid() []byte + func (p *PublicKey) SerializeUncompressed() []byte + func (p *PublicKey) ToECDSA() *ecdsa.PublicKey + type Signature struct + R *big.Int + S *big.Int + func ParseDERSignature(sigStr []byte, curve elliptic.Curve) (*Signature, error) + func ParseSignature(sigStr []byte, curve elliptic.Curve) (*Signature, error) + func (sig *Signature) IsEqual(otherSig *Signature) bool + func (sig *Signature) Serialize() []byte + func (sig *Signature) Verify(hash []byte, pubKey *PublicKey) bool