module Crypto.Cipher.Tests
( testBlockCipher
, testStreamCipher
, defaultKATs
, defaultStreamKATs
, KATs(..)
, KAT_Stream(..)
, KAT_ECB(..)
, KAT_CBC(..)
, KAT_CFB(..)
, KAT_CTR(..)
, KAT_XTS(..)
, KAT_AEAD(..)
) where
import Test.Framework (Test, testGroup)
import Crypto.Cipher.Types
import Crypto.Cipher.Tests.KATs
import Crypto.Cipher.Tests.Properties
testBlockCipher :: BlockCipher a => KATs -> a -> Test
testBlockCipher kats cipher = testGroup (cipherName cipher)
( (if kats == defaultKATs then [] else [testKATs kats cipher])
++ testModes cipher
)
testStreamCipher :: StreamCipher a => [KAT_Stream] -> a -> Test
testStreamCipher kats cipher = testGroup (cipherName cipher)
( (if kats == defaultStreamKATs then [] else [testStreamKATs kats cipher])
++ testStream cipher
)