ed448

package
v1.1.0-alpha.4-proton Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2024 License: BSD-3-Clause Imports: 4 Imported by: 3

Documentation

Overview

Package ed448 implements the ed448 signature algorithm for OpenPGP as defined in the Open PGP crypto refresh.

Index

Constants

View Source
const (
	// PublicKeySize is the size, in bytes, of public keys in this package.
	PublicKeySize = ed448lib.PublicKeySize
	// SeedSize is the size, in bytes, of private key seeds.
	// The private key representation used by RFC 8032.
	SeedSize = ed448lib.SeedSize
	// SignatureSize is the size, in bytes, of signatures generated and verified by this package.
	SignatureSize = ed448lib.SignatureSize
)

Variables

This section is empty.

Functions

func ReadSignature

func ReadSignature(reader io.Reader) ([]byte, error)

ReadSignature decodes an ed448 signature from a reader.

func Sign

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

Sign signs a message with the ed448 algorithm. priv MUST be a valid key! Check this with Validate() before use.

func Validate

func Validate(priv *PrivateKey) error

Validate checks if the ed448 private key is valid

func Verify

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

Verify verifies a ed448 signature

func WriteSignature

func WriteSignature(writer io.Writer, signature []byte) error

WriteSignature encodes and writes an ed448 signature to writer.

Types

type PrivateKey

type PrivateKey struct {
	PublicKey
	// Key the private key representation by RFC 8032,
	// encoded as seed | public key point.
	Key []byte
}

func GenerateKey

func GenerateKey(rand io.Reader) (*PrivateKey, error)

GenerateKey generates a fresh private key with the provided randomness source.

func NewPrivateKey

func NewPrivateKey(key PublicKey) *PrivateKey

NewPrivateKey creates a new empty private key referencing the public key.

func (*PrivateKey) MarshalByteSecret

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

MarshalByteSecret returns the underlying seed of the private key.

func (*PrivateKey) Seed

func (pk *PrivateKey) Seed() []byte

Seed returns the ed448 private key secret seed. The private key representation by RFC 8032.

func (*PrivateKey) UnmarshalByteSecret

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

UnmarshalByteSecret computes the private key from the secret seed and stores it in the private key object.

type PublicKey

type PublicKey struct {
	// Point represents the elliptic curve point of the public key.
	Point []byte
}

func NewPublicKey

func NewPublicKey() *PublicKey

NewPublicKey creates a new empty ed448 public key.

Jump to

Keyboard shortcuts

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