package eddsa

import "github.com/ProtonMail/go-crypto/openpgp/eddsa"

Package eddsa implements EdDSA signature, suitable for OpenPGP, as specified in https://datatracker.ietf.org/doc/html/draft-ietf-openpgp-crypto-refresh-06#section-13.7

Index

Functions

func Sign

func Sign(priv *PrivateKey, message []byte) (r, s []byte, err error)

func Validate

func Validate(priv *PrivateKey) error

func Verify

func Verify(pub *PublicKey, message, r, s []byte) bool

Types

type PrivateKey

type PrivateKey struct {
	PublicKey
	D []byte
}

func GenerateKey

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

func NewPrivateKey

func NewPrivateKey(key PublicKey) *PrivateKey

func (*PrivateKey) MarshalByteSecret

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

func (*PrivateKey) UnmarshalByteSecret

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

type PublicKey

type PublicKey struct {
	X []byte
	// contains filtered or unexported fields
}

func NewPublicKey

func NewPublicKey(curve ecc.EdDSACurve) *PublicKey

func (*PublicKey) GetCurve

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

func (*PublicKey) MarshalPoint

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

func (*PublicKey) UnmarshalPoint

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

Source Files

eddsa.go

Version
v1.3.0 (latest)
Published
May 22, 2025
Platform
linux/amd64
Imports
3 packages
Last checked
2 days ago

Tools for package owners.