crypton-2.2.5: Cryptography Primitives
LicenseBSD-style
MaintainerVincent Hanquez <vincent@snarc.org>
Stabilitystable
Portabilitygood
Safe HaskellNone
LanguageHaskell2010

Crypto.Cipher.AES

Description

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.

Synopsis

Documentation

data AES128 Source #

AES with 128 bit key

Instances

Instances details
Cipher AES128 Source # 
Instance details

Defined in Crypto.Cipher.AES

BlockCipher AES128 Source # 
Instance details

Defined in Crypto.Cipher.AES

Methods

blockSize :: AES128 -> Int Source #

ecbEncrypt :: ByteArray ba => AES128 -> ba -> ba Source #

ecbDecrypt :: ByteArray ba => AES128 -> ba -> ba Source #

cbcEncrypt :: ByteArray ba => AES128 -> IV AES128 -> ba -> ba Source #

cbcDecrypt :: ByteArray ba => AES128 -> IV AES128 -> ba -> ba Source #

cfbEncrypt :: ByteArray ba => AES128 -> IV AES128 -> ba -> ba Source #

cfbDecrypt :: ByteArray ba => AES128 -> IV AES128 -> ba -> ba Source #

ctrCombine :: ByteArray ba => AES128 -> IV AES128 -> ba -> ba Source #

aeadInit :: ByteArrayAccess iv => AEADMode -> AES128 -> iv -> CryptoFailable (AEAD AES128) Source #

BlockCipher128 AES128 Source # 
Instance details

Defined in Crypto.Cipher.AES

Methods

xtsEncrypt :: ByteArray ba => (AES128, AES128) -> IV AES128 -> DataUnitOffset -> ba -> ba Source #

xtsDecrypt :: ByteArray ba => (AES128, AES128) -> IV AES128 -> DataUnitOffset -> ba -> ba Source #

NFData AES128 Source # 
Instance details

Defined in Crypto.Cipher.AES

Methods

rnf :: AES128 -> () #

data AES192 Source #

AES with 192 bit key

Instances

Instances details
Cipher AES192 Source # 
Instance details

Defined in Crypto.Cipher.AES

BlockCipher AES192 Source # 
Instance details

Defined in Crypto.Cipher.AES

Methods

blockSize :: AES192 -> Int Source #

ecbEncrypt :: ByteArray ba => AES192 -> ba -> ba Source #

ecbDecrypt :: ByteArray ba => AES192 -> ba -> ba Source #

cbcEncrypt :: ByteArray ba => AES192 -> IV AES192 -> ba -> ba Source #

cbcDecrypt :: ByteArray ba => AES192 -> IV AES192 -> ba -> ba Source #

cfbEncrypt :: ByteArray ba => AES192 -> IV AES192 -> ba -> ba Source #

cfbDecrypt :: ByteArray ba => AES192 -> IV AES192 -> ba -> ba Source #

ctrCombine :: ByteArray ba => AES192 -> IV AES192 -> ba -> ba Source #

aeadInit :: ByteArrayAccess iv => AEADMode -> AES192 -> iv -> CryptoFailable (AEAD AES192) Source #

BlockCipher128 AES192 Source # 
Instance details

Defined in Crypto.Cipher.AES

Methods

xtsEncrypt :: ByteArray ba => (AES192, AES192) -> IV AES192 -> DataUnitOffset -> ba -> ba Source #

xtsDecrypt :: ByteArray ba => (AES192, AES192) -> IV AES192 -> DataUnitOffset -> ba -> ba Source #

NFData AES192 Source # 
Instance details

Defined in Crypto.Cipher.AES

Methods

rnf :: AES192 -> () #

data AES256 Source #

AES with 256 bit key

Instances

Instances details
Cipher AES256 Source # 
Instance details

Defined in Crypto.Cipher.AES

BlockCipher AES256 Source # 
Instance details

Defined in Crypto.Cipher.AES

Methods

blockSize :: AES256 -> Int Source #

ecbEncrypt :: ByteArray ba => AES256 -> ba -> ba Source #

ecbDecrypt :: ByteArray ba => AES256 -> ba -> ba Source #

cbcEncrypt :: ByteArray ba => AES256 -> IV AES256 -> ba -> ba Source #

cbcDecrypt :: ByteArray ba => AES256 -> IV AES256 -> ba -> ba Source #

cfbEncrypt :: ByteArray ba => AES256 -> IV AES256 -> ba -> ba Source #

cfbDecrypt :: ByteArray ba => AES256 -> IV AES256 -> ba -> ba Source #

ctrCombine :: ByteArray ba => AES256 -> IV AES256 -> ba -> ba Source #

aeadInit :: ByteArrayAccess iv => AEADMode -> AES256 -> iv -> CryptoFailable (AEAD AES256) Source #

BlockCipher128 AES256 Source # 
Instance details

Defined in Crypto.Cipher.AES

Methods

xtsEncrypt :: ByteArray ba => (AES256, AES256) -> IV AES256 -> DataUnitOffset -> ba -> ba Source #

xtsDecrypt :: ByteArray ba => (AES256, AES256) -> IV AES256 -> DataUnitOffset -> ba -> ba Source #

NFData AES256 Source # 
Instance details

Defined in Crypto.Cipher.AES

Methods

rnf :: AES256 -> () #