/usr/share/doc/libghc-cipher-aes128-doc/html/cipher-aes128.txt is in libghc-cipher-aes128-doc 0.7.0.1-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 | -- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/
-- | AES and common modes using AES-NI when available.
--
-- Cipher-aes128 is an implementation of AES and common modes of
-- operation. It borrows Hanquez's C AES code (see 'cipher-aes') but is
-- unique due to including compile-time detection of NI compiler support,
-- a slightly more functional interface for GCM operations, exposure of
-- <a>Ptr</a> based operations via the .Internal module, and build-in
-- crypto-api support. Cipher-aes128 was originally developed as
-- "'cipher-aes' plus trampolines", which has since been adopted into
-- cipher-aes.
@package cipher-aes128
@version 0.7.0.1
module Crypto.Cipher.AES128.Internal
data AESKey128
AESKey128 :: !RawKey128 -> ForeignPtr AESKeyStruct -> AESKey128
[rawKey128] :: AESKey128 -> !RawKey128
[expandedKey128] :: AESKey128 -> ForeignPtr AESKeyStruct
data AESKey192
AESKey192 :: !RawKey192 -> ForeignPtr AESKeyStruct -> AESKey192
[rawKey192] :: AESKey192 -> !RawKey192
[expandedKey192] :: AESKey192 -> ForeignPtr AESKeyStruct
data AESKey256
AESKey256 :: !RawKey256 -> ForeignPtr AESKeyStruct -> AESKey256
[rawKey256] :: AESKey256 -> !RawKey256
[expandedKey256] :: AESKey256 -> ForeignPtr AESKeyStruct
data RawKey128
RKey128 :: {-# UNPACK #-} !Word64 -> RawKey128
[lowK128, highK128] :: RawKey128 -> {-# UNPACK #-} !Word64
data RawKey192
RKey192 :: {-# UNPACK #-} !Word64 -> RawKey192
[lowK192, midK192, highK192] :: RawKey192 -> {-# UNPACK #-} !Word64
data RawKey256
RKey256 :: {-# UNPACK #-} !Word64 -> RawKey256
[aK256, bK256, cK256, dK256] :: RawKey256 -> {-# UNPACK #-} !Word64
data GCM k
GCM :: GCMpc -> k -> ForeignPtr CTXStruct -> GCM k
[_gcmFP] :: GCM k -> GCMpc
[_keyFP] :: GCM k -> k
[_ctxFP2] :: GCM k -> ForeignPtr CTXStruct
data GCMpc
generateKey128 :: Ptr Word64 -> IO (Maybe AESKey128)
generateKey192 :: Ptr Word64 -> IO (Maybe AESKey192)
generateKey256 :: Ptr Word64 -> IO (Maybe AESKey256)
generateGCM :: GetExpanded k => k -> IO (GCM k)
precomputeGCMdata :: GetExpanded k => k -> GCMpc
encryptECB :: GetExpanded k => k -> Ptr Word8 -> Ptr Word8 -> Int -> IO ()
decryptECB :: GetExpanded k => k -> Ptr Word8 -> Ptr Word8 -> Int -> IO ()
encryptCTR :: GetExpanded k => k -> Ptr Word8 -> Ptr Word8 -> Ptr Word8 -> Ptr Word8 -> Int -> IO ()
decryptCTR :: GetExpanded k => k -> Ptr Word8 -> Ptr Word8 -> Ptr Word8 -> Ptr Word8 -> Int -> IO ()
encryptGCM :: GetExpanded k => k -> GCMpc -> Ptr Word8 -> Word32 -> Ptr Word8 -> Word32 -> Ptr Word8 -> Word32 -> Ptr Word8 -> Ptr Word8 -> IO ()
decryptGCM :: GetExpanded k => k -> GCMpc -> Ptr Word8 -> Word32 -> Ptr Word8 -> Word32 -> Ptr Word8 -> Word32 -> Ptr Word8 -> Ptr Word8 -> IO ()
cipherOnlyGCM :: GetExpanded k => GCM k -> Ptr Word8 -> Ptr Word8 -> Int -> IO ()
decipherOnlyGCM :: GetExpanded k => GCM k -> Ptr Word8 -> Ptr Word8 -> Int -> IO ()
finishGCM :: GetExpanded k => GCM k -> Ptr Word8 -> IO ()
aadGCM :: GetExpanded k => GCM k -> Ptr Word8 -> Int -> IO ()
class GetExpanded a
instance Crypto.Cipher.AES128.Internal.GetExpanded Crypto.Cipher.AES128.Internal.AESKey256
instance Crypto.Cipher.AES128.Internal.GetExpanded Crypto.Cipher.AES128.Internal.AESKey192
instance Crypto.Cipher.AES128.Internal.GetExpanded Crypto.Cipher.AES128.Internal.AESKey128
module Crypto.Cipher.AES128
data AESKey128
data AESKey192
data AESKey256
-- | 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
class Serialize k => BlockCipher k
blockSize :: BlockCipher k => Tagged * k BitLength
encryptBlock :: BlockCipher k => k -> ByteString -> ByteString
decryptBlock :: BlockCipher k => k -> ByteString -> ByteString
buildKey :: BlockCipher k => ByteString -> Maybe k
keyLength :: BlockCipher k => Tagged * k BitLength
-- | Electronic Cookbook (encryption)
ecb :: BlockCipher k => k -> ByteString -> ByteString
-- | Electronic Cookbook (decryption)
unEcb :: BlockCipher k => k -> ByteString -> ByteString
-- | Cipherblock Chaining (encryption)
cbc :: BlockCipher k => k -> IV k -> ByteString -> (ByteString, IV k)
-- | Cipherblock Chaining (decryption)
unCbc :: BlockCipher k => k -> IV k -> ByteString -> (ByteString, IV k)
-- | Counter (encryption)
ctr :: BlockCipher k => k -> IV k -> ByteString -> (ByteString, IV k)
-- | Counter (decryption)
unCtr :: BlockCipher k => k -> IV k -> ByteString -> (ByteString, IV k)
-- | Counter (encryption)
ctrLazy :: BlockCipher k => k -> IV k -> ByteString -> (ByteString, IV k)
-- | Counter (decryption)
unCtrLazy :: BlockCipher k => k -> IV k -> ByteString -> (ByteString, IV k)
-- | Ciphertext feedback (encryption)
cfb :: BlockCipher k => k -> IV k -> ByteString -> (ByteString, IV k)
-- | Ciphertext feedback (decryption)
unCfb :: BlockCipher k => k -> IV k -> ByteString -> (ByteString, IV k)
-- | Output feedback (encryption)
ofb :: BlockCipher k => k -> IV k -> ByteString -> (ByteString, IV k)
-- | Output feedback (decryption)
unOfb :: BlockCipher k => k -> IV k -> ByteString -> (ByteString, IV k)
-- | Cipher block chaining encryption for lazy bytestrings
cbcLazy :: BlockCipher k => k -> IV k -> ByteString -> (ByteString, IV k)
-- | Cipher block chaining decryption for lazy bytestrings
unCbcLazy :: BlockCipher k => k -> IV k -> ByteString -> (ByteString, IV k)
-- | 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.
sivLazy :: BlockCipher k => k -> k -> [ByteString] -> ByteString -> Maybe ByteString
-- | 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.
unSivLazy :: BlockCipher k => k -> k -> [ByteString] -> ByteString -> Maybe ByteString
-- | 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.
siv :: BlockCipher k => k -> k -> [ByteString] -> ByteString -> Maybe ByteString
-- | 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.
unSiv :: BlockCipher k => k -> k -> [ByteString] -> ByteString -> Maybe ByteString
-- | 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.
ecbLazy :: BlockCipher k => k -> ByteString -> ByteString
-- | ECB decrypt, complementary to <a>ecb</a>.
unEcbLazy :: BlockCipher k => k -> ByteString -> ByteString
-- | Ciphertext feed-back encryption mode for lazy bytestrings (with s ==
-- blockSize)
cfbLazy :: BlockCipher k => k -> IV k -> ByteString -> (ByteString, IV k)
-- | Ciphertext feed-back decryption mode for lazy bytestrings (with s ==
-- blockSize)
unCfbLazy :: BlockCipher k => k -> IV k -> ByteString -> (ByteString, IV k)
-- | Output feedback mode for lazy bytestrings
ofbLazy :: BlockCipher k => k -> IV k -> ByteString -> (ByteString, IV k)
-- | Output feedback mode for lazy bytestrings
unOfbLazy :: BlockCipher k => k -> IV k -> ByteString -> (ByteString, IV k)
-- | Build a symmetric key using the system entropy (see <a>Entropy</a>)
buildKeyIO :: BlockCipher k => IO k
-- | Obtain an <a>IV</a> made only of zeroes
zeroIV :: BlockCipher k => IV k
-- | Given key material produce a context useful for GCM operations
makeGCMCtx :: AES_GCM k => ByteString -> Maybe (GCMCtx k)
-- | Given an AESKey produce a GCM Context.
aesKeyToGCM :: AES_GCM k => k -> GCMCtx k
-- | A tuple of key and precomputed data for use by GCM
data GCMCtx k
data AuthTag
AuthTag :: ByteString -> AuthTag
[unAuthTag] :: AuthTag -> ByteString
class (BlockCipher k, GetExpanded k) => AES_GCM k
-- | Encrypts multiple-of-block-sized input, returning a bytestring and
-- tag.
encryptGCM :: AES_GCM k => GCMCtx k -> ByteString -> ByteString -> ByteString -> (ByteString, AuthTag)
-- | Decrypts multiple-of-block-sized input, returing a bytestring of the
-- [ctr, ct, tag].
decryptGCM :: AES_GCM k => GCMCtx k -> ByteString -> ByteString -> ByteString -> (ByteString, AuthTag)
instance Data.Serialize.Serialize Crypto.Cipher.AES128.Internal.AESKey128
instance Data.Serialize.Serialize Crypto.Cipher.AES128.Internal.AESKey192
instance Data.Serialize.Serialize Crypto.Cipher.AES128.Internal.AESKey256
instance Crypto.Classes.BlockCipher Crypto.Cipher.AES128.Internal.AESKey128
instance Crypto.Classes.BlockCipher Crypto.Cipher.AES128.Internal.AESKey192
instance Crypto.Classes.BlockCipher Crypto.Cipher.AES128.Internal.AESKey256
instance GHC.Classes.Eq Crypto.Cipher.AES128.AuthTag
instance Crypto.Cipher.AES128.AES_GCM Crypto.Cipher.AES128.Internal.AESKey128
instance Crypto.Cipher.AES128.AES_GCM Crypto.Cipher.AES128.Internal.AESKey192
instance Crypto.Cipher.AES128.AES_GCM Crypto.Cipher.AES128.Internal.AESKey256
|