Versions in this module Expand all Collapse all v0 v0.0.6 Sep 22, 2021 v0.0.5 Sep 22, 2021 v0.0.4 Sep 22, 2021 v0.0.3 Sep 22, 2021 v0.0.2 Sep 22, 2021 Changes in this version + const PrivKeyBytesLen + const PubKeyBytesLenCompressed + const PubKeyBytesLenHybrid + 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 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) ([]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 Multiset struct + func NewMultiset(curve *KoblitzCurve) *Multiset + func NewMultisetFromPoint(curve *KoblitzCurve, x, y *big.Int) *Multiset + func (ms *Multiset) Add(data []byte) + func (ms *Multiset) Hash() chainhash.Hash + func (ms *Multiset) Merge(otherMultiset *Multiset) + func (ms *Multiset) Point() (x *big.Int, y *big.Int) + func (ms *Multiset) Remove(data []byte) + type PrivateKey ecdsa.PrivateKey + func NewPrivateKey(curve elliptic.Curve) (*PrivateKey, error) + func (p *PrivateKey) PubKey() *PublicKey + func (p *PrivateKey) Serialize() []byte + func (p *PrivateKey) SignECDSA(hash []byte) (*Signature, error) + func (p *PrivateKey) SignSchnorr(hash []byte) (*Signature, error) + func (p *PrivateKey) ToECDSA() *ecdsa.PrivateKey + type PublicKey ecdsa.PublicKey + func AggregatePublicKeys(keys ...*PublicKey) (*PublicKey, error) + func ParsePubKey(pubKeyStr []byte, curve *KoblitzCurve) (key *PublicKey, err error) + func RecoverCompact(curve *KoblitzCurve, signature, hash []byte) (*PublicKey, bool, 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 Session struct + func NewMuSession(pubKeys []*PublicKey, privKey *PrivateKey, sessionID [32]byte) (*Session, error) + func (sess *Session) AggregatePublicKey() *PublicKey + func (sess *Session) AggregateSignature(svals ...*big.Int) *Signature + func (sess *Session) Nonce() (*PublicKey, error) + func (sess *Session) NonceCommitment(message []byte) []byte + func (sess *Session) SetNonceCommitments(nonceCommitments ...[]byte) + func (sess *Session) SetNonces(noncePubkeys ...*PublicKey) error + func (sess *Session) Sign(hash []byte) (*big.Int, error) + type Signature struct + R *big.Int + S *big.Int + func ParseBERSignature(sigStr []byte, curve elliptic.Curve) (*Signature, error) + func ParseDERSignature(sigStr []byte, curve elliptic.Curve) (*Signature, error) + func ParseSchnorrSignature(sigStr []byte) (*Signature, error) + func SignMuSig(hash []byte, keys ...*PrivateKey) (*Signature, error) + func (sig *Signature) IsEqual(otherSig *Signature) bool + func (sig *Signature) Serialize() []byte + func (sig *Signature) Verify(hash []byte, pubKey *PublicKey) bool + type SignatureType uint8 + const SignatureTypeECDSA + const SignatureTypeSchnorr