aes
packagestandard libraryThis package is not in the latest version of its module.
Details
Validgo.mod file
The Go module system was introduced in Go 1.11 and is the official dependency management solution for Go.
Redistributable license
Redistributable licenses place minimal restrictions on how software can be used, modified, and redistributed.
Tagged version
Modules with tagged versions give importers more predictable builds.
Stable version
When a project reaches major version v1 it is considered stable.
- Learn more about best practices
Repository
Links
Documentation¶
Index¶
Constants¶
const BlockSize = 16BlockSize is the AES block size in bytes.
Variables¶
This section is empty.
Functions¶
funcEncryptBlockInternal¶
EncryptBlockInternal applies the AES encryption function to one block.
It is an internal function meant only for the gcm package.
funcEncryptionKeySchedule¶
EncryptionKeySchedule is used from the GCM implementation to access theprecomputed AES key schedule, to pass to the assembly implementation.
funcRoundToBlock¶
func RoundToBlock(c *CTR)
RoundToBlock is used by CTR_DRBG, which discards the rightmost unused bits ateach request. It rounds the offset up to the next block boundary.
Types¶
typeBlock¶
type Block struct {// contains filtered or unexported fields}A Block is an instance of AES using a particular key.It is safe for concurrent use.
typeCBCDecrypter¶
type CBCDecrypter struct {// contains filtered or unexported fields}funcNewCBCDecrypter¶
func NewCBCDecrypter(b *Block, iv [BlockSize]byte) *CBCDecrypter
NewCBCDecrypter returns a [cipher.BlockMode] which decrypts in cipher blockchaining mode, using the given Block.
func (*CBCDecrypter)BlockSize¶
func (c *CBCDecrypter) BlockSize()int
func (*CBCDecrypter)CryptBlocks¶
func (c *CBCDecrypter) CryptBlocks(dst, src []byte)
func (*CBCDecrypter)SetIV¶
func (x *CBCDecrypter) SetIV(iv []byte)
typeCBCEncrypter¶
type CBCEncrypter struct {// contains filtered or unexported fields}funcNewCBCEncrypter¶
func NewCBCEncrypter(b *Block, iv [BlockSize]byte) *CBCEncrypter
NewCBCEncrypter returns a [cipher.BlockMode] which encrypts in cipher blockchaining mode, using the given Block.
func (*CBCEncrypter)BlockSize¶
func (c *CBCEncrypter) BlockSize()int
func (*CBCEncrypter)CryptBlocks¶
func (c *CBCEncrypter) CryptBlocks(dst, src []byte)
func (*CBCEncrypter)SetIV¶
func (x *CBCEncrypter) SetIV(iv []byte)
typeCTR¶
type CTR struct {// contains filtered or unexported fields}func (*CTR)XORKeyStream¶
func (*CTR)XORKeyStreamAt¶
XORKeyStreamAt behaves like XORKeyStream but keeps no state, and insteadseeks into the keystream by the given bytes offset from the start (ignoringany XORKetStream calls). This allows for random access into the keystream, upto 16 EiB from the start.