cipher-aes128-0.7.0.5: AES and common modes using AES-NI when available.

Safe HaskellNone
LanguageHaskell2010

Crypto.Cipher.AES128

Contents

Synopsis

Key types with crypto-api instances

data AESKey128 Source #

Instances
Serialize AESKey128 Source # 
Instance details

Defined in Crypto.Cipher.AES128

BlockCipher AESKey128 Source # 
Instance details

Defined in Crypto.Cipher.AES128

Methods

blockSize :: Tagged AESKey128 BitLength #

encryptBlock :: AESKey128 -> ByteString -> ByteString #

decryptBlock :: AESKey128 -> ByteString -> ByteString #

buildKey :: ByteString -> Maybe AESKey128 #

keyLength :: Tagged AESKey128 BitLength #

ecb :: AESKey128 -> ByteString -> ByteString #

unEcb :: AESKey128 -> ByteString -> ByteString #

cbc :: AESKey128 -> IV AESKey128 -> ByteString -> (ByteString, IV AESKey128) #

unCbc :: AESKey128 -> IV AESKey128 -> ByteString -> (ByteString, IV AESKey128) #

ctr :: AESKey128 -> IV AESKey128 -> ByteString -> (ByteString, IV AESKey128) #

unCtr :: AESKey128 -> IV AESKey128 -> ByteString -> (ByteString, IV AESKey128) #

ctrLazy :: AESKey128 -> IV AESKey128 -> ByteString -> (ByteString, IV AESKey128) #

unCtrLazy :: AESKey128 -> IV AESKey128 -> ByteString -> (ByteString, IV AESKey128) #

cfb :: AESKey128 -> IV AESKey128 -> ByteString -> (ByteString, IV AESKey128) #

unCfb :: AESKey128 -> IV AESKey128 -> ByteString -> (ByteString, IV AESKey128) #

ofb :: AESKey128 -> IV AESKey128 -> ByteString -> (ByteString, IV AESKey128) #

unOfb :: AESKey128 -> IV AESKey128 -> ByteString -> (ByteString, IV AESKey128) #

cbcLazy :: AESKey128 -> IV AESKey128 -> ByteString -> (ByteString, IV AESKey128) #

unCbcLazy :: AESKey128 -> IV AESKey128 -> ByteString -> (ByteString, IV AESKey128) #

sivLazy :: AESKey128 -> AESKey128 -> [ByteString] -> ByteString -> Maybe ByteString #

unSivLazy :: AESKey128 -> AESKey128 -> [ByteString] -> ByteString -> Maybe ByteString #

siv :: AESKey128 -> AESKey128 -> [ByteString] -> ByteString -> Maybe ByteString #

unSiv :: AESKey128 -> AESKey128 -> [ByteString] -> ByteString -> Maybe ByteString #

ecbLazy :: AESKey128 -> ByteString -> ByteString #

unEcbLazy :: AESKey128 -> ByteString -> ByteString #

cfbLazy :: AESKey128 -> IV AESKey128 -> ByteString -> (ByteString, IV AESKey128) #

unCfbLazy :: AESKey128 -> IV AESKey128 -> ByteString -> (ByteString, IV AESKey128) #

ofbLazy :: AESKey128 -> IV AESKey128 -> ByteString -> (ByteString, IV AESKey128) #

unOfbLazy :: AESKey128 -> IV AESKey128 -> ByteString -> (ByteString, IV AESKey128) #

GetExpanded AESKey128 Source # 
Instance details

Defined in Crypto.Cipher.AES128.Internal

Methods

expandedKey :: AESKey128 -> ForeignPtr AESKeyStruct

AES_GCM AESKey128 Source # 
Instance details

Defined in Crypto.Cipher.AES128

data AESKey192 Source #

Instances
Serialize AESKey192 Source # 
Instance details

Defined in Crypto.Cipher.AES128

BlockCipher AESKey192 Source # 
Instance details

Defined in Crypto.Cipher.AES128

Methods

blockSize :: Tagged AESKey192 BitLength #

encryptBlock :: AESKey192 -> ByteString -> ByteString #

decryptBlock :: AESKey192 -> ByteString -> ByteString #

buildKey :: ByteString -> Maybe AESKey192 #

keyLength :: Tagged AESKey192 BitLength #

ecb :: AESKey192 -> ByteString -> ByteString #

unEcb :: AESKey192 -> ByteString -> ByteString #

