示例#1
0
        private const int Iterations = 10000000;         // 10,000,000 (10 million)

        private static StreamCsPrng GetEngine(CsPseudorandomNumberGenerator cipher)
        {
            var config = CsPrngFactory.CreateStreamCipherCsprngConfiguration(cipher);
            var engine = CipherFactory.CreateStreamCipher(config.CipherName.ToEnum <StreamCipher>());

            return(new StreamCsPrng(engine, config.Key, config.Nonce));
        }
示例#2
0
        public static CsPrng CreateCsprng(StreamCipherCsprngConfiguration config)
        {
            var streamCipherEnum            = config.CipherName.ToEnum <StreamCipher>();
            StreamCipherEngine streamCipher = CipherFactory.CreateStreamCipher(streamCipherEnum);
            var csprng = new StreamCsPrng(streamCipher, config.Key, config.Nonce);

            return(csprng);
        }