static void TestG1() { Console.WriteLine("TestG1"); G1 P = new G1(); P.Clear(); assert("P = 0", P.ToString() == "0"); assert("P.IsValid", P.IsValid()); assert("P.IsZero", P.IsZero()); P.HashAndMapTo("abc"); assert("P.IsValid", P.IsValid()); assert("!P.IsZero", !P.IsZero()); G1 Q = new G1(); Q = P.Clone(); assert("P == Q", Q.Equals(P)); G1.Neg(Q, P); G1.Add(Q, Q, P); assert("P = Q", Q.IsZero()); G1.Dbl(Q, P); G1 R = new G1(); G1.Add(R, P, P); assert("Q == R", Q.Equals(R)); Fr x = new Fr(); x.SetInt(3); G1.Add(R, R, P); G1.Mul(Q, P, x); assert("Q == R", Q.Equals(R)); }