Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrInvalidIV = errors.New("iv length must be: (block size * 2)")
ErrInvalidIV is displayed as the panic message if the initialization vector passed to NewIGEEncrypter or NewIGEDecrypter doesn't fulfill the length requirements for IGE.
IGE uses a two step xor process, so the first initialization vector is the first half, and the second initialization vector is the second half. This requires the initialization vector to be twice as long as the block size.
Functions ¶
This section is empty.
Types ¶
type IGE ¶
type IGE interface { // BlockSize returns the mode's block size. BlockSize() int // CryptBlocks encrypts or decrypts a number of blocks based on the // underlying cipher.Block passed to NewIGEEncrypter or NewIGEDecrypter // (usually from crypto/aes). CryptBlocks(dst, src []byte) }
IGE satisfies the cipher.BlockMode interface from the crypto/cipher package.
func NewIGEDecrypter ¶
NewIGEDecrypter returns an IGE cipher.BlockMode which decrypts using IGE and the given cipher.Block.
Note: iv must contain two iv values for IGE (concatenated), otherwise this function will panic. See ErrInvalidIV for more information.
func NewIGEEncrypter ¶
NewIGEEncrypter returns an IGE cipher.BlockMode which encrypts using IGE and the given cipher.Block.
Note: iv must contain two iv values for IGE (concatenated), otherwise this function will panic. See ErrInvalidIV for more information.