cbc :: AESKey192 -> IV AESKey192 -> ByteString -> (ByteString, IV AESKey192) #

unCbc :: AESKey192 -> IV AESKey192 -> ByteString -> (ByteString, IV AESKey192) #

ctr :: AESKey192 -> IV AESKey192 -> ByteString -> (ByteString, IV AESKey192) #

unCtr :: AESKey192 -> IV AESKey192 -> ByteString -> (ByteString, IV AESKey192) #

ctrLazy :: AESKey192 -> IV AESKey192 -> ByteString -> (ByteString, IV AESKey192) #

unCtrLazy :: AESKey192 -> IV AESKey192 -> ByteString -> (ByteString, IV AESKey192) #

cfb :: AESKey192 -> IV AESKey192 -> ByteString -> (ByteString, IV AESKey192) #

unCfb :: AESKey192 -> IV AESKey192 -> ByteString -> (ByteString, IV AESKey192) #

ofb :: AESKey192 -> IV AESKey192 -> ByteString -> (ByteString, IV AESKey192) #

unOfb :: AESKey192 -> IV AESKey192 -> ByteString -> (ByteString, IV AESKey192) #

cbcLazy :: AESKey192 -> IV AESKey192 -> ByteString -> (ByteString, IV AESKey192) #

unCbcLazy :: AESKey192 -> IV AESKey192 -> ByteString -> (ByteString, IV AESKey192) #

sivLazy :: AESKey192 -> AESKey192 -> [ByteString] -> ByteString -> Maybe ByteString #

unSivLazy :: AESKey192 -> AESKey192 -> [ByteString] -> ByteString -> Maybe ByteString #

siv :: AESKey192 -> AESKey192 -> [ByteString] -> ByteString -> Maybe ByteString #

unSiv :: AESKey192 -> AESKey192 -> [ByteString] -> ByteString -> Maybe ByteString #

ecbLazy :: AESKey192 -> ByteString -> ByteString #

unEcbLazy :: AESKey192 -> ByteString -> ByteString #

cfbLazy :: AESKey192 -> IV AESKey192 -> ByteString -> (ByteString, IV AESKey192) #

unCfbLazy :: AESKey192 -> IV AESKey192 -> ByteString -> (ByteString, IV AESKey192) #

ofbLazy :: AESKey192 -> IV AESKey192 -> ByteString -> (ByteString, IV AESKey192) #

unOfbLazy :: AESKey192 -> IV AESKey192 -> ByteString -> (ByteString, IV AESKey192) #

GetExpanded AESKey192 Source # 
Instance details

Defined in Crypto.Cipher.AES128.Internal

Methods

expandedKey :: AESKey192 -> ForeignPtr AESKeyStruct

AES_GCM AESKey192 Source # 
Instance details

Defined in Crypto.Cipher.AES128

data AESKey256 Source #

Instances
Serialize AESKey256 Source # 
Instance details

Defined in Crypto.Cipher.AES128

BlockCipher AESKey256 Source # 
Instance details

Defined in Crypto.Cipher.AES128

Methods

blockSize :: Tagged AESKey256 BitLength #

encryptBlock :: AESKey256 -> ByteString -> ByteString #

decryptBlock :: AESKey256 -> ByteString -> ByteString #

buildKey :: ByteString -> Maybe AESKey256 #

keyLength :: Tagged AESKey256 BitLength #

ecb :: AESKey256 -> ByteString -> ByteString #

unEcb :: AESKey256 -> ByteString -> ByteString #

cbc :: AESKey256 -> IV AESKey256 -> ByteString -> (ByteString, IV AESKey256) #

unCbc :: AESKey256 -> IV AESKey256 -> ByteString -> (ByteString, IV AESKey256) #

ctr :: AESKey256 -> IV AESKey256 -> ByteString -> (ByteString, IV AESKey256) #

unCtr :: AESKey256 -> IV AESKey256 -> ByteString -> (ByteString, IV AESKey256) #

ctrLazy :: AESKey256 -> IV AESKey256 -> ByteString -> (ByteString, IV AESKey256) #

unCtrLazy :: AESKey256 -> IV AESKey256 -> ByteString -> (ByteString, IV AESKey256) #

cfb :: AESKey256 -> IV AESKey256 -> ByteString -> (ByteString, IV AESKey256) #

unCfb :: AESKey256 -> IV AESKey256 -> ByteString -> (ByteString, IV AESKey256) #

ofb :: AESKey256 -> IV AESKey256 -> ByteString -> (ByteString, IV AESKey256) #

