decode
  :: SB.ByteString
  -> Either String (SB.ByteString, Int, SB.ByteString, SB.ByteString)
  -- ^ Either error or @(Salt, c, MAC, Ciphertext)@.
decode = Base64.decode >=> Serialize.runGet (do
  c <- fromIntegral <$> Serialize.getWord16le
  s <- Serialize.getByteString kPrfOutLen
  m <- Serialize.getByteString kMacKeyLen
  e <- Serialize.getByteString =<< Serialize.remaining
  return (s, c, m, e))
decode
  :: SB.ByteString
  -> Either String (SB.ByteString, Int, SB.ByteString, SB.ByteString)
decode = Base64.decode >=> Serialize.runGet (do
  c <- fromIntegral <$> Serialize.getWord16le
  s <- Serialize.getByteString kPrfOutLen
  m <- Serialize.getByteString kMacKeyLen
  e <- Serialize.getByteString =<< Serialize.remaining
  return (s, c, m, e))
decode = Base64.decode >=> Serialize.runGet (do
  c <- fromIntegral <$> Serialize.getWord16le
  s <- Serialize.getByteString kPrfOutLen
  m <- Serialize.getByteString kMacKeyLen
  e <- Serialize.getByteString =<< Serialize.remaining
  return (s, c, m, e))