Documentation ¶
Index ¶
Constants ¶
View Source
const ( SHA1chunk = 64 SHA1init0 = 0x67452301 SHA1init1 = 0xEFCDAB89 SHA1init2 = 0x98BADCFE SHA1init3 = 0x10325476 SHA1init4 = 0xC3D2E1F0 )
View Source
const BlockSizeSHA1 = 64
The blocksize of SHA1 in bytes.
View Source
const SizeSHA1 = 20
The size of a SHA1 checksum in bytes.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MultiBlock ¶
type MultiBlock interface { // BlockSize returns the cipher's block size. BlockSize() int // VecSize return a number of blocks encrypted at once VecSize() int // DecryptMany decrypts the first block in src into dst. // Dst and src may point at the same memory. DecryptMany(dst, src [][]byte) }
A MultiBlock represents an implementation of block cipher using a given key and acting on a several blocks ata once. All blocks must use the same key. It provides the capability to encrypt or decrypt "vectors" of individual blocks. The mode implementations extend that capability to streams of blocks.
type MultiBlockMode ¶
type MultiBlockMode interface { // BlockSize returns the mode's block size. BlockSize() int // VecSize return a number of blocks encrypted at once VecSize() int // CryptManyBlocks encrypts or decrypts a number of blocks. The length of // src must be a multiple of the block size. Dst and src may point to // the same memory. CryptManyBlocks(dst, src [][]byte) }
A BlockMode represents a block cipher running in a block-based mode (CBC, ECB etc).
func NewMultiCBCDecrypter ¶
func NewMultiCBCDecrypter(mb MultiBlock, iv [][]byte) MultiBlockMode
func NewMultiCBCEncrypter ¶
func NewMultiCBCEncrypter(mb MultiBlock, iv [][]byte) MultiBlockMode
type MultiHash ¶
type MultiHash interface { // Write adds more data to the running hash. Write(p [][]byte) (n int) // TODO []io.writer? // Sum appends the current hash to b and returns the resulting slice. // It does not change the underlying hash state. Sum(b [][]byte) [][]byte // Reset resets the MultiHash to its initial state. Reset() // Size returns the number of bytes Sum will return. Size() int // VecSize returns numer of blocks summed in parallel VecSize() int // BlockSize returns the hash's underlying block size. // The Write method must be able to accept any amount // of data, but it may operate more efficiently if all writes // are a multiple of the block size. BlockSize() int }
MultiHash is the common interface implemented by all hash functions.
type MultiSetIVer ¶
Click to show internal directories.
Click to hide internal directories.