| crypto-api-0.2.1: A generic interface for cryptographic operations | Contents | Index
Crypto.Modes |
Portability | portable
Stability | beta
Maintainer | Thomas.DuBuisson@gmail.com
Description
Generic mode implementations useable by any correct BlockCipher instance Be aware there are no tests for CFB mode yet. See Test.Crypto.
Synopsis
ecb :: BlockCipher k => k -> ByteString -> ByteString
unEcb :: BlockCipher k => k -> ByteString -> ByteString
cbc :: BlockCipher k => k -> IV k -> ByteString -> (ByteString, IV k)
unCbc :: BlockCipher k => k -> IV k -> ByteString -> (ByteString, IV k)
cfb :: BlockCipher k => k -> IV k -> ByteString -> (ByteString, IV k)
unCfb :: BlockCipher k => k -> IV k -> ByteString -> (ByteString, IV k)
ofb :: BlockCipher k => k -> IV k -> ByteString -> (ByteString, IV k)
unOfb :: BlockCipher k => k -> IV k -> ByteString -> (ByteString, IV k)
ecb' :: BlockCipher k => k -> ByteString -> ByteString
unEcb' :: BlockCipher k => k -> ByteString -> ByteString
cbc' :: BlockCipher k => k -> IV k -> ByteString -> (ByteString, IV k)
unCbc' :: BlockCipher k => k -> IV k -> ByteString -> (ByteString, IV k)
cfb' :: BlockCipher k => k -> IV k -> ByteString -> (ByteString, IV k)
unCfb' :: BlockCipher k => k -> IV k -> ByteString -> (ByteString, IV k)
ofb' :: BlockCipher k => k -> IV k -> ByteString -> (ByteString, IV k)
unOfb' :: BlockCipher k => k -> IV k -> ByteString -> (ByteString, IV k)
data IV k
getIV :: (BlockCipher k, CryptoRandomGen g) => g -> Either GenError (IV k, g)
getIVIO :: BlockCipher k => IO (IV k)
Documentation
ecb :: BlockCipher k => k -> ByteString -> ByteString
unEcb :: BlockCipher k => k -> ByteString -> ByteString
cbc :: BlockCipher k => k -> IV k -> ByteString -> (ByteString, IV k)
Cipher block chaining encryption for lazy bytestrings
unCbc :: BlockCipher k => k -> IV k -> ByteString -> (ByteString, IV k)
Cipher block chaining decryption for lazy bytestrings
cfb :: BlockCipher k => k -> IV k -> ByteString -> (ByteString, IV k)
Ciphertext feed-back encryption mode for lazy bytestrings (with s == blockSize)
unCfb :: BlockCipher k => k -> IV k -> ByteString -> (ByteString, IV k)
Ciphertext feed-back decryption mode for lazy bytestrings (with s == blockSize)
ofb :: BlockCipher k => k -> IV k -> ByteString -> (ByteString, IV k)
Output feedback mode for lazy bytestrings
unOfb :: BlockCipher k => k -> IV k -> ByteString -> (ByteString, IV k)
Output feedback mode for lazy bytestrings
ecb' :: BlockCipher k => k -> ByteString -> ByteString
unEcb' :: BlockCipher k => k -> ByteString -> ByteString
cbc' :: BlockCipher k => k -> IV k -> ByteString -> (ByteString, IV k)
zipWith xor + Pack This is written intentionally to take advantage of the bytestring libraries zipWith' rewrite rule but at the extra cost of the resulting lazy bytestring being more fragmented than either of the two inputs. zipWith xor + Pack As a result of rewrite rules, this should automatically be optimized (at compile time) to use the bytestring libraries zipWith' function. Cipher block chaining encryption mode on strict bytestrings
unCbc' :: BlockCipher k => k -> IV k -> ByteString -> (ByteString, IV k)
Cipher block chaining decryption for strict bytestrings
cfb' :: BlockCipher k => k -> IV k -> ByteString -> (ByteString, IV k)
Ciphertext feed-back encryption mode for strict bytestrings (with s == blockSize)
unCfb' :: BlockCipher k => k -> IV k -> ByteString -> (ByteString, IV k)
Ciphertext feed-back decryption mode for strict bytestrings (with s == blockSize)
ofb' :: BlockCipher k => k -> IV k -> ByteString -> (ByteString, IV k)
Output feedback mode for strict bytestrings
unOfb' :: BlockCipher k => k -> IV k -> ByteString -> (ByteString, IV k)
Output feedback mode for strict bytestrings
data IV k
Initilization Vectors for BlockCipher implementations (IV k) are used for various modes and guarrenteed to be blockSize bits long.
Instances
Eq (IV k) |
Ord (IV k) |
Show (IV k) |
BlockCipher k => Serialize (IV k) |
getIV :: (BlockCipher k, CryptoRandomGen g) => g -> Either GenError (IV k, g)
Obtain an `IV` using the provided CryptoRandomGenerator.
getIVIO :: BlockCipher k => IO (IV k)
Obtain an `IV` using the system entropy (see System.Crypto.Random)
Produced by Haddock version 2.7.2