unOfb :: AESKey256 -> IV AESKey256 -> ByteString -> (ByteString, IV AESKey256) #

cbcLazy :: AESKey256 -> IV AESKey256 -> ByteString -> (ByteString, IV AESKey256) #

unCbcLazy :: AESKey256 -> IV AESKey256 -> ByteString -> (ByteString, IV AESKey256) #

sivLazy :: AESKey256 -> AESKey256 -> [ByteString] -> ByteString -> Maybe ByteString #

unSivLazy :: AESKey256 -> AESKey256 -> [ByteString] -> ByteString -> Maybe ByteString #

siv :: AESKey256 -> AESKey256 -> [ByteString] -> ByteString -> Maybe ByteString #

unSiv :: AESKey256 -> AESKey256 -> [ByteString] -> ByteString -> Maybe ByteString #

ecbLazy :: AESKey256 -> ByteString -> ByteString #

unEcbLazy :: AESKey256 -> ByteString -> ByteString #

cfbLazy :: AESKey256 -> IV AESKey256 -> ByteString -> (ByteString, IV AESKey256) #

unCfbLazy :: AESKey256 -> IV AESKey256 -> ByteString -> (ByteString, IV AESKey256) #

ofbLazy :: AESKey256 -> IV AESKey256 -> ByteString -> (ByteString, IV AESKey256) #

unOfbLazy :: AESKey256 -> IV AESKey256 -> ByteString -> (ByteString, IV AESKey256) #

GetExpanded AESKey256 Source # 
Instance details

Defined in Crypto.Cipher.AES128.Internal

Methods

expandedKey :: AESKey256 -> ForeignPtr AESKeyStruct

AES_GCM AESKey256 Source # 
Instance details

Defined in Crypto.Cipher.AES128

class Serialize k => BlockCipher k where #

The BlockCipher class is intended as the generic interface targeted by maintainers of Haskell cipher implementations.

Minimum complete definition: blockSize, encryptBlock, decryptBlock, buildKey, and keyLength.

Instances must handle unaligned data

Minimal complete definition

blockSize, encryptBlock, decryptBlock, buildKey, keyLength

Methods

blockSize #

Arguments

:: Tagged k BitLength

The size of a single block; the smallest unit on which the cipher operates.

encryptBlock #

Arguments

:: k 
-> ByteString 
-> ByteString

encrypt data of size n*blockSize where n elem [0..] (ecb encryption)

decryptBlock #

Arguments

:: k 
-> ByteString 
-> ByteString

decrypt data of size n*blockSize where n elem [0..] (ecb decryption)

buildKey #

Arguments

:: ByteString 
-> Maybe k

smart constructor for keys from a bytestring.

keyLength #

Arguments

:: Tagged k BitLength

length of the cryptographic key

ecb :: k -> ByteString -> ByteString #

Electronic Cookbook (encryption)

unEcb :: k -> ByteString -> ByteString #

Electronic Cookbook (decryption)

cbc :: k -> IV k -> ByteString -> (ByteString, IV k) #

Cipherblock Chaining (encryption)

unCbc :: k -> IV k -> ByteString -> (ByteString, IV k) #

Cipherblock Chaining (decryption)

ctr :: k -> IV k -> ByteString -> (ByteString, IV k) #

Counter (encryption)

unCtr :: k -> IV k -> ByteString -> (ByteString, IV k) #

Counter (decryption)

ctrLazy :: k -> IV k -> ByteString -> (ByteString, IV k) #

Counter (encryption)

unCtrLazy :: k -> IV k -> ByteString -> (ByteString, IV k) #

Counter (decryption)

cfb :: k -> IV k -> ByteString -> (ByteString, IV k) #

Ciphertext feedback (encryption)

unCfb :: k -> IV k -> ByteString -> (ByteString, IV k) #

Ciphertext feedback (decryption)

ofb :: k -> IV k -> ByteString -> (ByteString, IV k) #

Output feedback (encryption)

unOfb :: k -> IV k -> ByteString -> (ByteString, IV k) #

Output feedback (decryption)

cbcLazy :: k -> IV k -> ByteString -> (ByteString, IV k) #

Cipher block chaining encryption for lazy bytestrings

unCbcLazy :: k -> IV k -> ByteString -> (ByteString, IV k) #

Cipher block chaining decryption for lazy bytestrings

sivLazy :: k -> k -> [ByteString] -> ByteString -> Maybe ByteString #

