protected override CipherConfiguration GetCipherConfiguration(CipherTestCase testCase) { var config = CipherConfigurationFactory.CreateStreamCipherConfiguration(Cipher, testCase.Key.Length * 8); config.InitialisationVector = testCase.IV; return(config); }
protected override CipherConfiguration GetCipherConfiguration(CipherTestCase testCase) { if (String.IsNullOrEmpty(testCase.Extra)) { throw new InvalidOperationException("Block cipher test cases require block & padding information (extra is null/empty)."); } var extraDataSplit = testCase.Extra.Split(new[] { '/' }, StringSplitOptions.None); if (extraDataSplit.Length != 2) { throw new InvalidOperationException("Block cipher test cases require block & padding information."); } var config = CipherConfigurationFactory.CreateBlockCipherConfiguration(Cipher, extraDataSplit[0].ToEnum <BlockCipherMode>(), extraDataSplit[1].ToEnum <BlockCipherPadding>(), testCase.Key.Length * 8); config.InitialisationVector = testCase.IV; return(config); }
protected abstract CipherConfiguration GetCipherConfiguration(CipherTestCase testCase);