HORIZON HASKELLDocslts/ghc-9.10.x248f8f02026-10-05Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · 248f8f0 · 2026-10-05

Modulecrypto-api-tests-0.3Haskell98

Test.ParseNistKATs

NIST KAT files are composed of properties, such as:

   [SHA-1]
   [PredictionResistance = True]
   [EntropyInputSize = 128]

and individual known answer tests using these properties, ex:

   COUNT = 0
   EntropyInput = 7
   PersonalizationString =
   Result = 8

   COUNT = 1
   EntropyInput = 4
   PersonalizationString = 
   Result = 2

Using 'many parseCategory' this input would be converted to a single element list of TestCategory:

   [([("SHA-1",""), ("PredictionResistance", "True"), ("EntropyInputSize", "128")],
           [   [("COUNT", "0"), ("EntropyInput", "7"), ("PersonalizationString", ""), ("Result", "8")], 
             , [("COUNT", "1"), ("EntropyInput", "4"), ("PersonalizationString", ""), ("Result", "2")]])]

that is, a list of tuples, the first element is a list of properties (key/value pairs) and the second element is a list of tests. Each test is itself a list of records (key/value pairs). Properties apply to all tests contained in the second element of the tuple.

  • 5 types
  • 1 value