//BigInteger型乱数のテスト public void RandomBIntTest() { BigInteger p = IntegerCalclator.RandamBigInteger(KEYLENGTH); Console.Write("BigIntegerNumber: "); Console.WriteLine(p.ToString()); string b = IntegerCalclator.BigIntegerToBin(p); Console.Write("Binary: "); Console.WriteLine(b); Console.WriteLine("Complete."); }
//a回の群演算 public static Ep operator *(BigInteger a, Ep P) { Ep Q = P; String bin = IntegerCalclator.BigIntegerToBin(a); for (int item = bin.Length - 1; item >= 0; item--) { //桁数を上げる度に Q = Q + Q; if (bin[item] == 1) { Q = Q + P; } } Q += P; return(Q); }