コード例 #1
0
ファイル: RSASettings.cs プロジェクト: xgalv/Cryptool2
 /// <summary>
 /// Constructs a new RSASettings
 /// detects the number of cores of the system and sets those to maximum number of cores
 /// which can be used
 /// </summary>
 public RSASettings()
 {
     CoresAvailable.Clear();
     for (int i = 0; i < Environment.ProcessorCount; i++)
     {
         CoresAvailable.Add((i + 1).ToString());
     }
     CoresUsed = Environment.ProcessorCount - 1;
 }
コード例 #2
0
 /// <summary>
 /// Constructs a new QuadraticSieveSettings
 ///
 /// Also calculates the amount of cores which can be used for the quadratic sieve
 /// </summary>
 public QuadraticSieveSettings(QuadraticSieve quadraticSieve)
 {
     this.quadraticSieve = quadraticSieve;
     CoresAvailable.Clear();
     for (int i = 0; i < Environment.ProcessorCount; i++)
     {
         CoresAvailable.Add((i + 1).ToString());
     }
     CoresUsed = Environment.ProcessorCount - 1;
 }
コード例 #3
0
        public KeySearcherSettings(KeySearcher ks, OpenCLManager oclManager)
        {
            keysearcher = ks;
            RefreshDevicesList(oclManager);

            CoresAvailable.Clear();
            for (int i = -1; i < Environment.ProcessorCount; i++)
            {
                CoresAvailable.Add((i + 1).ToString());
            }
            CoresUsed = Environment.ProcessorCount - 1;

            chunkSize = 21;

            KeyManager = new SimpleKeyManager("");
        }