crypt

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2019 License: Apache-2.0 Imports: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidNonce = errors.New("tried to decrypt with a previouly used nonce")

ErrInvalidNonce is returned if an invalid nonce if received.

Functions

This section is empty.

Types

type Reader

type Reader interface {
	Read(*big.Int, []byte) (int, error)
}

Reader defines an interface is similar to [io.Reader], but additional the `Read` function a nonce parameter of type `*big.Int`.

func NewDecrypter

func NewDecrypter(parent io.Reader, key []byte) (Reader, error)

NewDecrypter returns a new decrypter.

type Writer

type Writer interface {
	Write(*big.Int, []byte) (int, error)
}

Writer defines an interface similar to [io.Writer], but adds a nonce parameter of type `*big.Int`.

func NewEncrypter

func NewEncrypter(parent io.Writer, key []byte) (Writer, error)

NewEncrypter returns a new encrypter.

Jump to

Keyboard shortcuts

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