SIV (Synthetic IV) mode for lazy bytestrings. The third argument is the optional list of bytestrings to be authenticated but not encrypted As required by the specification this algorithm may return nothing when certain constraints aren't met.

unSivLazy :: k -> k -> [ByteString] -> ByteString -> Maybe ByteString #

SIV (Synthetic IV) for lazy bytestrings. The third argument is the optional list of bytestrings to be authenticated but not encrypted. As required by the specification this algorithm may return nothing when authentication fails.

siv :: k -> k -> [ByteString] -> ByteString -> Maybe ByteString #

SIV (Synthetic IV) mode for strict bytestrings. First argument is the optional list of bytestrings to be authenticated but not encrypted. As required by the specification this algorithm may return nothing when certain constraints aren't met.

unSiv :: k -> k -> [ByteString] -> ByteString -> Maybe ByteString #

SIV (Synthetic IV) for strict bytestrings First argument is the optional list of bytestrings to be authenticated but not encrypted As required by the specification this algorithm may return nothing when authentication fails.

ecbLazy :: k -> ByteString -> ByteString #

Cook book mode - not really a mode at all. If you don't know what you're doing, don't use this mode^H^H^H^H library.

unEcbLazy :: k -> ByteString -> ByteString #

ECB decrypt, complementary to ecb.

cfbLazy :: k -> IV k -> ByteString -> (ByteString, IV k) #

Ciphertext feed-back encryption mode for lazy bytestrings (with s == blockSize)

unCfbLazy :: k -> IV k -> ByteString -> (ByteString, IV k) #

Ciphertext feed-back decryption mode for lazy bytestrings (with s == blockSize)

ofbLazy :: k -> IV k -> ByteString -> (ByteString, IV k) #

Output feedback mode for lazy bytestrings

unOfbLazy :: k -> IV k -> ByteString -> (ByteString, IV k) #

Output feedback mode for lazy bytestrings

Instances
BlockCipher AESKey256 Source # 
Instance details

Defined in Crypto.Cipher.AES128

Methods

blockSize :: Tagged AESKey256 BitLength #

encryptBlock :: AESKey256 -> ByteString -> ByteString #

decryptBlock :: AESKey256 -> ByteString -> ByteString #

buildKey :: ByteString -> Maybe AESKey256 #

keyLength :: Tagged AESKey256 BitLength #

ecb :: AESKey256 -> ByteString -> ByteString #

unEcb :: AESKey256 -> ByteString -> ByteString #

cbc :: AESKey256 -> IV AESKey256 -> ByteString -> (ByteString, IV AESKey256) #

unCbc :: AESKey256 -> IV AESKey256 -> ByteString -> (ByteString, IV AESKey256) #

ctr :: AESKey256 -> IV AESKey256 -> ByteString -> (ByteString, IV AESKey256) #

unCtr :: AESKey256 -> IV AESKey256 -> ByteString -> (ByteString, IV AESKey256) #

ctrLazy :: AESKey256 -> IV AESKey256 -> ByteString -> (ByteString, IV AESKey256) #

unCtrLazy :: AESKey256 -> IV AESKey256 -> ByteString -> (ByteString, IV AESKey256) #

cfb :: AESKey256 -> IV AESKey256 -> ByteString -> (ByteString, IV AESKey256) #

unCfb :: AESKey256 -> IV AESKey256 -> ByteString -> (ByteString, IV AESKey256) #

ofb :: AESKey256 -> IV AESKey256 -> ByteString -> (ByteString, IV AESKey256) #

unOfb :: AESKey256 -> IV AESKey256 -> ByteString -> (ByteString, IV AESKey256) #

cbcLazy :: AESKey256 -> IV AESKey256 -> ByteString -> (ByteString, IV AESKey256) #

unCbcLazy :: AESKey256 -> IV AESKey256 -> ByteString -> (ByteString, IV AESKey256) #

sivLazy :: AESKey256 -> AESKey256 -> [ByteString] -> ByteString -> Maybe ByteString #

unSivLazy :: AESKey256 -> AESKey256 -> [ByteString] -> ByteString -> Maybe ByteString #

siv :: AESKey256 -> AESKey256 -> [ByteString] -> ByteString -> Maybe ByteString #

unSiv :: AESKey256 -> AESKey256 -> [ByteString] -> ByteString -> Maybe ByteString #

ecbLazy :: AESKey256 -> ByteString -> ByteString #

