streamencrypt

package module
v0.0.0-...-ececb59 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2018 License: MIT Imports: 5 Imported by: 0

README

streamencrypt

a stream encrypt lib, wrapper go crypto

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Ciphers = map[Type]CipherInfo{
	CHACHA20_IETF: {32, 12, NewChacha20Ietf},
}

Functions

func EvpBytesToKey

func EvpBytesToKey(password string, keyLen int) (key []byte)

Types

type ChaCha20Ietf

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

func (*ChaCha20Ietf) IV

func (c *ChaCha20Ietf) IV() []byte

func (*ChaCha20Ietf) InitReader

func (c *ChaCha20Ietf) InitReader(r io.Reader)

func (*ChaCha20Ietf) InitWriter

func (c *ChaCha20Ietf) InitWriter(w io.Writer)

func (*ChaCha20Ietf) Read

func (c *ChaCha20Ietf) Read(b []byte) (n int, err error)

func (*ChaCha20Ietf) Write

func (c *ChaCha20Ietf) Write(b []byte) (n int, err error)

type Cipher

type Cipher interface {
	IV() []byte

	InitReader(r io.Reader)

	InitWriter(w io.Writer)

	io.ReadWriter
}

func NewChacha20Ietf

func NewChacha20Ietf(key, iv []byte) (Cipher, error)

type CipherInfo

type CipherInfo struct {
	KeyLen    int
	IVLen     int
	NewCipher func(key, iv []byte) (Cipher, error)
}

type Type

type Type int
const (
	CHACHA20_IETF Type = iota
)

Jump to

Keyboard shortcuts

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