encode
  :: SB.ByteString -- ^ Salt
  -> Int           -- ^ c
  -> SB.ByteString -- ^ MAC
  -> SB.ByteString -- ^ Ciphertext
  -> SB.ByteString -- ^ @Base64 (c + Salt + MAC + Ciphertext)@
encode salt c mac txt = Base64.encode . Serialize.runPut $ do
  Serialize.putWord16le (fromIntegral c)
  Serialize.putByteString (SB.concat [ salt, mac, txt ])
encode
  :: SB.ByteString -- ^ Salt
  -> Int           -- ^ c
  -> SB.ByteString -- ^ MAC
  -> SB.ByteString -- ^ Ciphertext
  -> SB.ByteString
encode salt c mac txt = Base64.encode . Serialize.runPut $ do
  Serialize.putWord16le (fromIntegral c)
  Serialize.putByteString (SB.concat [ salt, mac, txt ])
encode salt c mac txt = Base64.encode . Serialize.runPut $ do
  Serialize.putWord16le (fromIntegral c)
  Serialize.putByteString (SB.concat [ salt, mac, txt ])