| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Codec.Encryption.OpenPGP.SEIPDv1
Synopsis
- data MDCFailure
- mdcTrailerForSEIPDv1 :: IV -> ByteString -> ByteString
- renderMDCFailure :: MDCFailure -> String
- seipdv1NonceFromIV :: IV -> ByteString
- validateSEIPD1MDC :: ByteString -> ByteString -> Either MDCFailure ByteString
- calculateMDC :: ByteString -> ByteString -> Maybe ByteString
Documentation
data MDCFailure Source #
Constructors
| MDCTrailerMissing | |
| MDCTrailerCorrupted | |
| MDCDigestMismatch |
Instances
| Show MDCFailure Source # | |
Defined in Codec.Encryption.OpenPGP.SEIPDv1 | |
| Eq MDCFailure Source # | |
Defined in Codec.Encryption.OpenPGP.SEIPDv1 Methods (==) :: MDCFailure -> MDCFailure -> Bool Source # (/=) :: MDCFailure -> MDCFailure -> Bool Source # | |
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).
renderMDCFailure :: MDCFailure -> String Source #
seipdv1NonceFromIV :: IV -> ByteString Source #
The SEIPDv1 nonce: the IV bytes followed by its last two bytes (resync prefix).
validateSEIPD1MDC :: ByteString -> ByteString -> Either MDCFailure 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 #