fake

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: May 9, 2019 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCodec

func NewCodec() crypto.Codec

NewCodec returns a new no-op implementation of crypto.Codec

Types

type Codec

type Codec struct {
	EncryptBehavior func(plaintext []byte) ([]byte, error)
	DecryptBehavior func(ciphertext []byte) ([]byte, error)
}

Codec is an implementation of crypto.Codec used to facilitate testing

func (*Codec) Decrypt

func (c *Codec) Decrypt(ciphertext []byte) ([]byte, error)

Decrypt delegates decryption to an overridable function

func (*Codec) Encrypt

func (c *Codec) Encrypt(plaintext []byte) ([]byte, error)

Encrypt delegates encyption to an overridable function

Jump to

Keyboard shortcuts

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