| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Codec.Encryption.OpenPGP.SEIPDv1
Synopsis
- mdcTrailerForSEIPDv1 :: IV -> ByteString -> ByteString
- seipdv1NonceFromIV :: IV -> ByteString
- validateSEIPD1MDC :: ByteString -> ByteString -> Either MDCFailure ByteString
- calculateMDC :: ByteString -> ByteString -> Maybe ByteString
Documentation
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 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 #