unEcbLazy :: AESKey256 -> ByteString -> ByteString #

cfbLazy :: AESKey256 -> IV AESKey256 -> ByteString -> (ByteString, IV AESKey256) #

unCfbLazy :: AESKey256 -> IV AESKey256 -> ByteString -> (ByteString, IV AESKey256) #

ofbLazy :: AESKey256 -> IV AESKey256 -> ByteString -> (ByteString, IV AESKey256) #

unOfbLazy :: AESKey256 -> IV AESKey256 -> ByteString -> (ByteString, IV AESKey256) #

BlockCipher AESKey192 Source # 
Instance details

Defined in Crypto.Cipher.AES128

Methods

blockSize :: Tagged AESKey192 BitLength #

encryptBlock :: AESKey192 -> ByteString -> ByteString #

decryptBlock :: AESKey192 -> ByteString -> ByteString #

buildKey :: ByteString -> Maybe AESKey192 #

keyLength :: Tagged AESKey192 BitLength #

ecb :: AESKey192 -> ByteString -> ByteString #

unEcb :: AESKey192 -> ByteString -> ByteString #

cbc :: AESKey192 -> IV AESKey192 -> ByteString -> (ByteString, IV AESKey192) #

unCbc :: AESKey192 -> IV AESKey192 -> ByteString -> (ByteString, IV AESKey192) #

ctr :: AESKey192 -> IV AESKey192 -> ByteString -> (ByteString, IV AESKey192) #

unCtr :: AESKey192 -> IV AESKey192 -> ByteString -> (ByteString, IV AESKey192) #

ctrLazy :: AESKey192 -> IV AESKey192 -> ByteString -> (ByteString, IV AESKey192) #

unCtrLazy :: AESKey192 -> IV AESKey192 -> ByteString -> (ByteString, IV AESKey192) #

cfb :: AESKey192 -> IV AESKey192 -> ByteString -> (ByteString, IV AESKey192) #

unCfb :: AESKey192 -> IV AESKey192 -> ByteString -> (ByteString, IV AESKey192) #

ofb :: AESKey192 -> IV AESKey192 -> ByteString -> (ByteString, IV AESKey192) #

unOfb :: AESKey192 -> IV AESKey192 -> ByteString -> (ByteString, IV AESKey192) #

cbcLazy :: AESKey192 -> IV AESKey192 -> ByteString -> (ByteString, IV AESKey192) #

unCbcLazy :: AESKey192 -> IV AESKey192 -> ByteString -> (ByteString, IV AESKey192) #

sivLazy :: AESKey192 -> AESKey192 -> [ByteString] -> ByteString -> Maybe ByteString #

unSivLazy :: AESKey192 -> AESKey192 -> [ByteString] -> ByteString -> Maybe ByteString #

siv :: AESKey192 -> AESKey192 -> [ByteString] -> ByteString -> Maybe ByteString #

unSiv :: AESKey192 -> AESKey192 -> [ByteString] -> ByteString -> Maybe ByteString #

ecbLazy :: AESKey192 -> ByteString -> ByteString #

unEcbLazy :: AESKey192 -> ByteString -> ByteString #

cfbLazy :: AESKey192 -> IV AESKey192 -> ByteString -> (ByteString, IV AESKey192) #

unCfbLazy :: AESKey192 -> IV AESKey192 -> ByteString -> (ByteString, IV AESKey192) #

ofbLazy :: AESKey192 -> IV AESKey192 -> ByteString -> (ByteString, IV AESKey192) #

unOfbLazy :: AESKey192 -> IV AESKey192 -> ByteString -> (ByteString, IV AESKey192) #

BlockCipher AESKey128 Source # 
Instance details

Defined in Crypto.Cipher.AES128

Methods

blockSize :: Tagged AESKey128 BitLength #

encryptBlock :: AESKey128 -> ByteString -> ByteString #

decryptBlock :: AESKey128 -> ByteString -> ByteString #

buildKey :: ByteString -> Maybe AESKey128 #

keyLength :: Tagged AESKey128 BitLength #

ecb :: AESKey128 -> ByteString -> ByteString #

unEcb :: AESKey128 -> ByteString -> ByteString #

cbc :: AESKey128 -> IV AESKey128 -> ByteString -> (ByteString, IV AESKey128) #

unCbc :: AESKey128 -> IV AESKey128 -> ByteString -> (ByteString, IV AESKey128) #

