Exemplo n.º 1
0
        /// <summary>
        /// Adds a new Entropy Source to the Poller.
        /// </summary>
        /// <param name="source">The EntropySource object to add.</param>
        public void AddEntropySource(IEntropySource source)
        {
            lock (EntropySources)
                EntropySources.Add(source);

            AddEntropy(source.GetPrimer());
            MixPool();

            //Apply "whitening" effect. Try to mix the pool using RIPEMD-160 to strengthen
            //the cryptographic strength of the pool.
            //There is a need to catch the InvalidOperationException because if Eraser is
            //running under an OS with FIPS-compliance mode the RIPEMD-160 algorithm cannot
            //be used.
            HashAlgorithm secondaryHash = GetSecondaryHash();

            if (secondaryHash != null)
            {
                MixPool(secondaryHash);
            }
        }