private static IEnumerator ReadTestDataFromFile()
        {
            var assembly = Assembly.GetAssembly(typeof(NistKbkdfTestData));

            using (var reader = new StreamReader((assembly.GetManifestResourceStream("NWebsec.SessionSecurity.Tests.Unit.KDFCTR_gen.txt"))))
            {
                var line = reader.ReadLine();
                while (line != null)
                {
                    if (!line.Equals("[PRF=HMAC_SHA256]"))
                    {
                        line = reader.ReadLine();
                        continue;
                    }
                    line = reader.ReadLine();
                    if (line == null || !line.Equals("[CTRLOCATION=BEFORE_FIXED]"))
                    {
                        line = reader.ReadLine();
                        continue;
                    }
                    line = reader.ReadLine();
                    if (line != null && line.Equals("[RLEN=8_BITS]"))
                    {
                        //We're there!
                        break;
                    }
                }
                //Now get Data
                var testData = new List <ITestCaseData>();

                line = reader.ReadLine();
                while (line != null && !line.StartsWith("["))
                {
                    if (line.Equals(String.Empty))
                    {
                        line = reader.ReadLine();
                        continue;
                    }

                    //Read a data chunk
                    var dataChunk = new HmacSha256CtrData();
                    var field     = line.Split('=');
                    if (!field[0].Trim().Equals("COUNT"))
                    {
                        throw new ApplicationException("Expected COUNT, but got: " + field[0]);
                    }
                    dataChunk.Count = Int32.Parse(field[1].Trim());
                    // ReSharper disable PossibleNullReferenceException
                    line  = reader.ReadLine();
                    field = line.Split('=');
                    if (!field[0].Trim().Equals("L"))
                    {
                        throw new ApplicationException("Expected L, but got: " + field[0]);
                    }
                    dataChunk.KeyLength = Int32.Parse(field[1].Trim());

                    line  = reader.ReadLine();
                    field = line.Split('=');
                    if (!field[0].Trim().Equals("KI"))
                    {
                        throw new ApplicationException("Expected KI, but got: " + field[0]);
                    }
                    dataChunk.Ki = field[1].Trim();

                    reader.ReadLine(); //Skip FixedInputDataByteLen

                    line  = reader.ReadLine();
                    field = line.Split('=');
                    if (!field[0].Trim().Equals("FixedInputData"))
                    {
                        throw new ApplicationException("Expected FixedInputData, but got: " + field[0]);
                    }
                    dataChunk.Input = field[1].Trim();

                    //Skip binary rep details
                    do
                    {
                        line = reader.ReadLine();
                    } while (line.StartsWith("\t"));

                    field = line.Split('=');
                    if (!field[0].Trim().Equals("KO"))
                    {
                        throw new ApplicationException("Expected KO , but got: " + field[0]);
                    }
                    dataChunk.Ko = field[1].Trim();

                    // ReSharper enable PossibleNullReferenceException
                    line = reader.ReadLine();
                    testData.Add(dataChunk);
                    //rince and repeat.
                }

                return(testData.GetEnumerator());
            }
        }
        private static IEnumerator ReadTestDataFromFile()
        {
            var assembly = Assembly.GetAssembly(typeof(NistKbkdfTestData));

            using (var reader = new StreamReader((assembly.GetManifestResourceStream("NWebsec.SessionSecurity.Tests.Unit.KDFCTR_gen.txt"))))
            {

                var line = reader.ReadLine();
                while (line != null)
                {
                    if (!line.Equals("[PRF=HMAC_SHA256]"))
                    {
                        line = reader.ReadLine();
                        continue;
                    }
                    line = reader.ReadLine();
                    if (line == null || !line.Equals("[CTRLOCATION=BEFORE_FIXED]"))
                    {
                        line = reader.ReadLine();
                        continue;
                    }
                    line = reader.ReadLine();
                    if (line != null && line.Equals("[RLEN=8_BITS]"))
                    {
                        //We're there!
                        break;
                    }
                }
                //Now get Data
                var testData = new List<ITestCaseData>();

                line = reader.ReadLine();
                while (line != null && !line.StartsWith("["))
                {
                    if (line.Equals(String.Empty))
                    {
                        line = reader.ReadLine();
                        continue;
                    }

                    //Read a data chunk
                    var dataChunk = new HmacSha256CtrData();
                    var field = line.Split('=');
                    if (!field[0].Trim().Equals("COUNT")) throw new ApplicationException("Expected COUNT, but got: " + field[0]);
                    dataChunk.Count = Int32.Parse(field[1].Trim());
                    // ReSharper disable PossibleNullReferenceException
                    line = reader.ReadLine();
                    field = line.Split('=');
                    if (!field[0].Trim().Equals("L")) throw new ApplicationException("Expected L, but got: " + field[0]);
                    dataChunk.KeyLength = Int32.Parse(field[1].Trim());

                    line = reader.ReadLine();
                    field = line.Split('=');
                    if (!field[0].Trim().Equals("KI")) throw new ApplicationException("Expected KI, but got: " + field[0]);
                    dataChunk.Ki = field[1].Trim();

                    reader.ReadLine(); //Skip FixedInputDataByteLen 

                    line = reader.ReadLine();
                    field = line.Split('=');
                    if (!field[0].Trim().Equals("FixedInputData")) throw new ApplicationException("Expected FixedInputData, but got: " + field[0]);
                    dataChunk.Input = field[1].Trim();

                    //Skip binary rep details
                    do
                    {
                        line = reader.ReadLine();
                    } while (line.StartsWith("\t"));

                    field = line.Split('=');
                    if (!field[0].Trim().Equals("KO")) throw new ApplicationException("Expected KO , but got: " + field[0]);
                    dataChunk.Ko = field[1].Trim();

                    // ReSharper enable PossibleNullReferenceException
                    line = reader.ReadLine();
                    testData.Add(dataChunk);
                    //rince and repeat.
                }

                return testData.GetEnumerator();
            }
        }