Safe Haskell | None |
---|---|
Language | Haskell2010 |
Crypto.Cipher.AES128.Internal
Synopsis
- data AESKey128 = AESKey128 {
- rawKey128 :: !RawKey128
- expandedKey128 :: ForeignPtr AESKeyStruct
- data AESKey192 = AESKey192 {
- rawKey192 :: !RawKey192
- expandedKey192 :: ForeignPtr AESKeyStruct
- data AESKey256 = AESKey256 {
- rawKey256 :: !RawKey256
- expandedKey256 :: ForeignPtr AESKeyStruct
- data RawKey128 = RKey128 {}
- data RawKey192 = RKey192 {}
- data RawKey256 = RKey256 {}
- data GCM k = GCM {}
- 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
Documentation
Constructors
AESKey128 | |
Fields
|
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 |
Constructors
AESKey192 | |
Fields
|
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 |
Constructors
AESKey256 | |
Fields
|
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 |
Arguments
:: Ptr Word64 | Buffer of 16 bytes of key material |
-> IO (Maybe AESKey128) |
Arguments
:: Ptr Word64 | Buffer of 16 bytes of key material |
-> IO (Maybe AESKey192) |
Arguments
:: Ptr Word64 | Buffer of 16 bytes of key material |
-> IO (Maybe AESKey256) |
generateGCM :: GetExpanded k => k -> IO (GCM k) Source #
precomputeGCMdata :: GetExpanded k => k -> GCMpc Source #
Arguments
:: GetExpanded k | |
=> k | The key |
-> Ptr Word8 | The result buffer |
-> Ptr Word8 | The source buffer |
-> Int | The input size in blocks |
-> IO () |
Arguments
:: GetExpanded k | |
=> k | The key |
-> Ptr Word8 | The result buffer |
-> Ptr Word8 | The source buffer |
-> Int | The input size in blocks |
-> IO () |
Arguments
:: GetExpanded k | |
=> k | |
-> Ptr Word8 | IV |
-> Ptr Word8 | NEW IV |
-> Ptr Word8 | CT |
-> Ptr Word8 | PT |
-> Int | Length in bytes |
-> IO () |
Arguments
:: GetExpanded k | |
=> k | |
-> Ptr Word8 | IV |
-> Ptr Word8 | NEW IV |
-> Ptr Word8 | PT |
-> Ptr Word8 | CT |
-> Int | Length in bytes |
-> IO () |
encryptGCM :: GetExpanded k => k -> GCMpc -> Ptr Word8 -> Word32 -> Ptr Word8 -> Word32 -> Ptr Word8 -> Word32 -> Ptr Word8 -> Ptr Word8 -> IO () Source #
decryptGCM :: GetExpanded k => k -> GCMpc -> Ptr Word8 -> Word32 -> Ptr Word8 -> Word32 -> Ptr Word8 -> Word32 -> Ptr Word8 -> Ptr Word8 -> IO () Source #
Piece-meal functions
cipherOnlyGCM :: GetExpanded k => GCM k -> Ptr Word8 -> Ptr Word8 -> Int -> IO () Source #
decipherOnlyGCM :: GetExpanded k => GCM k -> Ptr Word8 -> Ptr Word8 -> Int -> IO () Source #
finishGCM :: GetExpanded k => GCM k -> Ptr Word8 -> IO () Source #
aadGCM :: GetExpanded k => GCM k -> Ptr Word8 -> Int -> IO () Source #
Internal, will not be exported in a near-future release.
class GetExpanded a Source #
Minimal complete definition
expandedKey
Instances
GetExpanded AESKey256 Source # | |
Defined in Crypto.Cipher.AES128.Internal Methods expandedKey :: AESKey256 -> ForeignPtr AESKeyStruct | |
GetExpanded AESKey192 Source # | |
Defined in Crypto.Cipher.AES128.Internal Methods expandedKey :: AESKey192 -> ForeignPtr AESKeyStruct | |
GetExpanded AESKey128 Source # | |
Defined in Crypto.Cipher.AES128.Internal Methods expandedKey :: AESKey128 -> ForeignPtr AESKeyStruct |