crypto-api-0.13.3: A generic interface for cryptographic operations

Safe Haskell | Safe-Inferred
Language | Haskell98

Crypto.Types

Description

Type aliases used throughout the crypto-api modules.

Synopsis

- data IV k = IV {
  - initializationVector :: !ByteString
  }
- type BitLength = Int
- type ByteLength = Int
- data BlockCipherError
  - = InputTooLong String
  - | AuthenticationFailed String
  - | Other String

# Documentation

data IV k Source #

Initilization Vectors for BlockCipher implementations (IV k) are used for various modes and guarrenteed to be blockSize bits long. The common ways to obtain an IV are to generate one (`getIV` or `getIVIO`) or to use one provided with the ciphertext (using the `Serialize` instance of IV).

`zeroIV` also exists and is of particular use for starting `ctr` mode with a fresh key.

Constructors

IV |

Fields

- initializationVector :: !ByteString

#### Instances

Instances details

BlockCipher k => Serialize (IV k) Source # |
Instance details Defined in Crypto.Classes Methods put :: Putter (IV k) Source # get :: Get (IV k) Source #
Show (IV k) Source # |
Instance details Defined in Crypto.Types Methods showsPrec :: Int -> IV k -> ShowS Source # show :: IV k -> String Source # showList :: [IV k] -> ShowS Source #
Eq (IV k) Source # |
Instance details Defined in Crypto.Types Methods (==) :: IV k -> IV k -> Bool Source # (/=) :: IV k -> IV k -> Bool Source #
Ord (IV k) Source # |
Instance details Defined in Crypto.Types Methods compare :: IV k -> IV k -> Ordering Source # (<) :: IV k -> IV k -> Bool Source # (<=) :: IV k -> IV k -> Bool Source # (>) :: IV k -> IV k -> Bool Source # (>=) :: IV k -> IV k -> Bool Source # max :: IV k -> IV k -> IV k Source # min :: IV k -> IV k -> IV k Source #

type BitLength = Int Source #

The length of a field (usually a ByteString) in bits

type ByteLength = Int Source #

The length fo a field in bytes.

data BlockCipherError Source #

Constructors

InputTooLong String |
AuthenticationFailed String |
Other String |

#### Instances

Instances details

Data BlockCipherError Source # |

Instance details

Defined in Crypto.Types

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> BlockCipherError -> c BlockCipherError Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c BlockCipherError Source #

toConstr :: BlockCipherError -> Constr Source #

dataTypeOf :: BlockCipherError -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c BlockCipherError) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c BlockCipherError) Source #

gmapT :: (forall b. Data b => b -> b) -> BlockCipherError -> BlockCipherError Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> BlockCipherError -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> BlockCipherError -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> BlockCipherError -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> BlockCipherError -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> BlockCipherError -> m BlockCipherError Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> BlockCipherError -> m BlockCipherError Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> BlockCipherError -> m BlockCipherError Source #

Exception BlockCipherError Source # |
Instance details Defined in Crypto.Types Methods toException :: BlockCipherError -> SomeException Source # fromException :: SomeException -> Maybe BlockCipherError Source # displayException :: BlockCipherError -> String Source # backtraceDesired :: BlockCipherError -> Bool Source #
Read BlockCipherError Source # |
Instance details Defined in Crypto.Types Methods readsPrec :: Int -> ReadS BlockCipherError Source # readList :: ReadS [BlockCipherError] Source # readPrec :: ReadPrec BlockCipherError Source # readListPrec :: ReadPrec [BlockCipherError] Source #
Show BlockCipherError Source # |
Instance details Defined in Crypto.Types Methods showsPrec :: Int -> BlockCipherError -> ShowS Source # show :: BlockCipherError -> String Source # showList :: [BlockCipherError] -> ShowS Source #
Eq BlockCipherError Source # |
Instance details Defined in Crypto.Types Methods (==) :: BlockCipherError -> BlockCipherError -> Bool Source # (/=) :: BlockCipherError -> BlockCipherError -> Bool Source #
Ord BlockCipherError Source # |

Instance details

Defined in Crypto.Types

Methods

compare :: BlockCipherError -> BlockCipherError -> Ordering Source #

(<) :: BlockCipherError -> BlockCipherError -> Bool Source #

(<=) :: BlockCipherError -> BlockCipherError -> Bool Source #

(>) :: BlockCipherError -> BlockCipherError -> Bool Source #

(>=) :: BlockCipherError -> BlockCipherError -> Bool Source #

max :: BlockCipherError -> BlockCipherError -> BlockCipherError Source #

min :: BlockCipherError -> BlockCipherError -> BlockCipherError Source #