eddsa

package
v2.0.0-...-6e5629b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 20, 2023 License: BSD-3-Clause Imports: 3 Imported by: 1

Documentation

Overview

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

Constants

This section is empty.

Variables

This section is empty.

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL