encrypt :: SB.ByteString -- ^ Passphrase
        -> SB.ByteString -- ^ Salt
        -> Int           -- ^ Iteration count
        -> SB.ByteString -- ^ Message
        -> (SB.ByteString, SB.ByteString) -- ^ @(MAC, Ciphertext)@
encrypt pass salt c plain =
  let (ekey, hkey) = kdf pass salt c
      ctx = AES.initAES ekey
      txt = AES.encryptCTR ctx kNONCE plain
      mac = hmac256 hkey (sha256 salt `SB.append` sha256 txt)
  in (mac, txt)
encrypt :: SB.ByteString -- ^ Passphrase
        -> SB.ByteString -- ^ Salt
        -> Int           -- ^ Iteration count
        -> SB.ByteString -- ^ Message
        -> (SB.ByteString, SB.ByteString)
encrypt pass salt c plain =
  let (ekey, hkey) = kdf pass salt c
      ctx = AES.initAES ekey
      txt = AES.encryptCTR ctx kNONCE plain
      mac = hmac256 hkey (sha256 salt `SB.append` sha256 txt)
  in (mac, txt)
encrypt pass salt c plain =
  let (ekey, hkey) = kdf pass salt c
      ctx = AES.initAES ekey
      txt = AES.encryptCTR ctx kNONCE plain
      mac = hmac256 hkey (sha256 salt `SB.append` sha256 txt)
  in (mac, txt)