HORIZON HASKELLDocslts/ghc-10.0.xfc4e5982026-10-11Search names, modules, packages, or :: a typeCtrl K

GHC 10.0.0.20260917 · lts/ghc-10.0.x · fc4e598 · 2026-10-11

Modulecrypton-2.1.7Haskell2010

Crypto.Cipher.AES

AES, in the modes Crypto.Cipher.Types defines.

Which implementation runs

Where the processor has instructions for AES -- AES-NI on x86-64, the cryptographic extensions on AArch64 -- every key size and every mode here goes through them, and a block costs the same whatever the key and the data are.

Where it does not, the fallback is the table-driven code in cbits/aes/generic.c, which indexes a 256-byte table with bytes derived from the key and from the block. That is the cache-timing exposure the instructions exist to remove, and on such a machine AES here is not constant time. Every x86-64 part since about 2010 and every AArch64 one in ordinary use has the instructions.

processorOptions says which of the two a given machine got: AESNI in that list means the processor's AES instructions, on either architecture.

  • 3 types
  • Packagecrypton-2.1.7
  • Exports3
  • LanguageHaskell2010
  • LicenceBSD-3-Clause AND MIT AND ISC
  • SourceAES.hs
newtypenewtype AES128
#

AES with 128 bit key

Instances4NFData, BlockCipher128, BlockCipher, Cipher
newtypenewtype AES192
#

AES with 192 bit key

Instances4NFData, BlockCipher128, BlockCipher, Cipher
newtypenewtype AES256
#

AES with 256 bit key

Instances4NFData, BlockCipher128, BlockCipher, Cipher