úÎ"t       ! ! ! portable betaThomas.DuBuisson@gmail.com "#$ portable betaThomas.DuBuisson@gmail.com%0Verify hashing a lazy bytestring is the same as + hashing the strict bytestring equivalent. &1Verify the Serialize and Binary instances result 9 in bytestrings of the correct length for a given digest '6Verify the Serilize and Binary (decode . encode = id) (verify: ! blockLength .::. d `rem` 8 == 0 )verify " outputLength .::. d `rem` 8 == 0 8Construct a test group to check common hash properties.  Properties include: Q Operating on lazy bytestrings obtains the same result as on strict bytestrings. R The length of the digest (instance definition) matches the Serialize definition.  encode . decode == id ( Hash block length is byte aligned (the  'crypto-api' operations require this!) < The digest (output) length is byte aligned (also needed by  'crypto-api') *some generic blockcipher tests +,-./012Build test groups for encrypt/decrypt identity and 8 equality of operations on strict and lazy ByteStrings. 7Admittedly, these tests conflate testing the algorithm 4 in question and testing the mode implementation in  'crypto-api',  but more testing isn't exactly a bad thing. 3 1Convert hex strings to bytestrings, for example:  0 "3adf91c0" ==> B.pack [0x3a, 0xdf, 0x91, 0xc0] QStrings of odd length will cause an exception as will non-hex characters such as '0x'.     OBased on NIST KATs, build a list of Tests for the instantiated AES algorithm.  e.g. -runTests $ makeAESTests (undefined :: AES128) :This is just a hack-job, if the BlockCipher instance doesn' t toss keys  of incorrect length then you'3ll get this test running, say, AES128 being tested 5 with the first 128 bits of AES192 and AES256 tests. 456    78   9:;<=>?@ABC    !"#$%&'()*+,-./0123456789:;<=>?@ABCBDEFGHIJK>Lcrypto-api-tests-0.1 Test.CryptoTest.ParseNistKATsTest.AESTest.SHA Test.HMAC Test.TwoFishTest.MD5Paths_crypto_api_teststest-framework-0.4.1.1Test.Framework.Runners.Console defaultMain TestCategory TypedTestNistTestRecord PropertiesparseCategoriesmakeHashPropTestsmakeBlockCipherPropTests hexStringToBS makeAESTests makeSHA1TestsmakeSHA224TestsmakeSHA256TestsmakeSHA384TestsmakeSHA512TestsmakeSHA1HMACTestsmakeSHA224HMACTestsmakeSHA256HMACTestsmakeSHA384HMACTestsmakeSHA512HMACTestsmakeTwoFishTests makeMD5TestscatchIOversionbindirlibdirdatadir libexecdir getBinDir getLibDir getDataDir getLibexecDirgetDataFileName getCategories parseTestschunkprop_LazyStrictEqualprop_DigestLenprop_GetPutHashprop_BlockLengthIsByteAlignedprop_OutputLengthIsByteAlignedgoodKeygetKeybIV comparePaddedprop_ECBEncDecIDprop_BlockMode_EncDec_ID takeBlockSizeprop_StrictLazyEqprop_ECBStrictLazyEqtoD getAES_KATsnistTestsToKAT_AESisEncgetTestshashNistTestToPairsnistTestToPairsalgToLengetKATs buildTestFuncbuildTestBasiclookupBtoKeymd5KATs