/// <summary> /// Finds all keys. /// </summary> public void FindAllKeys() { InitLists(); for (var alpha = 1; alpha < P - 1; alpha++) { for (var a = 1; a < P - 1; a++) { if ((alpha * a) % (P - 1) == 1) { for (var beta = 1; beta < P - 1; beta++) { for (var b = 1; b < P - 1; b++) { if ((beta * b) % (P - 1) == 1 && (alpha * a * beta * b) % (P - 1) == 1) { AlphaList.Add(alpha); BetaList.Add(beta); AList.Add(a); BList.Add(b); } } } } } } }
/// <summary> /// Initializes the lists. /// </summary> private void InitLists() { if (AlphaList == null) { AlphaList = new List <int>(); } else { AlphaList.Clear(); } if (BetaList == null) { BetaList = new List <int>(); } else { BetaList.Clear(); } if (AList == null) { AList = new List <int>(); } else { AList.Clear(); } if (BList == null) { BList = new List <int>(); } else { BList.Clear(); } }
public static void DownloadAll(out PremiumList premiumList, out BanList banList, out BetaList betaList) { ServicePointManager.ServerCertificateValidationCallback = Validator; var web = new WebClient(); premiumList = JsonConvert.DeserializeObject <PremiumList>(web.DownloadString(PremlistUrl)); banList = JsonConvert.DeserializeObject <BanList>(web.DownloadString(BanListUrl)); betaList = JsonConvert.DeserializeObject <BetaList>(web.DownloadString(BetaListUrl)); }