ctr :: AESKey128 -> IV AESKey128 -> ByteString -> (ByteString, IV AESKey128) #

unCtr :: AESKey128 -> IV AESKey128 -> ByteString -> (ByteString, IV AESKey128) #

ctrLazy :: AESKey128 -> IV AESKey128 -> ByteString -> (ByteString, IV AESKey128) #

unCtrLazy :: AESKey128 -> IV AESKey128 -> ByteString -> (ByteString, IV AESKey128) #

cfb :: AESKey128 -> IV AESKey128 -> ByteString -> (ByteString, IV AESKey128) #

unCfb :: AESKey128 -> IV AESKey128 -> ByteString -> (ByteString, IV AESKey128) #

ofb :: AESKey128 -> IV AESKey128 -> ByteString -> (ByteString, IV AESKey128) #

unOfb :: AESKey128 -> IV AESKey128 -> ByteString -> (ByteString, IV AESKey128) #

cbcLazy :: AESKey128 -> IV AESKey128 -> ByteString -> (ByteString, IV AESKey128) #

unCbcLazy :: AESKey128 -> IV AESKey128 -> ByteString -> (ByteString, IV AESKey128) #

sivLazy :: AESKey128 -> AESKey128 -> [ByteString] -> ByteString -> Maybe ByteString #

unSivLazy :: AESKey128 -> AESKey128 -> [ByteString] -> ByteString -> Maybe ByteString #

siv :: AESKey128 -> AESKey128 -> [ByteString] -> ByteString -> Maybe ByteString #

unSiv :: AESKey128 -> AESKey128 -> [ByteString] -> ByteString -> Maybe ByteString #

ecbLazy :: AESKey128 -> ByteString -> ByteString #

unEcbLazy :: AESKey128 -> ByteString -> ByteString #

cfbLazy :: AESKey128 -> IV AESKey128 -> ByteString -> (ByteString, IV AESKey128) #

unCfbLazy :: AESKey128 -> IV AESKey128 -> ByteString -> (ByteString, IV AESKey128) #

ofbLazy :: AESKey128 -> IV AESKey128 -> ByteString -> (ByteString, IV AESKey128) #

unOfbLazy :: AESKey128 -> IV AESKey128 -> ByteString -> (ByteString, IV AESKey128) #

buildKeyIO :: BlockCipher k => IO k #

Build a symmetric key using the system entropy (see Entropy)

zeroIV :: BlockCipher k => IV k #

Obtain an IV made only of zeroes

GCM Operations

makeGCMCtx :: AES_GCM k => ByteString -> Maybe (GCMCtx k) Source #

Given key material produce a context useful for GCM operations

aesKeyToGCM :: AES_GCM k => k -> GCMCtx k Source #

Given an AESKey produce a GCM Context.

data GCMCtx k Source #

A tuple of key and precomputed data for use by GCM

data AuthTag Source #

Constructors

AuthTag 
Instances
Eq AuthTag Source # 
Instance details

Defined in Crypto.Cipher.AES128

Methods

(==) :: AuthTag -> AuthTag -> Bool #

(/=) :: AuthTag -> AuthTag -> Bool #

class (BlockCipher k, GetExpanded k) => AES_GCM k Source #

Instances
AES_GCM AESKey256 Source # 
Instance details

Defined in Crypto.Cipher.AES128

AES_GCM AESKey192 Source # 
Instance details

Defined in Crypto.Cipher.AES128

AES_GCM AESKey128 Source # 
Instance details

Defined in Crypto.Cipher.AES128

encryptGCM Source #

Arguments

:: AES_GCM k 
=> GCMCtx k 
-> ByteString

IV

-> ByteString

Plaintext

-> ByteString

AAD

-> (ByteString, AuthTag) 

Encrypts multiple-of-block-sized input, returning a bytestring and tag.

decryptGCM Source #

Arguments

:: AES_GCM k 
=> GCMCtx k 
-> ByteString

IV

-> ByteString

Ciphertext

-> ByteString

AAD

-> (ByteString, AuthTag)

Plaintext and incremented context (or an error)

Decrypts multiple-of-block-sized input, returing a bytestring of the [ctr, ct, tag].

Orphan instances

Serialize AESKey256 Source # 
Instance details

Serialize AESKey192 Source # 
Instance details

Serialize AESKey128 Source # 
Instance details

BlockCipher AESKey256 Source # 
Instance details

Methods

blockSize :: Tagged AESKey256 BitLength #

