block

package
v0.0.0-...-e4cc500 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2019 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Implements Block Modes. This package is intended for SPIs. The GCM mode is only available for ciphers with 128-bit block size.

Encoding = (
	$ciphers....
) + (
	"/gcm"
	"/cbc"
	"/cfb"
	"/ctr"
	"/ofb"
	"/eax"
)

Index

Constants

View Source
const (
	GCM = iota
	CBC
	CFB
	CTR
	OFB
	EAX
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BlockCipher

type BlockCipher struct {
	F    MakeBlock
	Key  int
	IV   int // BlockSize for .RegisterVariants("..."), IV-size otherwise.
	Mode int
}

func (*BlockCipher) Decrypt

func (*BlockCipher) Encrypt

func (*BlockCipher) Keybuf

func (c *BlockCipher) Keybuf() *ciphersuite2.Cipher_Buffer

func (*BlockCipher) RegisterVariants

func (c *BlockCipher) RegisterVariants(name string)

type MakeBlock

type MakeBlock func(key []byte) (cipher.Block, error)

Jump to

Keyboard shortcuts

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