public void Inverse_mul_self() { Fp2 a = new Fp2(Parameters.P / 2, Parameters.P / 4); Assert.AreEqual(Fp2.One, a.Mul(a.Inverse())); Assert.AreEqual(Fp2.One, a.Inverse().Mul(a)); }
public void Mul_schoolbook_check() { Fp2 a = new Fp2(Parameters.P / 2, Parameters.P / 4); Fp2 b = new Fp2(Parameters.P / 2, Parameters.P / 4); Assert.AreEqual(a.Mul(b), a.MulSchoolbook(b)); }
public void Mul_karatsuba_check() { Fp2 a = new Fp2(Parameters.P / 2, Parameters.P / 4); Fp2 b = new Fp2(Parameters.P / 2, Parameters.P / 4); Assert.AreEqual(a.Mul(b), a.MulKaratsuba(b)); }
public void Square_cross_check() { Fp2 a = new Fp2(Parameters.P / 2, Parameters.P / 4); a.IsValid(); Assert.AreEqual(a.Squared(), a.Mul(a)); }