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: 0

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