crypto

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2024 License: Apache-2.0 Imports: 5 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Crypto

type Crypto interface {
	Signer
	Hasher
	Verifier

	GenerateKey() (publicKey, privateKey []byte, err error)
	PublicKey(privateKey []byte) ([]byte, error)
}

type Ed25519

type Ed25519 struct{}

func NewEd25519

func NewEd25519() *Ed25519

func (*Ed25519) GenerateKey

func (ed *Ed25519) GenerateKey() (publicKey, privateKey []byte, err error)

func (*Ed25519) Hash

func (ed *Ed25519) Hash(msg []byte) []byte

func (*Ed25519) PublicKey

func (ed *Ed25519) PublicKey(privateKey []byte) ([]byte, error)

func (*Ed25519) Sign

func (ed *Ed25519) Sign(privateKey, hash []byte) (signature []byte, err error)

func (*Ed25519) Verify

func (ed *Ed25519) Verify(publicKey, hash, signature []byte) error

type Hasher

type Hasher interface {
	Hash([]byte) []byte
}

type Signer

type Signer interface {
	Sign(privateKey, hash []byte) ([]byte, error)
}

type Verifier

type Verifier interface {
	Verify(publicKey, hash, signature []byte) error
	Hasher
}

Jump to

Keyboard shortcuts

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