ed25519

package
v0.0.0-...-811544e Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateKey

func GenerateKey() (ed25519.PublicKey, ed25519.PrivateKey, error)

GenerateKey generates a public/private key pair for Ed25519

func GenerateSharedKey

func GenerateSharedKey(publicKey ed25519.PublicKey, privateKey ed25519.PrivateKey) ([]byte, error)

GenerateSharedKey generates a shared key using ECDH exchange between a public and private key

func MarshalPrivateKey

func MarshalPrivateKey(privateKey ed25519.PrivateKey) ([]byte, error)

MarshalPrivateKey marshals a private key. For Ed25519, this is a no-op

func MarshalPublicKey

func MarshalPublicKey(publicKey ed25519.PublicKey) ([]byte, error)

MarshalPublicKey marshals a public key. For Ed25519, this is a no-op

func PrivateKeyToCurve25519

func PrivateKeyToCurve25519(ret *[32]byte, privateKey ed25519.PrivateKey)

PrivateKeyToCurve25519 converts an ed25519 private key into a corresponding curve25519 private key such that the resulting curve25519 public key will equal the result from PublicKeyToCurve25519.

func PublicKeyToCurve25519

func PublicKeyToCurve25519(ret *[32]byte, publicKey ed25519.PublicKey) error

PublicKeyToCurve25519 converts an Ed25519 public key into the curve25519 public key that would be generated from the same private key.

func Sign

func Sign(privateKey ed25519.PrivateKey, data []byte) []byte

Sign signs a message using Ed25519

func UnmarshalPrivateKey

func UnmarshalPrivateKey(data []byte) (ed25519.PrivateKey, error)

UnmarshalPrivateKey unmarshal a private key. For Ed25519, this is a no-op

func UnmarshalPublicKey

func UnmarshalPublicKey(data []byte) (ed25519.PublicKey, error)

UnmarshalPublicKey unmarshal a public key. For Ed25519, this is a no-op

func Verify

func Verify(publicKey ed25519.PublicKey, data, signature []byte) bool

Verify verifies a message using Ed25519

Types

type Signer

type Signer struct {
	// contains filtered or unexported fields
}

func NewSigner

func NewSigner(privateKey ed25519.PrivateKey, publicKey ed25519.PublicKey) *Signer

func (*Signer) Sign

func (s *Signer) Sign(data []byte) ([]byte, error)

func (*Signer) SignatureSize

func (s *Signer) SignatureSize() int

func (*Signer) Verify

func (s *Signer) Verify(data, signature []byte) error

type Verifier

type Verifier struct {
	// contains filtered or unexported fields
}

func NewVerifier

func NewVerifier(publicKey ed25519.PublicKey) *Verifier

func (*Verifier) Verify

func (v *Verifier) Verify(data, signature []byte) error

Jump to

Keyboard shortcuts

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