------------------------------------------------------------------------
-- Key derivation

kdf
  :: SB.ByteString
  -> SB.ByteString
  -> Int
  -> (SB.ByteString, SB.ByteString)
kdf pass salt c = SB.splitAt kEncKeyLen (PBKDF.sha512PBKDF2 pass salt c (kEncKeyLen + kMacKeyLen))
kdf
  :: SB.ByteString
  -> SB.ByteString
  -> Int
  -> (SB.ByteString, SB.ByteString)
kdf pass salt c = SB.splitAt kEncKeyLen (PBKDF.sha512PBKDF2 pass salt c (kEncKeyLen + kMacKeyLen))
kdf pass salt c = SB.splitAt kEncKeyLen (PBKDF.sha512PBKDF2 pass salt c (kEncKeyLen + kMacKeyLen))