| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Codec.Encryption.OpenPGP.CFB
Synopsis
- decrypt :: SymmetricAlgorithm -> ByteString -> ByteString -> Either CipherError ByteString
- decryptPreservingNonce :: SymmetricAlgorithm -> ByteString -> ByteString -> Either CipherError (ByteString, ByteString)
- decryptNoNonce :: SymmetricAlgorithm -> IV -> ByteString -> ByteString -> Either CipherError ByteString
- decryptOpenPGPCfb :: SymmetricAlgorithm -> ByteString -> ByteString -> Either CipherError ByteString
- decryptOpenPGPCfbWithNonce :: SymmetricAlgorithm -> ByteString -> ByteString -> Either CipherError (ByteString, ByteString)
- data OpenPGPCFBMode
- data OpenPGPCFBModeW (mode :: OpenPGPCFBMode) where
- encryptNoNonce :: SymmetricAlgorithm -> S2K -> IV -> ByteString -> ByteString -> Either CipherError ByteString
- encryptOpenPGPCfbRaw :: forall (mode :: OpenPGPCFBMode). OpenPGPCFBModeW mode -> SymmetricAlgorithm -> IV -> ByteString -> ByteString -> Either CipherError ByteString
- mdcTrailerForSEIPDv1 :: IV -> ByteString -> ByteString
- seipdv1NonceFromIV :: IV -> ByteString
- validateSEIPD1MDC :: ByteString -> ByteString -> Either String ByteString
- calculateMDC :: ByteString -> ByteString -> Maybe ByteString
Documentation
decrypt :: SymmetricAlgorithm -> ByteString -> ByteString -> Either CipherError ByteString Source #
decryptPreservingNonce :: SymmetricAlgorithm -> ByteString -> ByteString -> Either CipherError (ByteString, ByteString) Source #
decryptNoNonce :: SymmetricAlgorithm -> IV -> ByteString -> ByteString -> Either CipherError ByteString Source #
decryptOpenPGPCfb :: SymmetricAlgorithm -> ByteString -> ByteString -> Either CipherError ByteString Source #
decryptOpenPGPCfbWithNonce :: SymmetricAlgorithm -> ByteString -> ByteString -> Either CipherError (ByteString, ByteString) Source #
data OpenPGPCFBMode Source #
Constructors
| OpenPGPCFBResync | |
| OpenPGPCFBNoResync |
Instances
| Show OpenPGPCFBMode Source # | |
Defined in Codec.Encryption.OpenPGP.CFB | |
| Eq OpenPGPCFBMode Source # | |
Defined in Codec.Encryption.OpenPGP.CFB Methods (==) :: OpenPGPCFBMode -> OpenPGPCFBMode -> Bool Source # (/=) :: OpenPGPCFBMode -> OpenPGPCFBMode -> Bool Source # | |
data OpenPGPCFBModeW (mode :: OpenPGPCFBMode) where Source #
Constructors
| OpenPGPCFBResyncW :: OpenPGPCFBModeW 'OpenPGPCFBResync | |
| OpenPGPCFBNoResyncW :: OpenPGPCFBModeW 'OpenPGPCFBNoResync |
encryptNoNonce :: SymmetricAlgorithm -> S2K -> IV -> ByteString -> ByteString -> Either CipherError ByteString Source #
Arguments
| :: forall (mode :: OpenPGPCFBMode). OpenPGPCFBModeW mode | |
| -> SymmetricAlgorithm | |
| -> IV | |
| -> ByteString | plaintext (with MDC trailer already appended) |
| -> ByteString | raw session key bytes |
| -> Either CipherError ByteString |
mdcTrailerForSEIPDv1 :: IV -> ByteString -> ByteString Source #
Compute the MDC trailer appended to SEIPDv1 plaintext before encryption.
The trailer is: 0xd3 0x14 SHA1(nonce || plaintext || 0xd3 0x14).
seipdv1NonceFromIV :: IV -> ByteString Source #
The SEIPDv1 nonce: the IV bytes followed by its last two bytes (resync prefix).
validateSEIPD1MDC :: ByteString -> ByteString -> Either String ByteString Source #
Verify the MDC trailer of a decrypted SEIPDv1 payload. Takes the CFB nonce (blockSize+2 prefix bytes retained from decryption) and the full decrypted bytes (payload + MDC packet), and returns the payload without the MDC trailer on success.
calculateMDC :: ByteString -> ByteString -> Maybe ByteString Source #