crypto

package
v0.0.0-...-324a32f Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2018 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCTRStream

func NewCTRStream(input io.Reader, nonce uint64, cipher cipher.Block) io.Reader

func NewCTRStreamAtPos

func NewCTRStreamAtPos(pos uint64, input io.Reader, nonce uint64, cipher cipher.Block) io.Reader

func NewMT19937Stream

func NewMT19937Stream(input io.Reader, mt *random.MT19937) io.Reader

Types

type BlindEncryptFn

type BlindEncryptFn func([]byte) []byte

func (BlindEncryptFn) BlindLength

func (fn BlindEncryptFn) BlindLength() int

func (BlindEncryptFn) GuessBlockSize

func (fn BlindEncryptFn) GuessBlockSize() int

func (BlindEncryptFn) IsECB

func (fn BlindEncryptFn) IsECB(blockSize int) bool

type BlockMode

type BlockMode interface {
	Encrypt(io.Reader) []byte
	Decrypt(io.Reader) []byte
}

func NewCBCBlockMode

func NewCBCBlockMode(iv []byte, cipher cipher.Block) BlockMode

func NewECBBlockMode

func NewECBBlockMode(cipher cipher.Block) BlockMode

type CBCBlockMode

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

func (*CBCBlockMode) Decrypt

func (cbc *CBCBlockMode) Decrypt(input io.Reader) (plaintext []byte)

func (*CBCBlockMode) Encrypt

func (cbc *CBCBlockMode) Encrypt(input io.Reader) (ciphertext []byte)

type CTRStream

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

func (*CTRStream) Read

func (ctr *CTRStream) Read(buf []byte) (n int, err error)

type DH

type DH struct {
	A *big.Int
	// contains filtered or unexported fields
}

func NewDiffieHellman

func NewDiffieHellman(p, g *big.Int) *DH

func (*DH) Key

func (dh *DH) Key() *big.Int

func (*DH) Negotiate

func (dh *DH) Negotiate(B *big.Int)

type ECBBlockMode

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

func (*ECBBlockMode) Decrypt

func (ecb *ECBBlockMode) Decrypt(input io.Reader) (plaintext []byte)

func (*ECBBlockMode) Encrypt

func (ecb *ECBBlockMode) Encrypt(input io.Reader) (ciphertext []byte)

type MT19937Stream

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

func (*MT19937Stream) Read

func (s *MT19937Stream) Read(buf []byte) (n int, err error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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