Crypto.Types

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

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

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

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

type BitLength = Int #

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

type ByteLength = Int #

The length fo a field in bytes.

data BlockCipherError #

Constructors

InputTooLong String |
AuthenticationFailed String |
Other String |

Instances

Eq BlockCipherError # |
Instance details Defined in Crypto.Types Methods (==) :: BlockCipherError -> BlockCipherError -> Bool # (/=) :: BlockCipherError -> BlockCipherError -> Bool #
Data BlockCipherError # |
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 # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c BlockCipherError # toConstr :: BlockCipherError -> Constr # dataTypeOf :: BlockCipherError -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c BlockCipherError) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c BlockCipherError) # gmapT :: (forall b. Data b => b -> b) -> BlockCipherError -> BlockCipherError # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> BlockCipherError -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> BlockCipherError -> r # gmapQ :: (forall d. Data d => d -> u) -> BlockCipherError -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> BlockCipherError -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> BlockCipherError -> m BlockCipherError # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> BlockCipherError -> m BlockCipherError # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> BlockCipherError -> m BlockCipherError #
Ord BlockCipherError # |
Instance details Defined in Crypto.Types Methods compare :: BlockCipherError -> BlockCipherError -> Ordering # (<) :: BlockCipherError -> BlockCipherError -> Bool # (<=) :: BlockCipherError -> BlockCipherError -> Bool # (>) :: BlockCipherError -> BlockCipherError -> Bool # (>=) :: BlockCipherError -> BlockCipherError -> Bool # max :: BlockCipherError -> BlockCipherError -> BlockCipherError # min :: BlockCipherError -> BlockCipherError -> BlockCipherError #
Read BlockCipherError # |
Instance details Defined in Crypto.Types Methods readsPrec :: Int -> ReadS BlockCipherError # readList :: ReadS [BlockCipherError] # readPrec :: ReadPrec BlockCipherError # readListPrec :: ReadPrec [BlockCipherError] #
Show BlockCipherError # |
Instance details Defined in Crypto.Types Methods showsPrec :: Int -> BlockCipherError -> ShowS # show :: BlockCipherError -> String # showList :: [BlockCipherError] -> ShowS #
Exception BlockCipherError # |
Instance details Defined in Crypto.Types Methods toException :: BlockCipherError -> SomeException # fromException :: SomeException -> Maybe BlockCipherError # displayException :: BlockCipherError -> String #