raaz-0.2.1: The raaz cryptographic library.
Safe HaskellNone
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
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 #

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 #

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 #

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

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)
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)

data KEY128 Source #

Key used for AES-128

Instances

Instances details
Show KEY128 Source #

Shows in base 16

Instance details

Defined in Raaz.Cipher.AES.Internal

Methods

showsPrec :: Int -> KEY128 -> ShowS

show :: KEY128 -> String

showList :: [KEY128] -> ShowS

IsString KEY128 Source #

Expects in base 16

Instance details

Defined in Raaz.Cipher.AES.Internal

Methods

fromString :: String -> KEY128

Storable KEY128 Source # 
Instance details

Defined in Raaz.Cipher.AES.Internal

Methods

sizeOf :: KEY128 -> Int

alignment :: KEY128 -> Int

peekElemOff :: Ptr KEY128 -> Int -> IO KEY128

pokeElemOff :: Ptr KEY128 -> Int -> KEY128 -> IO ()

peekByteOff :: Ptr b -> Int -> IO KEY128

pokeByteOff :: Ptr b -> Int -> KEY128 -> IO ()

peek :: Ptr KEY128 -> IO KEY128

poke :: Ptr KEY128 -> KEY128 -> IO ()

EndianStore KEY128 Source # 
Instance details

Defined in Raaz.Cipher.AES.Internal

Methods

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

load :: Ptr KEY128 -> IO KEY128 Source #

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

Encodable KEY128 Source # 
Instance details

Defined in Raaz.Cipher.AES.Internal

Methods

toByteString :: KEY128 -> ByteString Source #

fromByteString :: ByteString -> Maybe KEY128 Source #

unsafeFromByteString :: ByteString -> KEY128 Source #

RandomStorable KEY128 Source # 
Instance details

Defined in Raaz.Cipher.AES.Internal

Methods

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

data KEY192 Source #

Key used for AES-128

Instances

Instances details
Show KEY192 Source #

Shows in base 16

Instance details

Defined in Raaz.Cipher.AES.Internal

Methods

showsPrec :: Int -> KEY192 -> ShowS

show :: KEY192 -> String

showList :: [KEY192] -> ShowS

IsString KEY192 Source #

Expects in base 16

Instance details

Defined in Raaz.Cipher.AES.Internal

Methods

fromString :: String -> KEY192

Storable KEY192 Source # 
Instance details

Defined in Raaz.Cipher.AES.Internal

Methods

sizeOf :: KEY192 -> Int

alignment :: KEY192 -> Int

peekElemOff :: Ptr KEY192 -> Int -> IO KEY192

pokeElemOff :: Ptr KEY192 -> Int -> KEY192 -> IO ()

peekByteOff :: Ptr b -> Int -> IO KEY192

pokeByteOff :: Ptr b -> Int -> KEY192 -> IO ()

peek :: Ptr KEY192 -> IO KEY192

poke :: Ptr KEY192 -> KEY192 -> IO ()

EndianStore KEY192 Source # 
Instance details

Defined in Raaz.Cipher.AES.Internal

Methods

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

load :: Ptr KEY192 -> IO KEY192 Source #

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

Encodable KEY192 Source # 
Instance details

Defined in Raaz.Cipher.AES.Internal

Methods

toByteString :: KEY192 -> ByteString Source #

fromByteString :: ByteString -> Maybe KEY192 Source #

unsafeFromByteString :: ByteString -> KEY192 Source #

RandomStorable KEY192 Source # 
Instance details

Defined in Raaz.Cipher.AES.Internal

Methods

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

data KEY256 Source #

Key used for AES-128

Instances

Instances details
Show KEY256 Source #

Shows in base 16

Instance details

Defined in Raaz.Cipher.AES.Internal

Methods

showsPrec :: Int -> KEY256 -> ShowS

show :: KEY256 -> String

showList :: [KEY256] -> ShowS

IsString KEY256 Source #

Expects in base 16

Instance details

Defined in Raaz.Cipher.AES.Internal

Methods

fromString :: String -> KEY256

Storable KEY256 Source # 
Instance details

Defined in Raaz.Cipher.AES.Internal

Methods

sizeOf :: KEY256 -> Int

alignment :: KEY256 -> Int

peekElemOff :: Ptr KEY256 -> Int -> IO KEY256

pokeElemOff :: Ptr KEY256 -> Int -> KEY256 -> IO ()

peekByteOff :: Ptr b -> Int -> IO KEY256

pokeByteOff :: Ptr b -> Int -> KEY256 -> IO ()

peek :: Ptr KEY256 -> IO KEY256

poke :: Ptr KEY256 -> KEY256 -> IO ()

EndianStore KEY256 Source # 
Instance details

Defined in Raaz.Cipher.AES.Internal

Methods

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

load :: Ptr KEY256 -> IO KEY256 Source #

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

Encodable KEY256 Source # 
Instance details

Defined in Raaz.Cipher.AES.Internal

Methods

toByteString :: KEY256 -> ByteString Source #

fromByteString :: ByteString -> Maybe KEY256 Source #

unsafeFromByteString :: ByteString -> KEY256 Source #

RandomStorable KEY256 Source # 
Instance details

Defined in Raaz.Cipher.AES.Internal

Methods

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

data IV Source #

The IV used by the CBC mode.

Instances

Instances details
Show IV Source #

Shown as a its base16 encoding.

Instance details

Defined in Raaz.Cipher.AES.Internal

Methods

showsPrec :: Int -> IV -> ShowS

show :: IV -> String

showList :: [IV] -> ShowS

IsString IV Source #

Expects in base16.

Instance details

Defined in Raaz.Cipher.AES.Internal

Methods

fromString :: String -> IV

Storable IV Source # 
Instance details

Defined in Raaz.Cipher.AES.Internal

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 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 #

Encodable IV Source # 
Instance details

Defined in Raaz.Cipher.AES.Internal

Methods

toByteString :: IV -> ByteString Source #

fromByteString :: ByteString -> Maybe IV Source #

unsafeFromByteString :: ByteString -> IV 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.