Versions in this module Expand all Collapse all v0 v0.0.5 Aug 13, 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 BigIntPointToEncodedBytes(x *big.Int, y *big.Int) *[32]byte + func BigIntToEncodedBytes(a *big.Int) *[32]byte + func BigIntToEncodedBytesNoReverse(a *big.Int) *[32]byte + func BigIntToFieldElement(a *big.Int) *edwards25519.FieldElement + func Decrypt(curve *TwistedEdwardsCurve, priv *PrivateKey, in []byte) ([]byte, error) + func EncodedBytesToBigInt(s *[32]byte) *big.Int + func EncodedBytesToBigIntNoReverse(s *[32]byte) *big.Int + func EncodedBytesToFieldElement(s *[32]byte) *edwards25519.FieldElement + func Encrypt(curve *TwistedEdwardsCurve, pubkey *PublicKey, in []byte) ([]byte, error) + func FieldElementToBigInt(fe *edwards25519.FieldElement) *big.Int + func FieldElementToEncodedBytes(fe *edwards25519.FieldElement) *[32]byte + func GenerateKey(curve *TwistedEdwardsCurve, rand io.Reader) (priv []byte, x, y *big.Int, err error) + func GenerateNoncePair(curve *TwistedEdwardsCurve, msg []byte, privkey *PrivateKey, extra []byte, ...) (*PrivateKey, *PublicKey, error) + func GenerateSharedSecret(privkey *PrivateKey, pubkey *PublicKey) []byte + func Marshal(curve TwistedEdwardsCurve, x, y *big.Int) []byte + func NonceRFC6979(curve *TwistedEdwardsCurve, privkey *big.Int, hash []byte, extra []byte, ...) *big.Int + func PrivKeyFromBytes(curve *TwistedEdwardsCurve, pkBytes []byte) (*PrivateKey, *PublicKey) + func PrivKeyFromScalar(curve *TwistedEdwardsCurve, p []byte) (*PrivateKey, *PublicKey, error) + func PrivKeyFromSecret(curve *TwistedEdwardsCurve, s []byte) (*PrivateKey, *PublicKey) + func ScalarAdd(a, b *big.Int) *big.Int + func SchnorrPartialSign(curve *TwistedEdwardsCurve, msg []byte, priv *PrivateKey, groupPub *PublicKey, ...) (*big.Int, *big.Int, error) + func Sign(curve *TwistedEdwardsCurve, priv *PrivateKey, hash []byte) (r, s *big.Int, err error) + func SignFromScalar(curve *TwistedEdwardsCurve, 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(curve *TwistedEdwardsCurve, priv *PrivateKey, groupPub *PublicKey, hash []byte, ...) (r, s *big.Int, err error) + func Unmarshal(curve *TwistedEdwardsCurve, data []byte) (x, y *big.Int) + func Verify(pub *PublicKey, hash []byte, r, s *big.Int) bool + type PrivateKey struct + func GeneratePrivateKey(curve *TwistedEdwardsCurve) (*PrivateKey, error) + func NewPrivateKey(curve *TwistedEdwardsCurve, 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) ToECDSA() *ecdsa.PrivateKey + type PublicKey ecdsa.PublicKey + func CombinePubkeys(curve *TwistedEdwardsCurve, pks []*PublicKey) *PublicKey + func NewPublicKey(curve *TwistedEdwardsCurve, x *big.Int, y *big.Int) *PublicKey + func ParsePubKey(curve *TwistedEdwardsCurve, 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(curve *TwistedEdwardsCurve, sigStr []byte) (*Signature, error) + func ParseSignature(curve *TwistedEdwardsCurve, sigStr []byte) (*Signature, error) + func SchnorrCombineSigs(curve *TwistedEdwardsCurve, sigs []*Signature) (*Signature, error) + 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) EncodedBytesToBigIntPoint(s *[32]byte) (*big.Int, *big.Int, error) + func (curve *TwistedEdwardsCurve) InitParam25519() + func (curve *TwistedEdwardsCurve) IsOnCurve(x *big.Int, y *big.Int) bool + func (curve *TwistedEdwardsCurve) RecoverXBigInt(xIsNeg bool, y *big.Int) *big.Int + func (curve *TwistedEdwardsCurve) RecoverXFieldElement(xIsNeg bool, y *edwards25519.FieldElement) *edwards25519.FieldElement + 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