Documentation
¶
Overview ¶
Package aes implements AES encryption (formerly Rijndael), as defined in U.S. Federal Information Processing Standards Publication 197.
The AES operations in this package are not implemented using constant-time algorithms. An exception is when running on systems with enabled hardware support for AES that makes these operations constant-time. Examples include amd64 systems using AES-NI extensions and s390x systems using Message-Security-Assist extensions. On such systems, when the result of NewCipher is passed to cipher.NewGCM, the GHASH operation used by GCM is also constant-time.
Index ¶
- Constants
- Variables
- type AES
- type HardAES
- func (aes HardAES) FillAes1Rx4(state *[64]byte, output []byte)
- func (aes HardAES) FillAes4Rx4(state *[64]byte, output []byte)
- func (aes HardAES) HashAes1Rx4(input []byte, output *[64]byte)
- func (aes HardAES) HashAndFillAes1Rx4(scratchpad []byte, output *[64]byte, fillState *[64]byte)
- func (aes HardAES) MergeAes4Rx4(state *[64]byte, key *[64]byte)
- type SoftAES
- func (aes SoftAES) FillAes1Rx4(state *[64]byte, output []byte)
- func (aes SoftAES) FillAes4Rx4(state *[64]byte, output []byte)
- func (aes SoftAES) HashAes1Rx4(input []byte, output *[64]byte)
- func (aes SoftAES) HashAndFillAes1Rx4(scratchpad []byte, output *[64]byte, fillState *[64]byte)
- func (aes SoftAES) MergeAes4Rx4(state *[64]byte, key *[64]byte)
Constants ¶
View Source
const HasHardAESImplementation = true
Variables ¶
View Source
var SupportsHardAESImplementation = cpu.X86.HasAES
Functions ¶
This section is empty.
Types ¶
type AES ¶
type AES interface {
// HashAes1Rx4
//
// Calculate a 512-bit hash of 'input' using 4 lanes of AES.
// The input is treated as a set of round keys for the encryption
// of the initial state.
//
// 'input' size must be a multiple of 64.
//
// For a 2 MiB input, this has the same security as 32768-round
// AES encryption.
//
// Hashing throughput: >20 GiB/s per CPU core with hardware AES
HashAes1Rx4(input []byte, output *[64]byte)
// FillAes1Rx4
//
// Fill 'output' with pseudorandom data based on 512-bit 'state'.
// The state is encrypted using a single AES round per 16 bytes of output
// in 4 lanes.
//
// 'output' size must be a multiple of 64.
//
// The modified state is written back to 'state' to allow multiple
// calls to this function.
FillAes1Rx4(state *[64]byte, output []byte)
MergeAes4Rx4(state *[64]byte, key *[64]byte)
// HashAndFillAes1Rx4 Hashes and fills scratchpad and output in one sweep
HashAndFillAes1Rx4(scratchpad []byte, output *[64]byte, fillState *[64]byte)
// FillAes4Rx4 used to generate final program
FillAes4Rx4(state *[64]byte, output []byte)
}
type HardAES ¶ added in v4.6.1
type HardAES struct {
}
func NewHardAES ¶
func NewHardAES() *HardAES
func (HardAES) FillAes1Rx4 ¶ added in v4.6.1
func (HardAES) FillAes4Rx4 ¶ added in v4.6.1
func (HardAES) HashAes1Rx4 ¶ added in v4.6.1
func (HardAES) HashAndFillAes1Rx4 ¶ added in v4.6.1
func (HardAES) MergeAes4Rx4 ¶ added in v4.6.1
type SoftAES ¶ added in v4.6.1
type SoftAES struct {
}
func NewSoftAES ¶
func NewSoftAES() SoftAES
func (SoftAES) FillAes1Rx4 ¶ added in v4.6.1
func (SoftAES) FillAes4Rx4 ¶ added in v4.6.1
func (SoftAES) HashAes1Rx4 ¶ added in v4.6.1
func (SoftAES) HashAndFillAes1Rx4 ¶ added in v4.6.1
func (SoftAES) MergeAes4Rx4 ¶ added in v4.6.1
Click to show internal directories.
Click to hide internal directories.