...

Package ecdsa

import "github.com/ProtonMail/go-crypto/openpgp/ecdsa"
Overview
Index

Overview ▾

Package ecdsa implements ECDSA signature, suitable for OpenPGP, as specified in RFC 6637, section 5.

func Sign

func Sign(rand io.Reader, priv *PrivateKey, hash []byte) (r, s *big.Int, err error)

func Validate

func Validate(priv *PrivateKey) error

func Verify

func Verify(pub *PublicKey, hash []byte, r, s *big.Int) bool

type PrivateKey

type PrivateKey struct {
    PublicKey
    D *big.Int
}

func GenerateKey

func GenerateKey(rand io.Reader, c ecc.ECDSACurve) (priv *PrivateKey, err error)

func NewPrivateKey

func NewPrivateKey(key PublicKey) *PrivateKey

func (*PrivateKey) MarshalIntegerSecret

func (sk *PrivateKey) MarshalIntegerSecret() []byte

func (*PrivateKey) UnmarshalIntegerSecret

func (sk *PrivateKey) UnmarshalIntegerSecret(d []byte) error

type PublicKey

type PublicKey struct {
    X, Y *big.Int
    // contains filtered or unexported fields
}

func NewPublicKey

func NewPublicKey(curve ecc.ECDSACurve) *PublicKey

func (*PublicKey) GetCurve

func (pk *PublicKey) GetCurve() ecc.ECDSACurve

func (*PublicKey) MarshalPoint

func (pk *PublicKey) MarshalPoint() []byte

func (*PublicKey) UnmarshalPoint

func (pk *PublicKey) UnmarshalPoint(p []byte) error