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

Safe HaskellNone
LanguageHaskell2010

Crypto.Cipher.AES128.Internal

Contents

Synopsis

Documentation

data AESKey128

Constructors

AESKey128 

Fields

rawKey128 :: !RawKey128
 
expandedKey128 :: ForeignPtr AESKeyStruct
 

data AESKey192

Constructors

AESKey192 

Fields

rawKey192 :: !RawKey192
 
expandedKey192 :: ForeignPtr AESKeyStruct
 

data AESKey256

Constructors

AESKey256 

Fields

rawKey256 :: !RawKey256
 
expandedKey256 :: ForeignPtr AESKeyStruct
 

data RawKey128

Constructors

RKey128 

Fields

lowK128 :: !Word64
 
highK128 :: !Word64
 

data RawKey192

Constructors

RKey192 

Fields

lowK192 :: !Word64
 
midK192 :: !Word64
 
highK192 :: !Word64
 

data RawKey256

Constructors

RKey256 

Fields

aK256 :: !Word64
 
bK256 :: !Word64
 
cK256 :: !Word64
 
dK256 :: !Word64
 

data GCM k

Constructors

GCM 

Fields

_gcmFP :: GCMpc
 
_keyFP :: k
 
_ctxFP2 :: ForeignPtr CTXStruct
 

data GCMpc

generateKey128

Arguments

:: Ptr Word64

Buffer of 16 bytes of key material

-> IO (Maybe AESKey128) 

generateKey192

Arguments

:: Ptr Word64

Buffer of 16 bytes of key material

-> IO (Maybe AESKey192) 

generateKey256

Arguments

:: Ptr Word64

Buffer of 16 bytes of key material

-> IO (Maybe AESKey256) 

generateGCM :: GetExpanded k => k -> IO (GCM k)

precomputeGCMdata :: GetExpanded k => k -> IO GCMpc

encryptECB

Arguments

:: GetExpanded k 
=> k

The key

-> Ptr Word8

The result buffer

-> Ptr Word8

The source buffer

-> Int

The input size in blocks

-> IO () 

decryptECB

Arguments

:: GetExpanded k 
=> k

The key

-> Ptr Word8

The result buffer

-> Ptr Word8

The source buffer

-> Int

The input size in blocks

-> IO () 

encryptCTR

Arguments

:: GetExpanded k 
=> k 
-> Ptr Word8

IV

-> Ptr Word8

NEW IV

-> Ptr Word8

CT

-> Ptr Word8

PT

-> Int

Length in bytes

-> IO () 

decryptCTR

Arguments

:: GetExpanded k 
=> k 
-> Ptr Word8

IV

-> Ptr Word8

NEW IV

-> Ptr Word8

PT

-> Ptr Word8

CT

-> Int

Length in bytes

-> IO () 

encryptGCM :: GetExpanded k => k -> GCMpc -> Ptr Word8 -> Word32 -> Ptr Word8 -> Word32 -> Ptr Word8 -> Word32 -> Ptr Word8 -> Ptr Word8 -> IO ()

decryptGCM :: GetExpanded k => k -> GCMpc -> Ptr Word8 -> Word32 -> Ptr Word8 -> Word32 -> Ptr Word8 -> Word32 -> Ptr Word8 -> Ptr Word8 -> IO ()

Piece-meal functions

cipherOnlyGCM :: GetExpanded k => GCM k -> Ptr Word8 -> Ptr Word8 -> Int -> IO ()

decipherOnlyGCM :: GetExpanded k => GCM k -> Ptr Word8 -> Ptr Word8 -> Int -> IO ()

finishGCM :: GetExpanded k => GCM k -> Ptr Word8 -> IO ()

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