encryptBlock :: AESKey256 -> ByteString -> ByteString #

decryptBlock :: AESKey256 -> ByteString -> ByteString #

buildKey :: ByteString -> Maybe AESKey256 #

keyLength :: Tagged AESKey256 BitLength #

ecb :: AESKey256 -> ByteString -> ByteString #

unEcb :: AESKey256 -> ByteString -> ByteString #

cbc :: AESKey256 -> IV AESKey256 -> ByteString -> (ByteString, IV AESKey256) #

unCbc :: AESKey256 -> IV AESKey256 -> ByteString -> (ByteString, IV AESKey256) #

ctr :: AESKey256 -> IV AESKey256 -> ByteString -> (ByteString, IV AESKey256) #

unCtr :: AESKey256 -> IV AESKey256 -> ByteString -> (ByteString, IV AESKey256) #

ctrLazy :: AESKey256 -> IV AESKey256 -> ByteString -> (ByteString, IV AESKey256) #

unCtrLazy :: AESKey256 -> IV AESKey256 -> ByteString -> (ByteString, IV AESKey256) #

cfb :: AESKey256 -> IV AESKey256 -> ByteString -> (ByteString, IV AESKey256) #

unCfb :: AESKey256 -> IV AESKey256 -> ByteString -> (ByteString, IV AESKey256) #

ofb :: AESKey256 -> IV AESKey256 -> ByteString -> (ByteString, IV AESKey256) #

unOfb :: AESKey256 -> IV AESKey256 -> ByteString -> (ByteString, IV AESKey256) #

cbcLazy :: AESKey256 -> IV AESKey256 -> ByteString -> (ByteString, IV AESKey256) #

unCbcLazy :: AESKey256 -> IV AESKey256 -> ByteString -> (ByteString, IV AESKey256) #

sivLazy :: AESKey256 -> AESKey256 -> [ByteString] -> ByteString -> Maybe ByteString #

unSivLazy :: AESKey256 -> AESKey256 -> [ByteString] -> ByteString -> Maybe ByteString #

siv :: AESKey256 -> AESKey256 -> [ByteString] -> ByteString -> Maybe ByteString #

unSiv :: AESKey256 -> AESKey256 -> [ByteString] -> ByteString -> Maybe ByteString #

ecbLazy :: AESKey256 -> ByteString -> ByteString #

unEcbLazy :: AESKey256 -> ByteString -> ByteString #

cfbLazy :: AESKey256 -> IV AESKey256 -> ByteString -> (ByteString, IV AESKey256) #

unCfbLazy :: AESKey256 -> IV AESKey256 -> ByteString -> (ByteString, IV AESKey256) #

ofbLazy :: AESKey256 -> IV AESKey256 -> ByteString -> (ByteString, IV AESKey256) #

unOfbLazy :: AESKey256 -> IV AESKey256 -> ByteString -> (ByteString, IV AESKey256) #

BlockCipher AESKey192 Source # 
Instance details

Methods

blockSize :: Tagged AESKey192 BitLength #

encryptBlock :: AESKey192 -> ByteString -> ByteString #

decryptBlock :: AESKey192 -> ByteString -> ByteString #

buildKey :: ByteString -> Maybe AESKey192 #

keyLength :: Tagged AESKey192 BitLength #

ecb :: AESKey192 -> ByteString -> ByteString #

unEcb :: AESKey192 -> ByteString -> ByteString #

cbc :: AESKey192 -> IV AESKey192 -> ByteString -> (ByteString, IV AESKey192) #

unCbc :: AESKey192 -> IV AESKey192 -> ByteString -> (ByteString, IV AESKey192) #

ctr :: AESKey192 -> IV AESKey192 -> ByteString -> (ByteString, IV AESKey192) #

unCtr :: AESKey192 -> IV AESKey192 -> ByteString -> (ByteString, IV AESKey192) #

ctrLazy :: AESKey192 -> IV AESKey192 -> ByteString -> (ByteString, IV AESKey192) #

unCtrLazy :: AESKey192 -> IV AESKey192 -> ByteString -> (ByteString, IV AESKey192) #

cfb :: AESKey192 -> IV AESKey192 -> ByteString -> (ByteString, IV AESKey192) #

unCfb :: AESKey192 -> IV AESKey192 -> ByteString -> (ByteString, IV AESKey192) #

ofb :: AESKey192 -> IV AESKey192 -> ByteString -> (ByteString, IV AESKey192) #

