raaz-0.2.0: The raaz cryptographic library.

Safe HaskellNone
LanguageHaskell2010

Raaz.Cipher.AES

Contents

Description

The AES block cipher.

Synopsis

Documentation

data AES (n :: Nat) (mode :: CipherMode) #

The type associated with AES ciphers. Raaz provides AES variants with key lengths 128, 192 and 256. The key types for the above ciphers in cbc mode are given by the types (KEY128, IV), (KEY192, IV) (KEY256, IV) respectively.

Instances

Describable (AES 128 CBC) # 

Methods

name :: AES 128 CBC -> String #

description :: AES 128 CBC -> String #

Describable (AES 192 CBC) # 

Methods

name :: AES 192 CBC -> String #

description :: AES 192 CBC -> String #

Describable (AES 256 CBC) # 

Methods

name :: AES 256 CBC -> String #

description :: AES 256 CBC -> String #

Primitive (AES 128 CBC) #

The 128-bit aes cipher in cbc mode.

Associated Types

type Implementation (AES 128 CBC) :: * #

Methods

blockSize :: AES 128 CBC -> BYTES Int #

Primitive (AES 192 CBC) #

The 192-bit aes cipher in cbc mode.

Associated Types

type Implementation (AES 192 CBC) :: * #

Methods

blockSize :: AES 192 CBC -> BYTES Int #

Primitive (AES 256 CBC) #

The 256-bit aes cipher in cbc mode.

Associated Types

type Implementation (AES 256 CBC) :: * #

Methods

blockSize :: AES 256 CBC -> BYTES Int #

Cipher (AES 128 CBC) # 
Cipher (AES 192 CBC) # 
Cipher (AES 256 CBC) # 
type Key (AES 128 CBC) # 
type Key (AES 128 CBC) = (KEY128, IV)
type Key (AES 192 CBC) # 
type Key (AES 192 CBC) = (KEY192, IV)
type Key (AES 256 CBC) # 
type Key (AES 256 CBC) = (KEY256, IV)
type Implementation (AES 128 CBC) # 
type Implementation (AES 192 CBC) # 
type Implementation (AES 256 CBC) # 

data KEY128 #

Key used for AES-128

data KEY192 #

Key used for AES-128

data KEY256 #

Key used for AES-128

data IV #

The IV used by the CBC mode.

Instances

Show IV #

Shown as a its base16 encoding.

Methods

showsPrec :: Int -> IV -> ShowS #

show :: IV -> String #

showList :: [IV] -> ShowS #

IsString IV #

Expects in base16.

Methods

fromString :: String -> IV #

Storable IV # 

Methods

sizeOf :: IV -> Int #

alignment :: IV -> Int #

peekElemOff :: Ptr IV -> Int -> IO IV #

pokeElemOff :: Ptr IV -> Int -> IV -> IO () #

peekByteOff :: Ptr b -> Int -> IO IV #

pokeByteOff :: Ptr b -> Int -> IV -> IO () #

peek :: Ptr IV -> IO IV #

poke :: Ptr IV -> IV -> IO () #

EndianStore IV # 

Methods

store :: Ptr IV -> IV -> IO () #

load :: Ptr IV -> IO IV #

adjustEndian :: Ptr IV -> Int -> IO () #

Encodable IV # 
RandomStorable IV # 

Methods

fillRandomElements :: Memory mem => Int -> Ptr IV -> RT mem () #

Some AES cipher modes.

aes128cbc :: AES 128 CBC #

128-bit aes cipher in CBC mode.

aes192cbc :: AES 192 CBC #

128-bit aes cipher in CBC mode.

aes256cbc :: AES 256 CBC #

128-bit aes cipher in CBC mode.

aes128ctr :: AES 128 CTR #

Smart constructors for AES 128 ctr.