Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data RNCryptorException = InvalidHMACException !ByteString !ByteString
- data RNCryptorHeader = RNCryptorHeader {
- rncVersion :: !Word8
- rncOptions :: !Word8
- rncEncryptionSalt :: !EncryptionSalt
- rncHMACSalt :: !HMACSalt
- rncIV :: !IV
- data RNCryptorContext
- newRNCryptorContext :: Password -> RNCryptorHeader -> RNCryptorContext
- newRNCryptorHeader :: IO RNCryptorHeader
- newRNCryptorHeaderFrom :: EncryptionSalt -> HMACSalt -> IV -> RNCryptorHeader
- renderRNCryptorHeader :: RNCryptorHeader -> ByteString
- makeHMAC :: ByteString -> Password -> ByteString -> HMAC
- blockSize :: Int
- type Password = ByteString
- type HMAC = ByteString
- type Salt = ByteString
- type EncryptionKey = ByteString
- type EncryptionSalt = Salt
- type HMACSalt = Salt
- type IV = ByteString
Documentation
data RNCryptorException Source #
InvalidHMACException !ByteString !ByteString | HMAC validation failed. First parameter is the untrusted hmac, the second the computed one. |
Instances
Eq RNCryptorException Source # | |
Defined in Crypto.RNCryptor.Types (==) :: RNCryptorException -> RNCryptorException -> Bool # (/=) :: RNCryptorException -> RNCryptorException -> Bool # | |
Show RNCryptorException Source # | |
Defined in Crypto.RNCryptor.Types showsPrec :: Int -> RNCryptorException -> ShowS # show :: RNCryptorException -> String # showList :: [RNCryptorException] -> ShowS # | |
Exception RNCryptorException Source # | |
Defined in Crypto.RNCryptor.Types |
data RNCryptorHeader Source #
RNCryptorHeader | |
|
Instances
Show RNCryptorHeader Source # | |
Defined in Crypto.RNCryptor.Types showsPrec :: Int -> RNCryptorHeader -> ShowS # show :: RNCryptorHeader -> String # showList :: [RNCryptorHeader] -> ShowS # | |
Arbitrary RNCryptorHeader Source # | |
Defined in Crypto.RNCryptor.Types arbitrary :: Gen RNCryptorHeader # shrink :: RNCryptorHeader -> [RNCryptorHeader] # |
data RNCryptorContext Source #
newRNCryptorHeader :: IO RNCryptorHeader Source #
Generates a new RNCryptorHeader
, suitable for encryption.
newRNCryptorHeaderFrom :: EncryptionSalt -> HMACSalt -> IV -> RNCryptorHeader Source #
renderRNCryptorHeader :: RNCryptorHeader -> ByteString Source #
Concatenates this RNCryptorHeader
into a raw sequence of bytes, up to the
IV. This means you need to append the ciphertext plus the HMAC to finalise
the encrypted file.
makeHMAC :: ByteString -> Password -> ByteString -> HMAC Source #
Type synonyms to make the API more descriptive
type Password = ByteString Source #
type HMAC = ByteString Source #
type Salt = ByteString Source #
type EncryptionKey = ByteString Source #
type EncryptionSalt = Salt Source #
type IV = ByteString Source #