Safe Haskell | None |
---|---|
Language | Haskell2010 |
Crypto.Cipher.AES128
Synopsis
- data AESKey128
- data AESKey192
- data AESKey256
- class Serialize k => BlockCipher k where
- blockSize :: Tagged k BitLength
- encryptBlock :: k -> ByteString -> ByteString
- decryptBlock :: k -> ByteString -> ByteString
- buildKey :: ByteString -> Maybe k
- keyLength :: Tagged k BitLength
- ecb :: k -> ByteString -> ByteString
- unEcb :: k -> ByteString -> ByteString
- cbc :: k -> IV k -> ByteString -> (ByteString, IV k)
- unCbc :: k -> IV k -> ByteString -> (ByteString, IV k)
- ctr :: k -> IV k -> ByteString -> (ByteString, IV k)
- unCtr :: k -> IV k -> ByteString -> (ByteString, IV k)
- ctrLazy :: k -> IV k -> ByteString -> (ByteString, IV k)
- unCtrLazy :: k -> IV k -> ByteString -> (ByteString, IV k)
- cfb :: k -> IV k -> ByteString -> (ByteString, IV k)
- unCfb :: k -> IV k -> ByteString -> (ByteString, IV k)
- ofb :: k -> IV k -> ByteString -> (ByteString, IV k)
- unOfb :: k -> IV k -> ByteString -> (ByteString, IV k)
- cbcLazy :: k -> IV k -> ByteString -> (ByteString, IV k)
- unCbcLazy :: k -> IV k -> ByteString -> (ByteString, IV k)
- sivLazy :: k -> k -> [ByteString] -> ByteString -> Maybe ByteString
- unSivLazy :: k -> k -> [ByteString] -> ByteString -> Maybe ByteString
- siv :: k -> k -> [ByteString] -> ByteString -> Maybe ByteString
- unSiv :: k -> k -> [ByteString] -> ByteString -> Maybe ByteString
- ecbLazy :: k -> ByteString -> ByteString
- unEcbLazy :: k -> ByteString -> ByteString
- cfbLazy :: k -> IV k -> ByteString -> (ByteString, IV k)
- unCfbLazy :: k -> IV k -> ByteString -> (ByteString, IV k)
- ofbLazy :: k -> IV k -> ByteString -> (ByteString, IV k)
- unOfbLazy :: k -> IV k -> ByteString -> (ByteString, IV k)
- buildKeyIO :: BlockCipher k => IO k
- zeroIV :: BlockCipher k => IV k
- makeGCMCtx :: AES_GCM k => ByteString -> Maybe (GCMCtx k)
- aesKeyToGCM :: AES_GCM k => k -> GCMCtx k
- data GCMCtx k
- data AuthTag = AuthTag {
- unAuthTag :: ByteString
- class (BlockCipher k, GetExpanded k) => AES_GCM k
- encryptGCM :: AES_GCM k => GCMCtx k -> ByteString -> ByteString -> ByteString -> (ByteString, AuthTag)
- decryptGCM :: AES_GCM k => GCMCtx k -> ByteString -> ByteString -> ByteString -> (ByteString, AuthTag)
Key types with crypto-api instances
Instances
Serialize AESKey128 Source # | |
BlockCipher AESKey128 Source # | |
Defined in Crypto.Cipher.AES128 Methods blockSize :: Tagged AESKey128 BitLength Source # encryptBlock :: AESKey128 -> ByteString -> ByteString Source # decryptBlock :: AESKey128 -> ByteString -> ByteString Source # buildKey :: ByteString -> Maybe AESKey128 Source # keyLength :: Tagged AESKey128 BitLength Source # ecb :: AESKey128 -> ByteString -> ByteString Source # unEcb :: AESKey128 -> ByteString -> ByteString Source # cbc :: AESKey128 -> IV AESKey128 -> ByteString -> (ByteString, IV AESKey128) Source # unCbc :: AESKey128 -> IV AESKey128 -> ByteString -> (ByteString, IV AESKey128) Source # ctr :: AESKey128 -> IV AESKey128 -> ByteString -> (ByteString, IV AESKey128) Source # unCtr :: AESKey128 -> IV AESKey128 -> ByteString -> (ByteString, IV AESKey128) Source # ctrLazy :: AESKey128 -> IV AESKey128 -> ByteString -> (ByteString, IV AESKey128) Source # unCtrLazy :: AESKey128 -> IV AESKey128 -> ByteString -> (ByteString, IV AESKey128) Source # cfb :: AESKey128 -> IV AESKey128 -> ByteString -> (ByteString, IV AESKey128) Source # unCfb :: AESKey128 -> IV AESKey128 -> ByteString -> (ByteString, IV AESKey128) Source # ofb :: AESKey128 -> IV AESKey128 -> ByteString -> (ByteString, IV AESKey128) Source # unOfb :: AESKey128 -> IV AESKey128 -> ByteString -> (ByteString, IV AESKey128) Source # cbcLazy :: AESKey128 -> IV AESKey128 -> ByteString -> (ByteString, IV AESKey128) Source # unCbcLazy :: AESKey128 -> IV AESKey128 -> ByteString -> (ByteString, IV AESKey128) Source # sivLazy :: AESKey128 -> AESKey128 -> [ByteString] -> ByteString -> Maybe ByteString Source # unSivLazy :: AESKey128 -> AESKey128 -> [ByteString] -> ByteString -> Maybe ByteString Source # siv :: AESKey128 -> AESKey128 -> [ByteString] -> ByteString -> Maybe ByteString Source # unSiv :: AESKey128 -> AESKey128 -> [ByteString] -> ByteString -> Maybe ByteString Source # ecbLazy :: AESKey128 -> ByteString -> ByteString Source # unEcbLazy :: AESKey128 -> ByteString -> ByteString Source # cfbLazy :: AESKey128 -> IV AESKey128 -> ByteString -> (ByteString, IV AESKey128) Source # unCfbLazy :: AESKey128 -> IV AESKey128 -> ByteString -> (ByteString, IV AESKey128) Source # ofbLazy :: AESKey128 -> IV AESKey128 -> ByteString -> (ByteString, IV AESKey128) Source # unOfbLazy :: AESKey128 -> IV AESKey128 -> ByteString -> (ByteString, IV AESKey128) Source # | |
GetExpanded AESKey128 Source # | |
Defined in Crypto.Cipher.AES128.Internal Methods expandedKey :: AESKey128 -> ForeignPtr AESKeyStruct | |
AES_GCM AESKey128 Source # | |
Defined in Crypto.Cipher.AES128 |
Instances
Serialize AESKey192 Source # | |
BlockCipher AESKey192 Source # | |
Defined in Crypto.Cipher.AES128 Methods blockSize :: Tagged AESKey192 BitLength Source # encryptBlock :: AESKey192 -> ByteString -> ByteString Source # decryptBlock :: AESKey192 -> ByteString -> ByteString Source # buildKey :: ByteString -> Maybe AESKey192 Source # keyLength :: Tagged AESKey192 BitLength Source # ecb :: AESKey192 -> ByteString -> ByteString Source # unEcb :: AESKey192 -> ByteString -> ByteString Source # cbc :: AESKey192 -> IV AESKey192 -> ByteString -> (ByteString, IV AESKey192) Source # unCbc :: AESKey192 -> IV AESKey192 -> ByteString -> (ByteString, IV AESKey192) Source # ctr :: AESKey192 -> IV AESKey192 -> ByteString -> (ByteString, IV AESKey192) Source # unCtr :: AESKey192 -> IV AESKey192 -> ByteString -> (ByteString, IV AESKey192) Source # ctrLazy :: AESKey192 -> IV AESKey192 -> ByteString -> (ByteString, IV AESKey192) Source # unCtrLazy :: AESKey192 -> IV AESKey192 -> ByteString -> (ByteString, IV AESKey192) Source # cfb :: AESKey192 -> IV AESKey192 -> ByteString -> (ByteString, IV AESKey192) Source # unCfb :: AESKey192 -> IV AESKey192 -> ByteString -> (ByteString, IV AESKey192) Source # ofb :: AESKey192 -> IV AESKey192 -> ByteString -> (ByteString, IV AESKey192) Source # unOfb :: AESKey192 -> IV AESKey192 -> ByteString -> (ByteString, IV AESKey192) Source # cbcLazy :: AESKey192 -> IV AESKey192 -> ByteString -> (ByteString, IV AESKey192) Source # unCbcLazy :: AESKey192 -> IV AESKey192 -> ByteString -> (ByteString, IV AESKey192) Source # sivLazy :: AESKey192 -> AESKey192 -> [ByteString] -> ByteString -> Maybe ByteString Source # unSivLazy :: AESKey192 -> AESKey192 -> [ByteString] -> ByteString -> Maybe ByteString Source # siv :: AESKey192 -> AESKey192 -> [ByteString] -> ByteString -> Maybe ByteString Source # unSiv :: AESKey192 -> AESKey192 -> [ByteString] -> ByteString -> Maybe ByteString Source # ecbLazy :: AESKey192 -> ByteString -> ByteString Source # unEcbLazy :: AESKey192 -> ByteString -> ByteString Source # cfbLazy :: AESKey192 -> IV AESKey192 -> ByteString -> (ByteString, IV AESKey192) Source # unCfbLazy :: AESKey192 -> IV AESKey192 -> ByteString -> (ByteString, IV AESKey192) Source # ofbLazy :: AESKey192 -> IV AESKey192 -> ByteString -> (ByteString, IV AESKey192) Source # unOfbLazy :: AESKey192 -> IV AESKey192 -> ByteString -> (ByteString, IV AESKey192) Source # | |
GetExpanded AESKey192 Source # | |
Defined in Crypto.Cipher.AES128.Internal Methods expandedKey :: AESKey192 -> ForeignPtr AESKeyStruct | |
AES_GCM AESKey192 Source # | |
Defined in Crypto.Cipher.AES128 |
Instances
Serialize AESKey256 Source # | |
BlockCipher AESKey256 Source # | |
Defined in Crypto.Cipher.AES128 Methods blockSize :: Tagged AESKey256 BitLength Source # encryptBlock :: AESKey256 -> ByteString -> ByteString Source # decryptBlock :: AESKey256 -> ByteString -> ByteString Source # buildKey :: ByteString -> Maybe AESKey256 Source # keyLength :: Tagged AESKey256 BitLength Source # ecb :: AESKey256 -> ByteString -> ByteString Source # unEcb :: AESKey256 -> ByteString -> ByteString Source # cbc :: AESKey256 -> IV AESKey256 -> ByteString -> (ByteString, IV AESKey256) Source # unCbc :: AESKey256 -> IV AESKey256 -> ByteString -> (ByteString, IV AESKey256) Source # ctr :: AESKey256 -> IV AESKey256 -> ByteString -> (ByteString, IV AESKey256) Source # unCtr :: AESKey256 -> IV AESKey256 -> ByteString -> (ByteString, IV AESKey256) Source # ctrLazy :: AESKey256 -> IV AESKey256 -> ByteString -> (ByteString, IV AESKey256) Source # unCtrLazy :: AESKey256 -> IV AESKey256 -> ByteString -> (ByteString, IV AESKey256) Source # cfb :: AESKey256 -> IV AESKey256 -> ByteString -> (ByteString, IV AESKey256) Source # unCfb :: AESKey256 -> IV AESKey256 -> ByteString -> (ByteString, IV AESKey256) Source # ofb :: AESKey256 -> IV AESKey256 -> ByteString -> (ByteString, IV AESKey256) Source # unOfb :: AESKey256 -> IV AESKey256 -> ByteString -> (ByteString, IV AESKey256) Source # cbcLazy :: AESKey256 -> IV AESKey256 -> ByteString -> (ByteString, IV AESKey256) Source # unCbcLazy :: AESKey256 -> IV AESKey256 -> ByteString -> (ByteString, IV AESKey256) Source # sivLazy :: AESKey256 -> AESKey256 -> [ByteString] -> ByteString -> Maybe ByteString Source # unSivLazy :: AESKey256 -> AESKey256 -> [ByteString] -> ByteString -> Maybe ByteString Source # siv :: AESKey256 -> AESKey256 -> [ByteString] -> ByteString -> Maybe ByteString Source # unSiv :: AESKey256 -> AESKey256 -> [ByteString] -> ByteString -> Maybe ByteString Source # ecbLazy :: AESKey256 -> ByteString -> ByteString Source # unEcbLazy :: AESKey256 -> ByteString -> ByteString Source # cfbLazy :: AESKey256 -> IV AESKey256 -> ByteString -> (ByteString, IV AESKey256) Source # unCfbLazy :: AESKey256 -> IV AESKey256 -> ByteString -> (ByteString, IV AESKey256) Source # ofbLazy :: AESKey256 -> IV AESKey256 -> ByteString -> (ByteString, IV AESKey256) Source # unOfbLazy :: AESKey256 -> IV AESKey256 -> ByteString -> (ByteString, IV AESKey256) Source # | |
GetExpanded AESKey256 Source # | |
Defined in Crypto.Cipher.AES128.Internal Methods expandedKey :: AESKey256 -> ForeignPtr AESKeyStruct | |
AES_GCM AESKey256 Source # | |
Defined in Crypto.Cipher.AES128 |
class Serialize k => BlockCipher k where Source #
The BlockCipher class is intended as the generic interface targeted by maintainers of Haskell cipher implementations.
Minimum complete definition: blockSize, encryptBlock, decryptBlock, buildKey, and keyLength.
Instances must handle unaligned data
Minimal complete definition
Methods
Arguments
:: Tagged k BitLength | The size of a single block; the smallest unit on which the cipher operates. |
Arguments
:: k | |
-> ByteString | |
-> ByteString | encrypt data of size |
Arguments
:: k | |
-> ByteString | |
-> ByteString | decrypt data of size |
Arguments
:: ByteString | |
-> Maybe k | smart constructor for keys from a bytestring. |
ecb :: k -> ByteString -> ByteString Source #
Electronic Cookbook (encryption)
unEcb :: k -> ByteString -> ByteString Source #
Electronic Cookbook (decryption)
cbc :: k -> IV k -> ByteString -> (ByteString, IV k) Source #
Cipherblock Chaining (encryption)
unCbc :: k -> IV k -> ByteString -> (ByteString, IV k) Source #
Cipherblock Chaining (decryption)
ctr :: k -> IV k -> ByteString -> (ByteString, IV k) Source #
Counter (encryption)
unCtr :: k -> IV k -> ByteString -> (ByteString, IV k) Source #
Counter (decryption)
ctrLazy :: k -> IV k -> ByteString -> (ByteString, IV k) Source #
Counter (encryption)
unCtrLazy :: k -> IV k -> ByteString -> (ByteString, IV k) Source #
Counter (decryption)
cfb :: k -> IV k -> ByteString -> (ByteString, IV k) Source #
Ciphertext feedback (encryption)
unCfb :: k -> IV k -> ByteString -> (ByteString, IV k) Source #
Ciphertext feedback (decryption)
ofb :: k -> IV k -> ByteString -> (ByteString, IV k) Source #
Output feedback (encryption)
unOfb :: k -> IV k -> ByteString -> (ByteString, IV k) Source #
Output feedback (decryption)
cbcLazy :: k -> IV k -> ByteString -> (ByteString, IV k) Source #
Cipher block chaining encryption for lazy bytestrings
unCbcLazy :: k -> IV k -> ByteString -> (ByteString, IV k) Source #
Cipher block chaining decryption for lazy bytestrings
sivLazy :: k -> k -> [ByteString] -> ByteString -> Maybe ByteString Source #
SIV (Synthetic IV) mode for lazy bytestrings. The third argument is the optional list of bytestrings to be authenticated but not encrypted As required by the specification this algorithm may return nothing when certain constraints aren't met.
unSivLazy :: k -> k -> [ByteString] -> ByteString -> Maybe ByteString Source #
SIV (Synthetic IV) for lazy bytestrings. The third argument is the optional list of bytestrings to be authenticated but not encrypted. As required by the specification this algorithm may return nothing when authentication fails.
siv :: k -> k -> [ByteString] -> ByteString -> Maybe ByteString Source #
SIV (Synthetic IV) mode for strict bytestrings. First argument is the optional list of bytestrings to be authenticated but not encrypted. As required by the specification this algorithm may return nothing when certain constraints aren't met.
unSiv :: k -> k -> [ByteString] -> ByteString -> Maybe ByteString Source #
SIV (Synthetic IV) for strict bytestrings First argument is the optional list of bytestrings to be authenticated but not encrypted As required by the specification this algorithm may return nothing when authentication fails.
ecbLazy :: k -> ByteString -> ByteString Source #
Cook book mode - not really a mode at all. If you don't know what you're doing, don't use this mode^H^H^H^H library.
unEcbLazy :: k -> ByteString -> ByteString Source #
ECB decrypt, complementary to ecb
.
cfbLazy :: k -> IV k -> ByteString -> (ByteString, IV k) Source #
Ciphertext feed-back encryption mode for lazy bytestrings (with s == blockSize)
unCfbLazy :: k -> IV k -> ByteString -> (ByteString, IV k) Source #
Ciphertext feed-back decryption mode for lazy bytestrings (with s == blockSize)
ofbLazy :: k -> IV k -> ByteString -> (ByteString, IV k) Source #
Output feedback mode for lazy bytestrings
unOfbLazy :: k -> IV k -> ByteString -> (ByteString, IV k) Source #
Output feedback mode for lazy bytestrings
Instances
BlockCipher AESKey256 Source # | |
Defined in Crypto.Cipher.AES128 Methods blockSize :: Tagged AESKey256 BitLength Source # encryptBlock :: AESKey256 -> ByteString -> ByteString Source # decryptBlock :: AESKey256 -> ByteString -> ByteString Source # buildKey :: ByteString -> Maybe AESKey256 Source # keyLength :: Tagged AESKey256 BitLength Source # ecb :: AESKey256 -> ByteString -> ByteString Source # unEcb :: AESKey256 -> ByteString -> ByteString Source # cbc :: AESKey256 -> IV AESKey256 -> ByteString -> (ByteString, IV AESKey256) Source # unCbc :: AESKey256 -> IV AESKey256 -> ByteString -> (ByteString, IV AESKey256) Source # ctr :: AESKey256 -> IV AESKey256 -> ByteString -> (ByteString, IV AESKey256) Source # unCtr :: AESKey256 -> IV AESKey256 -> ByteString -> (ByteString, IV AESKey256) Source # ctrLazy :: AESKey256 -> IV AESKey256 -> ByteString -> (ByteString, IV AESKey256) Source # unCtrLazy :: AESKey256 -> IV AESKey256 -> ByteString -> (ByteString, IV AESKey256) Source # cfb :: AESKey256 -> IV AESKey256 -> ByteString -> (ByteString, IV AESKey256) Source # unCfb :: AESKey256 -> IV AESKey256 -> ByteString -> (ByteString, IV AESKey256) Source # ofb :: AESKey256 -> IV AESKey256 -> ByteString -> (ByteString, IV AESKey256) Source # unOfb :: AESKey256 -> IV AESKey256 -> ByteString -> (ByteString, IV AESKey256) Source # cbcLazy :: AESKey256 -> IV AESKey256 -> ByteString -> (ByteString, IV AESKey256) Source # unCbcLazy :: AESKey256 -> IV AESKey256 -> ByteString -> (ByteString, IV AESKey256) Source # sivLazy :: AESKey256 -> AESKey256 -> [ByteString] -> ByteString -> Maybe ByteString Source # unSivLazy :: AESKey256 -> AESKey256 -> [ByteString] -> ByteString -> Maybe ByteString Source # siv :: AESKey256 -> AESKey256 -> [ByteString] -> ByteString -> Maybe ByteString Source # unSiv :: AESKey256 -> AESKey256 -> [ByteString] -> ByteString -> Maybe ByteString Source # ecbLazy :: AESKey256 -> ByteString -> ByteString Source # unEcbLazy :: AESKey256 -> ByteString -> ByteString Source # cfbLazy :: AESKey256 -> IV AESKey256 -> ByteString -> (ByteString, IV AESKey256) Source # unCfbLazy :: AESKey256 -> IV AESKey256 -> ByteString -> (ByteString, IV AESKey256) Source # ofbLazy :: AESKey256 -> IV AESKey256 -> ByteString -> (ByteString, IV AESKey256) Source # unOfbLazy :: AESKey256 -> IV AESKey256 -> ByteString -> (ByteString, IV AESKey256) Source # | |
BlockCipher AESKey192 Source # | |
Defined in Crypto.Cipher.AES128 Methods blockSize :: Tagged AESKey192 BitLength Source # encryptBlock :: AESKey192 -> ByteString -> ByteString Source # decryptBlock :: AESKey192 -> ByteString -> ByteString Source # buildKey :: ByteString -> Maybe AESKey192 Source # keyLength :: Tagged AESKey192 BitLength Source # ecb :: AESKey192 -> ByteString -> ByteString Source # unEcb :: AESKey192 -> ByteString -> ByteString Source # cbc :: AESKey192 -> IV AESKey192 -> ByteString -> (ByteString, IV AESKey192) Source # unCbc :: AESKey192 -> IV AESKey192 -> ByteString -> (ByteString, IV AESKey192) Source # ctr :: AESKey192 -> IV AESKey192 -> ByteString -> (ByteString, IV AESKey192) Source # unCtr :: AESKey192 -> IV AESKey192 -> ByteString -> (ByteString, IV AESKey192) Source # ctrLazy :: AESKey192 -> IV AESKey192 -> ByteString -> (ByteString, IV AESKey192) Source # unCtrLazy :: AESKey192 -> IV AESKey192 -> ByteString -> (ByteString, IV AESKey192) Source # cfb :: AESKey192 -> IV AESKey192 -> ByteString -> (ByteString, IV AESKey192) Source # unCfb :: AESKey192 -> IV AESKey192 -> ByteString -> (ByteString, IV AESKey192) Source # ofb :: AESKey192 -> IV AESKey192 -> ByteString -> (ByteString, IV AESKey192) Source # unOfb :: AESKey192 -> IV AESKey192 -> ByteString -> (ByteString, IV AESKey192) Source # cbcLazy :: AESKey192 -> IV AESKey192 -> ByteString -> (ByteString, IV AESKey192) Source # unCbcLazy :: AESKey192 -> IV AESKey192 -> ByteString -> (ByteString, IV AESKey192) Source # sivLazy :: AESKey192 -> AESKey192 -> [ByteString] -> ByteString -> Maybe ByteString Source # unSivLazy :: AESKey192 -> AESKey192 -> [ByteString] -> ByteString -> Maybe ByteString Source # siv :: AESKey192 -> AESKey192 -> [ByteString] -> ByteString -> Maybe ByteString Source # unSiv :: AESKey192 -> AESKey192 -> [ByteString] -> ByteString -> Maybe ByteString Source # ecbLazy :: AESKey192 -> ByteString -> ByteString Source # unEcbLazy :: AESKey192 -> ByteString -> ByteString Source # cfbLazy :: AESKey192 -> IV AESKey192 -> ByteString -> (ByteString, IV AESKey192) Source # unCfbLazy :: AESKey192 -> IV AESKey192 -> ByteString -> (ByteString, IV AESKey192) Source # ofbLazy :: AESKey192 -> IV AESKey192 -> ByteString -> (ByteString, IV AESKey192) Source # unOfbLazy :: AESKey192 -> IV AESKey192 -> ByteString -> (ByteString, IV AESKey192) Source # | |
BlockCipher AESKey128 Source # | |
Defined in Crypto.Cipher.AES128 Methods blockSize :: Tagged AESKey128 BitLength Source # encryptBlock :: AESKey128 -> ByteString -> ByteString Source # decryptBlock :: AESKey128 -> ByteString -> ByteString Source # buildKey :: ByteString -> Maybe AESKey128 Source # keyLength :: Tagged AESKey128 BitLength Source # ecb :: AESKey128 -> ByteString -> ByteString Source # unEcb :: AESKey128 -> ByteString -> ByteString Source # cbc :: AESKey128 -> IV AESKey128 -> ByteString -> (ByteString, IV AESKey128) Source # unCbc :: AESKey128 -> IV AESKey128 -> ByteString -> (ByteString, IV AESKey128) Source # ctr :: AESKey128 -> IV AESKey128 -> ByteString -> (ByteString, IV AESKey128) Source # unCtr :: AESKey128 -> IV AESKey128 -> ByteString -> (ByteString, IV AESKey128) Source # ctrLazy :: AESKey128 -> IV AESKey128 -> ByteString -> (ByteString, IV AESKey128) Source # unCtrLazy :: AESKey128 -> IV AESKey128 -> ByteString -> (ByteString, IV AESKey128) Source # cfb :: AESKey128 -> IV AESKey128 -> ByteString -> (ByteString, IV AESKey128) Source # unCfb :: AESKey128 -> IV AESKey128 -> ByteString -> (ByteString, IV AESKey128) Source # ofb :: AESKey128 -> IV AESKey128 -> ByteString -> (ByteString, IV AESKey128) Source # unOfb :: AESKey128 -> IV AESKey128 -> ByteString -> (ByteString, IV AESKey128) Source # cbcLazy :: AESKey128 -> IV AESKey128 -> ByteString -> (ByteString, IV AESKey128) Source # unCbcLazy :: AESKey128 -> IV AESKey128 -> ByteString -> (ByteString, IV AESKey128) Source # sivLazy :: AESKey128 -> AESKey128 -> [ByteString] -> ByteString -> Maybe ByteString Source # unSivLazy :: AESKey128 -> AESKey128 -> [ByteString] -> ByteString -> Maybe ByteString Source # siv :: AESKey128 -> AESKey128 -> [ByteString] -> ByteString -> Maybe ByteString Source # unSiv :: AESKey128 -> AESKey128 -> [ByteString] -> ByteString -> Maybe ByteString Source # ecbLazy :: AESKey128 -> ByteString -> ByteString Source # unEcbLazy :: AESKey128 -> ByteString -> ByteString Source # cfbLazy :: AESKey128 -> IV AESKey128 -> ByteString -> (ByteString, IV AESKey128) Source # unCfbLazy :: AESKey128 -> IV AESKey128 -> ByteString -> (ByteString, IV AESKey128) Source # ofbLazy :: AESKey128 -> IV AESKey128 -> ByteString -> (ByteString, IV AESKey128) Source # unOfbLazy :: AESKey128 -> IV AESKey128 -> ByteString -> (ByteString, IV AESKey128) Source # |
buildKeyIO :: BlockCipher k => IO k Source #
Build a symmetric key using the system entropy (see Entropy
)
GCM Operations
makeGCMCtx :: AES_GCM k => ByteString -> Maybe (GCMCtx k) Source #
Given key material produce a context useful for GCM operations
aesKeyToGCM :: AES_GCM k => k -> GCMCtx k Source #
Given an AESKey produce a GCM Context.
class (BlockCipher k, GetExpanded k) => AES_GCM k Source #
Instances
AES_GCM AESKey256 Source # | |
Defined in Crypto.Cipher.AES128 | |
AES_GCM AESKey192 Source # | |
Defined in Crypto.Cipher.AES128 | |
AES_GCM AESKey128 Source # | |
Defined in Crypto.Cipher.AES128 |
Arguments
:: AES_GCM k | |
=> GCMCtx k | |
-> ByteString | IV |
-> ByteString | Plaintext |
-> ByteString | AAD |
-> (ByteString, AuthTag) |
Encrypts multiple-of-block-sized input, returning a bytestring and tag.
Arguments
:: AES_GCM k | |
=> GCMCtx k | |
-> ByteString | IV |
-> ByteString | Ciphertext |
-> ByteString | AAD |
-> (ByteString, AuthTag) | Plaintext and incremented context (or an error) |
Decrypts multiple-of-block-sized input, returing a bytestring of the [ctr, ct, tag].
Orphan instances
Serialize AESKey256 Source # | |
Serialize AESKey192 Source # | |
Serialize AESKey128 Source # | |
BlockCipher AESKey256 Source # | |
Methods blockSize :: Tagged AESKey256 BitLength Source # encryptBlock :: AESKey256 -> ByteString -> ByteString Source # decryptBlock :: AESKey256 -> ByteString -> ByteString Source # buildKey :: ByteString -> Maybe AESKey256 Source # keyLength :: Tagged AESKey256 BitLength Source # ecb :: AESKey256 -> ByteString -> ByteString Source # unEcb :: AESKey256 -> ByteString -> ByteString Source # cbc :: AESKey256 -> IV AESKey256 -> ByteString -> (ByteString, IV AESKey256) Source # unCbc :: AESKey256 -> IV AESKey256 -> ByteString -> (ByteString, IV AESKey256) Source # ctr :: AESKey256 -> IV AESKey256 -> ByteString -> (ByteString, IV AESKey256) Source # unCtr :: AESKey256 -> IV AESKey256 -> ByteString -> (ByteString, IV AESKey256) Source # ctrLazy :: AESKey256 -> IV AESKey256 -> ByteString -> (ByteString, IV AESKey256) Source # unCtrLazy :: AESKey256 -> IV AESKey256 -> ByteString -> (ByteString, IV AESKey256) Source # cfb :: AESKey256 -> IV AESKey256 -> ByteString -> (ByteString, IV AESKey256) Source # unCfb :: AESKey256 -> IV AESKey256 -> ByteString -> (ByteString, IV AESKey256) Source # ofb :: AESKey256 -> IV AESKey256 -> ByteString -> (ByteString, IV AESKey256) Source # unOfb :: AESKey256 -> IV AESKey256 -> ByteString -> (ByteString, IV AESKey256) Source # cbcLazy :: AESKey256 -> IV AESKey256 -> ByteString -> (ByteString, IV AESKey256) Source # unCbcLazy :: AESKey256 -> IV AESKey256 -> ByteString -> (ByteString, IV AESKey256) Source # sivLazy :: AESKey256 -> AESKey256 -> [ByteString] -> ByteString -> Maybe ByteString Source # unSivLazy :: AESKey256 -> AESKey256 -> [ByteString] -> ByteString -> Maybe ByteString Source # siv :: AESKey256 -> AESKey256 -> [ByteString] -> ByteString -> Maybe ByteString Source # unSiv :: AESKey256 -> AESKey256 -> [ByteString] -> ByteString -> Maybe ByteString Source # ecbLazy :: AESKey256 -> ByteString -> ByteString Source # unEcbLazy :: AESKey256 -> ByteString -> ByteString Source # cfbLazy :: AESKey256 -> IV AESKey256 -> ByteString -> (ByteString, IV AESKey256) Source # unCfbLazy :: AESKey256 -> IV AESKey256 -> ByteString -> (ByteString, IV AESKey256) Source # ofbLazy :: AESKey256 -> IV AESKey256 -> ByteString -> (ByteString, IV AESKey256) Source # unOfbLazy :: AESKey256 -> IV AESKey256 -> ByteString -> (ByteString, IV AESKey256) Source # | |
BlockCipher AESKey192 Source # | |
Methods blockSize :: Tagged AESKey192 BitLength Source # encryptBlock :: AESKey192 -> ByteString -> ByteString Source # decryptBlock :: AESKey192 -> ByteString -> ByteString Source # buildKey :: ByteString -> Maybe AESKey192 Source # keyLength :: Tagged AESKey192 BitLength Source # ecb :: AESKey192 -> ByteString -> ByteString Source # unEcb :: AESKey192 -> ByteString -> ByteString Source # cbc :: AESKey192 -> IV AESKey192 -> ByteString -> (ByteString, IV AESKey192) Source # unCbc :: AESKey192 -> IV AESKey192 -> ByteString -> (ByteString, IV AESKey192) Source # ctr :: AESKey192 -> IV AESKey192 -> ByteString -> (ByteString, IV AESKey192) Source # unCtr :: AESKey192 -> IV AESKey192 -> ByteString -> (ByteString, IV AESKey192) Source # ctrLazy :: AESKey192 -> IV AESKey192 -> ByteString -> (ByteString, IV AESKey192) Source # unCtrLazy :: AESKey192 -> IV AESKey192 -> ByteString -> (ByteString, IV AESKey192) Source # cfb :: AESKey192 -> IV AESKey192 -> ByteString -> (ByteString, IV AESKey192) Source # unCfb :: AESKey192 -> IV AESKey192 -> ByteString -> (ByteString, IV AESKey192) Source # ofb :: AESKey192 -> IV AESKey192 -> ByteString -> (ByteString, IV AESKey192) Source # unOfb :: AESKey192 -> IV AESKey192 -> ByteString -> (ByteString, IV AESKey192) Source # cbcLazy :: AESKey192 -> IV AESKey192 -> ByteString -> (ByteString, IV AESKey192) Source # unCbcLazy :: AESKey192 -> IV AESKey192 -> ByteString -> (ByteString, IV AESKey192) Source # sivLazy :: AESKey192 -> AESKey192 -> [ByteString] -> ByteString -> Maybe ByteString Source # unSivLazy :: AESKey192 -> AESKey192 -> [ByteString] -> ByteString -> Maybe ByteString Source # siv :: AESKey192 -> AESKey192 -> [ByteString] -> ByteString -> Maybe ByteString Source # unSiv :: AESKey192 -> AESKey192 -> [ByteString] -> ByteString -> Maybe ByteString Source # ecbLazy :: AESKey192 -> ByteString -> ByteString Source # unEcbLazy :: AESKey192 -> ByteString -> ByteString Source # cfbLazy :: AESKey192 -> IV AESKey192 -> ByteString -> (ByteString, IV AESKey192) Source # unCfbLazy :: AESKey192 -> IV AESKey192 -> ByteString -> (ByteString, IV AESKey192) Source # ofbLazy :: AESKey192 -> IV AESKey192 -> ByteString -> (ByteString, IV AESKey192) Source # unOfbLazy :: AESKey192 -> IV AESKey192 -> ByteString -> (ByteString, IV AESKey192) Source # | |
BlockCipher AESKey128 Source # | |
Methods blockSize :: Tagged AESKey128 BitLength Source # encryptBlock :: AESKey128 -> ByteString -> ByteString Source # decryptBlock :: AESKey128 -> ByteString -> ByteString Source # buildKey :: ByteString -> Maybe AESKey128 Source # keyLength :: Tagged AESKey128 BitLength Source # ecb :: AESKey128 -> ByteString -> ByteString Source # unEcb :: AESKey128 -> ByteString -> ByteString Source # cbc :: AESKey128 -> IV AESKey128 -> ByteString -> (ByteString, IV AESKey128) Source # unCbc :: AESKey128 -> IV AESKey128 -> ByteString -> (ByteString, IV AESKey128) Source # ctr :: AESKey128 -> IV AESKey128 -> ByteString -> (ByteString, IV AESKey128) Source # unCtr :: AESKey128 -> IV AESKey128 -> ByteString -> (ByteString, IV AESKey128) Source # ctrLazy :: AESKey128 -> IV AESKey128 -> ByteString -> (ByteString, IV AESKey128) Source # unCtrLazy :: AESKey128 -> IV AESKey128 -> ByteString -> (ByteString, IV AESKey128) Source # cfb :: AESKey128 -> IV AESKey128 -> ByteString -> (ByteString, IV AESKey128) Source # unCfb :: AESKey128 -> IV AESKey128 -> ByteString -> (ByteString, IV AESKey128) Source # ofb :: AESKey128 -> IV AESKey128 -> ByteString -> (ByteString, IV AESKey128) Source # unOfb :: AESKey128 -> IV AESKey128 -> ByteString -> (ByteString, IV AESKey128) Source # cbcLazy :: AESKey128 -> IV AESKey128 -> ByteString -> (ByteString, IV AESKey128) Source # unCbcLazy :: AESKey128 -> IV AESKey128 -> ByteString -> (ByteString, IV AESKey128) Source # sivLazy :: AESKey128 -> AESKey128 -> [ByteString] -> ByteString -> Maybe ByteString Source # unSivLazy :: AESKey128 -> AESKey128 -> [ByteString] -> ByteString -> Maybe ByteString Source # siv :: AESKey128 -> AESKey128 -> [ByteString] -> ByteString -> Maybe ByteString Source # unSiv :: AESKey128 -> AESKey128 -> [ByteString] -> ByteString -> Maybe ByteString Source # ecbLazy :: AESKey128 -> ByteString -> ByteString Source # unEcbLazy :: AESKey128 -> ByteString -> ByteString Source # cfbLazy :: AESKey128 -> IV AESKey128 -> ByteString -> (ByteString, IV AESKey128) Source # unCfbLazy :: AESKey128 -> IV AESKey128 -> ByteString -> (ByteString, IV AESKey128) Source # ofbLazy :: AESKey128 -> IV AESKey128 -> ByteString -> (ByteString, IV AESKey128) Source # unOfbLazy :: AESKey128 -> IV AESKey128 -> ByteString -> (ByteString, IV AESKey128) Source # |