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

Safe HaskellNone
LanguageHaskell2010

Crypto.Cipher.AES128.Internal

Contents

Synopsis

Documentation

data AESKey128 Source #

Constructors

AESKey128 

Fields

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 #

Constructors

AESKey192 

Fields

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 #

Constructors

AESKey256 

Fields

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

data RawKey128 Source #

Constructors

RKey128 

Fields

data RawKey192 Source #

Constructors

RKey192 

data RawKey256 Source #

Constructors

RKey256 

Fields

data GCM k Source #

Constructors

GCM 

Fields

generateKey128 Source #

Arguments

:: Ptr Word64

Buffer of 16 bytes of key material

-> IO (Maybe AESKey128) 

generateKey192 Source #

Arguments

:: Ptr Word64

Buffer of 16 bytes of key material

-> IO (Maybe AESKey192) 

generateKey256 Source #

Arguments

:: Ptr Word64

Buffer of 16 bytes of key material

-> IO (Maybe AESKey256) 

encryptECB Source #

Arguments

:: GetExpanded k 
=> k

The key

-> Ptr Word8

The result buffer

-> Ptr Word8

The source buffer

-> Int

The input size in blocks

-> IO () 

decryptECB Source #

Arguments

:: GetExpanded k 
=> k

The key

-> Ptr Word8

The result buffer

-> Ptr Word8

The source buffer

-> Int

The input size in blocks

-> IO () 

encryptCTR Source #

Arguments

:: GetExpanded k 
=> k 
-> Ptr Word8

IV

-> Ptr Word8

NEW IV

-> Ptr Word8

CT

-> Ptr Word8

PT

-> Int

Length in bytes

-> IO () 

decryptCTR Source #

Arguments

:: GetExpanded k 
=> k 
-> Ptr Word8

IV

-> Ptr Word8

NEW IV

-> Ptr Word8

PT

-> Ptr Word8

CT

-> Int

Length in bytes

-> IO () 

Piece-meal functions

aadGCM :: GetExpanded k => GCM k -> Ptr Word8 -> Int -> IO () Source #

Internal, will not be exported in a near-future release.

class GetExpanded a Source #

Minimal complete definition

expandedKey

Instances
GetExpanded AESKey256 Source # 
Instance details

Defined in Crypto.Cipher.AES128.Internal

Methods

expandedKey :: AESKey256 -> ForeignPtr AESKeyStruct

GetExpanded AESKey192 Source # 
Instance details

Defined in Crypto.Cipher.AES128.Internal

Methods

expandedKey :: AESKey192 -> ForeignPtr AESKeyStruct

GetExpanded AESKey128 Source # 
Instance details

Defined in Crypto.Cipher.AES128.Internal

Methods

expandedKey :: AESKey128 -> ForeignPtr AESKeyStruct