Versions in this module Expand all Collapse all v2 v2.0.3 Jul 30, 2022 v2.0.2 Dec 24, 2020 v2.0.1 Mar 27, 2020 v2.0.0 Sep 5, 2019 Changes in this version + const PrivKeyBytesLen + const PrivScalarSize + const PubKeyBytesLen + const SignatureSize + var ErrInvalidMAC = errors.New("invalid mac hash") + var Sha512VersionStringRFC6979 = []byte("Edwards+SHA512 ") + 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 NonceRFC6979(privkey *big.Int, hash []byte, extra []byte, version []byte) *big.Int + func PrivKeyFromBytes(pkBytes []byte) (*PrivateKey, *PublicKey) + func PrivKeyFromScalar(p []byte) (*PrivateKey, *PublicKey, error) + func PrivKeyFromSecret(s []byte) (*PrivateKey, *PublicKey) + func Sign(priv *PrivateKey, hash []byte) (r, s *big.Int, err error) + func SignFromScalar(priv *PrivateKey, nonce []byte, hash []byte) (r, s *big.Int, err error) + func SignFromSecret(rand io.Reader, priv *PrivateKey, hash []byte) (r, s *big.Int, err error) + func SignFromSecretNoReader(priv *PrivateKey, hash []byte) (r, s *big.Int, err error) + func SignThreshold(priv *PrivateKey, groupPub *PublicKey, hash []byte, privNonce *PrivateKey, ...) (r, s *big.Int, err error) + func Verify(pub *PublicKey, hash []byte, r, s *big.Int) bool + type PrivateKey struct + func GeneratePrivateKey() (*PrivateKey, error) + func NewPrivateKey(d *big.Int) *PrivateKey + func (p *PrivateKey) PubKey() *PublicKey + 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 + func (p PrivateKey) Sign(hash []byte) (*Signature, error) + func (p PrivateKey) ToECDSA() *ecdsa.PrivateKey + 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) 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) Verify(hash []byte, pubKey *PublicKey) bool + func (sig Signature) GetR() *big.Int + func (sig Signature) GetS() *big.Int + func (sig Signature) GetType() int + func (sig Signature) Serialize() []byte + type TwistedEdwardsCurve struct + A *big.Int + D *big.Int + H int + I *big.Int + func Edwards() *TwistedEdwardsCurve + func (curve *TwistedEdwardsCurve) Add(x1, y1, x2, y2 *big.Int) (x, y *big.Int) + func (curve *TwistedEdwardsCurve) Double(x1, y1 *big.Int) (x, y *big.Int) + func (curve *TwistedEdwardsCurve) IsOnCurve(x *big.Int, y *big.Int) bool + func (curve *TwistedEdwardsCurve) ScalarBaseMult(k []byte) (x, y *big.Int) + func (curve *TwistedEdwardsCurve) ScalarMult(x1, y1 *big.Int, k []byte) (x, y *big.Int) + func (curve TwistedEdwardsCurve) Params() *elliptic.CurveParams Other modules containing this package github.com/decred/dcrd/dcrec/edwards