block

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2017 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Size of an AES block in bytes
	Size = 16

	// R is the minimal irreducible polynomial for a 128-bit block size
	R = 0x87
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Block

type Block [Size]byte

Block is a 128-byte array used by certain block ciphers (i.e. AES)

func (*Block) Clear

func (b *Block) Clear()

Clear zeroes out the contents of the block

func (*Block) Dbl

func (b *Block) Dbl()

Dbl performs a doubling of a block over GF(2^128):

a<<1 if firstbit(a)=0
(a<<1) ⊕ 0¹²⁰10000111 if firstbit(a)=1

func (*Block) Encrypt

func (b *Block) Encrypt(c cipher.Block)

Encrypt a block with the given block cipher

Jump to

Keyboard shortcuts

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