Changeset 2359


Ignore:
Timestamp:
11/7/2011 6:58:02 AM (3 years ago)
Author:
lowjoel
Message:

As far as the Plugins assembly is concerned, settings in the ManagerLibrary? are out of reach. The ManagerLibrary? will have to be the glue which pushes settings from the user to the Plugins.

As such, the PrngRegistrar? class will have internal methods to set the acting PRNG's GUID.

Location:
branches/eraser6/pluginsRewrite/Eraser.Plugins
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/eraser6/pluginsRewrite/Eraser.Plugins/ExtensionPoints/ErasureMethod.cs

    r2357 r2359  
    128128 
    129129            //Randomize. 
    130             Prng rand = Host.Instance.Prngs[ManagerLibrary.Settings.ActivePrng]; 
     130            Prng rand = Host.Instance.Prngs.ActivePrng; 
    131131            for (int i = 0; i < result.Length; ++i) 
    132132            { 
  • branches/eraser6/pluginsRewrite/Eraser.Plugins/ExtensionPoints/FileSystem.cs

    r2358 r2359  
    4747        { 
    4848            //Get the PRNG we are going to use 
    49             Prng prng = Host.Instance.Prngs[ManagerLibrary.Settings.ActivePrng]; 
     49            Prng prng = Host.Instance.Prngs.ActivePrng; 
    5050 
    5151            //Initialsie the base name, if any. 
     
    110110 
    111111            //Find a random entry. 
    112             Prng prng = Host.Instance.Prngs[ManagerLibrary.Settings.ActivePrng]; 
     112            Prng prng = Host.Instance.Prngs.ActivePrng; 
    113113            string result = string.Empty; 
    114114            while (result.Length == 0) 
     
    136136                List<string> entries = new List<string>( 
    137137                    ManagerLibrary.Settings.PlausibleDeniabilityFiles); 
    138                 Prng prng = Host.Instance.Prngs[ManagerLibrary.Settings.ActivePrng]; 
     138                Prng prng = Host.Instance.Prngs.ActivePrng; 
    139139                do 
    140140                { 
  • branches/eraser6/pluginsRewrite/Eraser.Plugins/Registrars/PrngRegistrar.cs

    r2357 r2359  
    4242 
    4343        /// <summary> 
     44        /// Gets the PRNG that is active. 
     45        /// </summary> 
     46        /// <remarks>Client code should set the <see cref="ActivePrngGuid"/> 
     47        /// member.</remarks> 
     48        public Prng ActivePrng 
     49        { 
     50            get 
     51            { 
     52                return this[ActivePrngGuid]; 
     53            } 
     54        } 
     55 
     56        /// <summary> 
     57        /// Sets the GUID of the active PRNG. 
     58        /// </summary> 
     59        private Guid ActivePrngGuid 
     60        { 
     61            get; 
     62            internal set; 
     63        } 
     64 
     65        /// <summary> 
    4466        /// Allows the EntropyThread to get entropy to the PRNG functions as seeds. 
    4567        /// </summary> 
     
    4769        internal void AddEntropy(byte[] entropy) 
    4870        { 
    49             lock (ManagerLibrary.Instance.PrngRegistrar) 
    50                 foreach (Prng prng in ManagerLibrary.Instance.PrngRegistrar) 
     71            lock (Host.Instance.Prngs) 
     72                foreach (Prng prng in Host.Instance.Prngs) 
    5173                    prng.Reseed(entropy); 
    52         } 
    53  
    54         /// <summary> 
    55         /// Gets entropy from the EntropyThread. 
    56         /// </summary> 
    57         /// <returns>A buffer of arbitrary length containing random information.</returns> 
    58         internal static byte[] GetEntropy() 
    59         { 
    60             return ManagerLibrary.Instance.EntropySourceRegistrar.Poller.GetPool(); 
    6174        } 
    6275    } 
Note: See TracChangeset for help on using the changeset viewer.