raaz-0.2.1: The raaz cryptographic library.
Safe HaskellSafe-Inferred
LanguageHaskell2010

Raaz.Cipher.AES

Description

The AES block cipher.

Synopsis

Documentation

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

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

Instances details
Cipher (AES 128 'CBC) Source # 
Instance details

Defined in Raaz.Cipher.AES.Internal

Cipher (AES 192 'CBC) Source # 
Instance details

Defined in Raaz.Cipher.AES.Internal

Cipher (AES 256 'CBC) Source # 
Instance details

Defined in Raaz.Cipher.AES.Internal

Primitive (AES 128 'CBC) Source #

The 128-bit aes cipher in cbc mode.

Instance details

Defined in Raaz.Cipher.AES.Internal

Associated Types

type Implementation (AES 128 'CBC) Source #

Methods

blockSize :: AES 128 'CBC -> BYTES Int Source #

Primitive (AES 192 'CBC) Source #

The 192-bit aes cipher in cbc mode.

Instance details

Defined in Raaz.Cipher.AES.Internal

Associated Types

type Implementation (AES 192 'CBC) Source #

Methods

blockSize :: AES 192 'CBC -> BYTES Int Source #

Primitive (AES 256 'CBC) Source #

The 256-bit aes cipher in cbc mode.

Instance details

Defined in Raaz.Cipher.AES.Internal

Associated Types

type Implementation (AES 256 'CBC) Source #

Methods

blockSize :: AES 256 'CBC -> BYTES Int Source #

Recommendation (AES 128 'CBC) Source #

Recommended implementation of AES-128 cbc

Instance details

Defined in Raaz.Cipher.AES.Recommendation

Methods

recommended :: AES 128 'CBC -> Implementation (AES 128 'CBC) Source #

Recommendation (AES 192 'CBC) Source #

Recommended implementation of AES-192 cbc

Instance details

Defined in Raaz.Cipher.AES.Recommendation

Methods

recommended :: AES 192 'CBC -> Implementation (AES 192 'CBC) Source #

Recommendation (AES 256 'CBC) Source #

Recommended implementation of AES-256 cbc

Instance details

Defined in Raaz.Cipher.AES.Recommendation

Methods

recommended :: AES 256 'CBC -> Implementation (AES 256 'CBC) Source #

Describable (AES 128 'CBC) Source # 
Instance details

Defined in Raaz.Cipher.AES.Internal

Methods

name :: AES 128 'CBC -> String Source #

description :: AES 128 'CBC -> String Source #

Describable (AES 192 'CBC) Source # 
Instance details

Defined in Raaz.Cipher.AES.Internal

Methods

name :: AES 192 'CBC -> String Source #

description :: AES 192 'CBC -> String Source #

Describable (AES 256 'CBC) Source # 
Instance details

Defined in Raaz.Cipher.AES.Internal

Methods

name :: AES 256 'CBC -> String Source #

description :: AES 256 'CBC -> String Source #

type Implementation (AES 128 'CBC) Source # 
Instance details

Defined in Raaz.Cipher.AES.Internal

type Implementation (AES 128 'CBC) = SomeCipherI (AES 128 'CBC)
type Implementation (AES 192 'CBC) Source # 
Instance details

Defined in Raaz.Cipher.AES.Internal

type Implementation (AES 192 'CBC) = SomeCipherI (AES 192 'CBC)
type Implementation (AES 256 'CBC) Source # 
Instance details

Defined in Raaz.Cipher.AES.Internal

type Implementation (AES 256 'CBC) = SomeCipherI (AES 256 'CBC)
type Key (AES 128 'CBC) Source #

Key is (KEY128,IV) pair.

Instance details

Defined in Raaz.Cipher.AES.Internal

type Key (AES 128 'CBC) = (KEY128, IV)
type Key (AES 192 'CBC) Source #

Key is (KEY192,IV) pair.

Instance details

Defined in Raaz.Cipher.AES.Internal

type Key (AES 192 'CBC) = (KEY192, IV)
type Key (AES 256 'CBC) Source #

Key is (KEY256,IV) pair.

Instance details

Defined in Raaz.Cipher.AES.Internal

type Key (AES 256 'CBC) = (KEY256, IV)

data KEY128 Source #

Key used for AES-128

data KEY192 Source #

Key used for AES-128

data KEY256 Source #

Key used for AES-128

data IV Source #

The IV used by the CBC mode.

Instances

Instances details
IsString IV Source #

Expects in base16.

Instance details

Defined in Raaz.Cipher.AES.Internal

Methods

fromString :: String -> IV Source #

Storable IV Source # 
Instance details

Defined in Raaz.Cipher.AES.Internal

Methods

sizeOf :: IV -> Int Source #

alignment :: IV -> Int Source #

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

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

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

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

peek :: Ptr IV -> IO IV Source #

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

Show IV Source #

Shown as a its base16 encoding.

Instance details

Defined in Raaz.Cipher.AES.Internal

Encodable IV Source # 
Instance details

Defined in Raaz.Cipher.AES.Internal

EndianStore IV Source # 
Instance details

Defined in Raaz.Cipher.AES.Internal

Methods

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

load :: Ptr IV -> IO IV Source #

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

RandomStorable IV Source # 
Instance details

Defined in Raaz.Cipher.AES.Internal

Methods

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

Some AES cipher modes.

aes128cbc :: AES 128 'CBC Source #

128-bit aes cipher in CBC mode.

aes192cbc :: AES 192 'CBC Source #

128-bit aes cipher in CBC mode.

aes256cbc :: AES 256 'CBC Source #

128-bit aes cipher in CBC mode.

aes128ctr :: AES 128 'CTR Source #

Smart constructors for AES 128 ctr.