Versions in this module Expand all Collapse all v1 v1.0.1 Nov 26, 2024 v1.0.0 May 11, 2024 Changes in this version + const PrivKeyBytesLen + const PrivScalarSize + const PrivateKeySize + const PubKeyBytesLen + const PublicKeySize + const SignatureSize + var A = FieldElement + var ErrInvalidMAC = errors.New("invalid mac hash") + var Sha512VersionStringRFC6979 = []byte("Edwards+SHA512 ") + var SqrtM1 = FieldElement + func Decrypt(priv *PrivateKey, in []byte) ([]byte, error) + func Encrypt(pubkey *PublicKey, in []byte) ([]byte, error) + func FeAdd(dst, a, b *FieldElement) + func FeCMove(f, g *FieldElement, b int32) + func FeCombine(h *FieldElement, h0, h1, h2, h3, h4, h5, h6, h7, h8, h9 int64) + func FeCopy(dst, src *FieldElement) + func FeFromBytes(dst *FieldElement, src *[32]byte) + func FeInvert(out, z *FieldElement) + func FeIsNegative(f *FieldElement) byte + func FeIsNonZero(f *FieldElement) int32 + func FeMul(h, f, g *FieldElement) + func FeNeg(h, f *FieldElement) + func FeOne(fe *FieldElement) + func FeSquare(h, f *FieldElement) + func FeSquare2(h, f *FieldElement) + func FeSub(dst, a, b *FieldElement) + func FeToBytes(s *[32]byte, h *FieldElement) + func FeZero(fe *FieldElement) + func GeAdd(r *CompletedGroupElement, p *ExtendedGroupElement, q *CachedGroupElement) + func GeDoubleScalarMultVartime(r *ProjectiveGroupElement, a *[32]byte, A *ExtendedGroupElement, b *[32]byte) + func GeScalarMultBase(h *ExtendedGroupElement, a *[32]byte) + func GenerateKey(rand io.Reader) (publicKey *[PublicKeySize]byte, privateKey *[PrivateKeySize]byte, err error) + func GenerateKeyXY(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 PreComputedGroupElementCMove(t, u *PreComputedGroupElement, b int32) + func PrivKeyFromBytes(pkBytes []byte) (*PrivateKey, *PublicKey) + func PrivKeyFromScalar(p []byte) (*PrivateKey, *PublicKey, error) + func PrivKeyFromSecret(s []byte) (*PrivateKey, *PublicKey) + func ScMulAdd(s, a, b, c *[32]byte) + func ScReduce(out *[32]byte, s *[64]byte) + func Sign(privateKey *[PrivateKeySize]byte, message []byte) *[SignatureSize]byte + 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 SignRS(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(publicKey *[PublicKeySize]byte, message []byte, sig *[SignatureSize]byte) bool + func VerifyRS(pub *PublicKey, hash []byte, r, s *big.Int) bool + type CachedGroupElement struct + T2d FieldElement + Z FieldElement + type CompletedGroupElement struct + T FieldElement + X FieldElement + Y FieldElement + Z FieldElement + func (p *CompletedGroupElement) ToExtended(r *ExtendedGroupElement) + func (p *CompletedGroupElement) ToProjective(r *ProjectiveGroupElement) + type ExtendedGroupElement struct + T FieldElement + X FieldElement + Y FieldElement + Z FieldElement + func (p *ExtendedGroupElement) Double(r *CompletedGroupElement) + func (p *ExtendedGroupElement) FromBytes(s *[32]byte) bool + func (p *ExtendedGroupElement) ToBytes(s *[32]byte) + func (p *ExtendedGroupElement) ToCached(r *CachedGroupElement) + func (p *ExtendedGroupElement) ToProjective(r *ProjectiveGroupElement) + func (p *ExtendedGroupElement) Zero() + type FieldElement [10]int32 + type PreComputedGroupElement struct + func (p *PreComputedGroupElement) Zero() + 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 ProjectiveGroupElement struct + X FieldElement + Y FieldElement + Z FieldElement + func (p *ProjectiveGroupElement) Double(r *CompletedGroupElement) + func (p *ProjectiveGroupElement) ToBytes(s *[32]byte) + func (p *ProjectiveGroupElement) Zero() + 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