private void genpgBtn_Click(object sender, EventArgs e) { string pstr; switch (digitsBox.Text) { case "p40": pstr = "7524548124131735373612526345481757634861"; BigInteger.TryParse(pstr, out p); g = 7; break; case "p41": pstr = "61571157514825784611687343327637886854113"; BigInteger.TryParse(pstr, out p); g = 3; break; default: p = CryptoMath.genSimpleRand(digits); g = CryptoMath.calculateFakePrimitiveRoot(p); break; } pBox.Text = p.ToString(); gBox.Text = g.ToString(); }
private void fakeGenBtn_Click(object sender, EventArgs e) { if (modulo < 3) { pBox.Text = "12345"; } primit = CryptoMath.calculateFakePrimitiveRoot(modulo); fakeBox.Text = primit.ToString(); }
private void generategBtn_Click(object sender, EventArgs e) { this.Enabled = false; if (p > 2) { if (CryptoMath.DIGITS > 10) { g = CryptoMath.calculateFakePrimitiveRoot(p); } else { g = CryptoMath.calculatePrimitiveRoot(p); } } gtextBox.Text = g.ToString(); this.Enabled = true; }