Versions in this module Expand all Collapse all v3 deprecated v3.0.1 Jun 10, 2023 v3.0.0 Jul 14, 2020 Changes in this version + const PrivKeyBytesLen + const PubKeyBytesLenCompressed + const PubKeyBytesLenUncompressed + const PubKeyFormatCompressedEven + const PubKeyFormatCompressedOdd + const PubKeyFormatHybridEven + const PubKeyFormatHybridOdd + const PubKeyFormatUncompressed + func AddNonConst(p1, p2, result *JacobianPoint) + func DecompressY(x *FieldVal, odd bool, resultY *FieldVal) bool + func DoubleNonConst(p, result *JacobianPoint) + func GenerateSharedSecret(privkey *PrivateKey, pubkey *PublicKey) []byte + func ScalarBaseMultNonConst(k *ModNScalar, result *JacobianPoint) + func ScalarMultNonConst(k *ModNScalar, point, result *JacobianPoint) + type CurveParams struct + BitSize int + ByteSize int + Gx *big.Int + Gy *big.Int + H int + N *big.Int + P *big.Int + func Params() *CurveParams + type Error struct + Description string + ErrorCode ErrorCode + func (e Error) Error() string + func (e Error) Is(target error) bool + func (e Error) Unwrap() error + type ErrorCode int + const ErrPubKeyInvalidFormat + const ErrPubKeyInvalidLen + const ErrPubKeyMismatchedOddness + const ErrPubKeyNotOnCurve + const ErrPubKeyXTooBig + const ErrPubKeyYTooBig + func (e ErrorCode) Error() string + func (e ErrorCode) Is(target error) bool + func (e ErrorCode) String() string + type FieldVal struct + func (f *FieldVal) Add(val *FieldVal) *FieldVal + func (f *FieldVal) Add2(val *FieldVal, val2 *FieldVal) *FieldVal + func (f *FieldVal) AddInt(ui uint16) *FieldVal + func (f *FieldVal) Bytes() *[32]byte + func (f *FieldVal) Equals(val *FieldVal) bool + func (f *FieldVal) Inverse() *FieldVal + func (f *FieldVal) IsGtOrEqPrimeMinusOrder() bool + func (f *FieldVal) IsOdd() bool + func (f *FieldVal) IsOddBit() uint32 + func (f *FieldVal) IsOne() bool + func (f *FieldVal) IsOneBit() uint32 + func (f *FieldVal) IsZero() bool + func (f *FieldVal) IsZeroBit() uint32 + func (f *FieldVal) Mul(val *FieldVal) *FieldVal + func (f *FieldVal) Mul2(val *FieldVal, val2 *FieldVal) *FieldVal + func (f *FieldVal) MulInt(val uint8) *FieldVal + func (f *FieldVal) Negate(magnitude uint32) *FieldVal + func (f *FieldVal) NegateVal(val *FieldVal, magnitude uint32) *FieldVal + func (f *FieldVal) Normalize() *FieldVal + func (f *FieldVal) PutBytes(b *[32]byte) + func (f *FieldVal) PutBytesUnchecked(b []byte) + func (f *FieldVal) Set(val *FieldVal) *FieldVal + func (f *FieldVal) SetByteSlice(b []byte) bool + func (f *FieldVal) SetBytes(b *[32]byte) uint32 + func (f *FieldVal) SetInt(ui uint16) *FieldVal + func (f *FieldVal) Square() *FieldVal + func (f *FieldVal) SquareRootVal(val *FieldVal) bool + func (f *FieldVal) SquareVal(val *FieldVal) *FieldVal + func (f *FieldVal) Zero() + func (f FieldVal) String() string + type JacobianPoint struct + X FieldVal + Y FieldVal + Z FieldVal + func MakeJacobianPoint(x, y, z *FieldVal) JacobianPoint + func (p *JacobianPoint) Set(other *JacobianPoint) + func (p *JacobianPoint) ToAffine() + type KoblitzCurve struct + 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) ScalarBaseMult(k []byte) (*big.Int, *big.Int) + func (curve *KoblitzCurve) ScalarMult(Bx, By *big.Int, k []byte) (*big.Int, *big.Int) + type ModNScalar struct + func NonceRFC6979(privKey []byte, hash []byte, extra []byte, version []byte, ...) *ModNScalar + func (s *ModNScalar) Add(val *ModNScalar) *ModNScalar + func (s *ModNScalar) Add2(val1, val2 *ModNScalar) *ModNScalar + func (s *ModNScalar) Bytes() [32]byte + func (s *ModNScalar) Equals(val *ModNScalar) bool + func (s *ModNScalar) InverseNonConst() *ModNScalar + func (s *ModNScalar) InverseValNonConst(val *ModNScalar) *ModNScalar + func (s *ModNScalar) IsOdd() bool + func (s *ModNScalar) IsOverHalfOrder() bool + func (s *ModNScalar) IsZero() bool + func (s *ModNScalar) Mul(val *ModNScalar) *ModNScalar + func (s *ModNScalar) Mul2(val, val2 *ModNScalar) *ModNScalar + func (s *ModNScalar) Negate() *ModNScalar + func (s *ModNScalar) NegateVal(val *ModNScalar) *ModNScalar + func (s *ModNScalar) PutBytes(b *[32]byte) + func (s *ModNScalar) PutBytesUnchecked(b []byte) + func (s *ModNScalar) Set(val *ModNScalar) *ModNScalar + func (s *ModNScalar) SetByteSlice(b []byte) bool + func (s *ModNScalar) SetBytes(b *[32]byte) uint32 + func (s *ModNScalar) SetInt(ui uint32) *ModNScalar + func (s *ModNScalar) Square() *ModNScalar + func (s *ModNScalar) SquareVal(val *ModNScalar) *ModNScalar + func (s *ModNScalar) Zero() + func (s ModNScalar) String() string + type PrivateKey struct + Key ModNScalar + func GeneratePrivateKey() (*PrivateKey, error) + func NewPrivateKey(key *ModNScalar) *PrivateKey + func PrivKeyFromBytes(privKeyBytes []byte) *PrivateKey + func (p *PrivateKey) PubKey() *PublicKey + func (p *PrivateKey) ToECDSA() *ecdsa.PrivateKey + func (p *PrivateKey) Zero() + func (p PrivateKey) Serialize() []byte + type PublicKey struct + func NewPublicKey(x, y *FieldVal) *PublicKey + func ParsePubKey(serialized []byte) (key *PublicKey, err error) + func (p *PublicKey) AsJacobian(result *JacobianPoint) + func (p *PublicKey) IsEqual(otherPubKey *PublicKey) bool + func (p *PublicKey) IsOnCurve() bool + func (p *PublicKey) ToECDSA() *ecdsa.PublicKey + func (p *PublicKey) X() *big.Int + func (p *PublicKey) Y() *big.Int + func (p PublicKey) SerializeCompressed() []byte + func (p PublicKey) SerializeUncompressed() []byte Other modules containing this package github.com/decred/dcrd/dcrec/secp256k1 github.com/decred/dcrd/dcrec/secp256k1/v2 github.com/decred/dcrd/dcrec/secp256k1/v4