unOfb :: AESKey192 -> IV AESKey192 -> ByteString -> (ByteString, IV AESKey192) #

cbcLazy :: AESKey192 -> IV AESKey192 -> ByteString -> (ByteString, IV AESKey192) #

unCbcLazy :: AESKey192 -> IV AESKey192 -> ByteString -> (ByteString, IV AESKey192) #

sivLazy :: AESKey192 -> AESKey192 -> [ByteString] -> ByteString -> Maybe ByteString #

unSivLazy :: AESKey192 -> AESKey192 -> [ByteString] -> ByteString -> Maybe ByteString #

siv :: AESKey192 -> AESKey192 -> [ByteString] -> ByteString -> Maybe ByteString #

unSiv :: AESKey192 -> AESKey192 -> [ByteString] -> ByteString -> Maybe ByteString #

ecbLazy :: AESKey192 -> ByteString -> ByteString #

unEcbLazy :: AESKey192 -> ByteString -> ByteString #

cfbLazy :: AESKey192 -> IV AESKey192 -> ByteString -> (ByteString, IV AESKey192) #

unCfbLazy :: AESKey192 -> IV AESKey192 -> ByteString -> (ByteString, IV AESKey192) #

ofbLazy :: AESKey192 -> IV AESKey192 -> ByteString -> (ByteString, IV AESKey192) #

unOfbLazy :: AESKey192 -> IV AESKey192 -> ByteString -> (ByteString, IV AESKey192) #

BlockCipher AESKey128 Source # 
Instance details

Methods

blockSize :: Tagged AESKey128 BitLength #

encryptBlock :: AESKey128 -> ByteString -> ByteString #

decryptBlock :: AESKey128 -> ByteString -> ByteString #

buildKey :: ByteString -> Maybe AESKey128 #

keyLength :: Tagged AESKey128 BitLength #

ecb :: AESKey128 -> ByteString -> ByteString #

unEcb :: AESKey128 -> ByteString -> ByteString #

cbc :: AESKey128 -> IV AESKey128 -> ByteString -> (ByteString, IV AESKey128) #

unCbc :: AESKey128 -> IV AESKey128 -> ByteString -> (ByteString, IV AESKey128) #

ctr :: AESKey128 -> IV AESKey128 -> ByteString -> (ByteString, IV AESKey128) #

unCtr :: AESKey128 -> IV AESKey128 -> ByteString -> (ByteString, IV AESKey128) #

ctrLazy :: AESKey128 -> IV AESKey128 -> ByteString -> (ByteString, IV AESKey128) #

unCtrLazy :: AESKey128 -> IV AESKey128 -> ByteString -> (ByteString, IV AESKey128) #

cfb :: AESKey128 -> IV AESKey128 -> ByteString -> (ByteString, IV AESKey128) #

unCfb :: AESKey128 -> IV AESKey128 -> ByteString -> (ByteString, IV AESKey128) #

ofb :: AESKey128 -> IV AESKey128 -> ByteString -> (ByteString, IV AESKey128) #

unOfb :: AESKey128 -> IV AESKey128 -> ByteString -> (ByteString, IV AESKey128) #

cbcLazy :: AESKey128 -> IV AESKey128 -> ByteString -> (ByteString, IV AESKey128) #

unCbcLazy :: AESKey128 -> IV AESKey128 -> ByteString -> (ByteString, IV AESKey128) #

sivLazy :: AESKey128 -> AESKey128 -> [ByteString] -> ByteString -> Maybe ByteString #

unSivLazy :: AESKey128 -> AESKey128 -> [ByteString] -> ByteString -> Maybe ByteString #

siv :: AESKey128 -> AESKey128 -> [ByteString] -> ByteString -> Maybe ByteString #

unSiv :: AESKey128 -> AESKey128 -> [ByteString] -> ByteString -> Maybe ByteString #

ecbLazy :: AESKey128 -> ByteString -> ByteString #

unEcbLazy :: AESKey128 -> ByteString -> ByteString #

cfbLazy :: AESKey128 -> IV AESKey128 -> ByteString -> (ByteString, IV AESKey128) #

unCfbLazy :: AESKey128 -> IV AESKey128 -> ByteString -> (ByteString, IV AESKey128) #

ofbLazy :: AESKey128 -> IV AESKey128 -> ByteString -> (ByteString, IV AESKey128) #

unOfbLazy :: AESKey128 -> IV AESKey128 -> ByteString -> (ByteString, IV AESKey128) #