decodeAndDecrypt
  :: SB.ByteString -- ^ Passphrase
  -> SB.ByteString -- ^ Encoded ciphertext
  -> Either String SB.ByteString -- ^ Either an error or original plaintext
decodeAndDecrypt pass etxt = do
  (salt, c, mac, txt) <- decode etxt
  decrypt pass salt c mac txt

------------------------------------------------------------------------
-- Serialization
decodeAndDecrypt
  :: SB.ByteString -- ^ Passphrase
  -> SB.ByteString -- ^ Encoded ciphertext
  -> Either String SB.ByteString
decodeAndDecrypt pass etxt = do
  (salt, c, mac, txt) <- decode etxt
  decrypt pass salt c mac txt

------------------------------------------------------------------------
-- Serialization
decodeAndDecrypt pass etxt = do
  (salt, c, mac, txt) <- decode etxt
  decrypt pass salt c mac txt

------------------------------------------------------------------------
-- Serialization