Documentation ¶
Index ¶
- Constants
- func NewCCM(cipher goCipher.Block) (goCipher.AEAD, error)
- func NewCCMWithNonceAndTagSize(cipher goCipher.Block, nonceSize, tagSize int) (goCipher.AEAD, error)
- func NewCCMWithNonceSize(cipher goCipher.Block, size int) (goCipher.AEAD, error)
- func NewCCMWithTagSize(cipher goCipher.Block, tagSize int) (goCipher.AEAD, error)
- type CipherCreator
- type XTSBlockMode
Constants ¶
View Source
const GF128_FDBK byte = 0x87
Variables ¶
This section is empty.
Functions ¶
func NewCCM ¶
NewCCM returns the given 128-bit, block cipher wrapped in CCM with the standard nonce length.
func NewCCMWithNonceAndTagSize ¶
func NewCCMWithNonceSize ¶
NewCCMWithNonceSize returns the given 128-bit, block cipher wrapped in CCM, which accepts nonces of the given length. The length must not be zero.
Types ¶
type XTSBlockMode ¶ added in v0.4.6
type XTSBlockMode interface { // BlockSize returns the mode's block size. BlockSize() int // Encrypt encrypts or decrypts a number of blocks. The length of // src must be a multiple of the block size. Dst and src must overlap // entirely or not at all. // Encrypt(dst, src []byte, sectorNum uint64) // Decrypt decrypts a number of blocks. The length of // src must be a multiple of the block size. Dst and src must overlap // entirely or not at all. // Decrypt(dst, src []byte, sectorNum uint64) }
A XTSBlockMode represents a block cipher running in a XTS mode
func NewXTS ¶ added in v0.4.6
func NewXTS(cipherFunc CipherCreator, key []byte) (XTSBlockMode, error)
NewXTS creates a Cipher given a function for creating the underlying block cipher (which must have a block size of 16 bytes). The key must be twice the length of the underlying cipher's key.
Click to show internal directories.
Click to hide internal directories.