crypto

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2023 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Chacha20poly1305 = chacha20poly1305Aead{}
View Source
var Sha256 = sha256Hash{}

Functions

func NewConn

func NewConn(c net.Conn, rnonce, wnonce []byte, rciph, wciph cipher.AEAD) net.Conn

NewConn wraps a stream-oriented net.Conn with cipher.

func NewHandshaker

func NewHandshaker(hash []byte, password []byte) entity.Handshaker

func NewReader

func NewReader(r io.Reader, nonce []byte, aead cipher.AEAD, maxPayloadSize int) *reader

func NewWriter

func NewWriter(w io.Writer, nonce []byte, aead cipher.AEAD, maxPayloadSize int) *writer

Types

type Aead

type Aead interface {
	New([]byte) (cipher.AEAD, error)
	KeySize() int
	NonceSize() int
	Name() []byte
}

type Ed25519

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

func (Ed25519) Sign

func (e Ed25519) Sign(rand io.Reader, digest []byte) (signature []byte, err error)

func (Ed25519) SignatureSize

func (Ed25519) SignatureSize() int

func (Ed25519) Verify

func (e Ed25519) Verify(message, sig []byte) bool

type Hash

type Hash interface {
	New() hash.Hash
	Size() int
}

type Signer

type Signer interface {
	Sign(rand io.Reader, digest []byte) (signature []byte, err error)
	SignatureSize() int
	Verify(message, sig []byte) bool
}

func NewEd25519

func NewEd25519(hash Hash, key []byte) Signer

Jump to

Keyboard shortcuts

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