public void Double_cross_check() { Fp2 a2 = new Fp2(Parameters.P / 2, Parameters.P / 4); Fp6 a = new Fp6(a2, a2, a2); Assert.True(a.IsValid()); Assert.AreEqual(a.Double(), a.Add(a)); }
public void Square_cross_check() { Fp2 a2 = new Fp2(Parameters.P / 2, Parameters.P / 4); Fp6 a = new Fp6(a2, a2, a2); Assert.True(a.IsValid()); Assert.AreEqual(a.Squared(), a.Mul(a)); }
public void Negate_negate() { Fp2 a2 = new Fp2(Parameters.P / 2, Parameters.P / 4); Fp6 a = new Fp6(a2, a2, a2); Assert.True(a.IsValid()); Assert.AreEqual(a, a.Negate().Negate()); }
public void Inverse_mul_self() { Fp2 a2 = new Fp2(Parameters.P / 2, Parameters.P / 4); Fp6 a = new Fp6(a2, a2, a2); Assert.True(a.IsValid()); Assert.AreEqual(Fp6.One, a.Mul(a.Inverse())); }
public void Inverse_inverse() { Fp2 a2 = new Fp2(Parameters.P / 2, Parameters.P / 4); Fp6 a = new Fp6(a2, a2, a2); Assert.True(a.IsValid()); Assert.AreEqual(a, a.Inverse().Inverse()); }
public void Add_negate() { Fp2 a2 = new Fp2(Parameters.P / 2, Parameters.P / 4); Fp6 a = new Fp6(a2, a2, a2); Assert.True(a.IsValid()); Assert.AreEqual(Fp6.Zero, a.Add(a.Negate())); Assert.AreEqual(Fp6.Zero, a.Negate().Add(a)); }
public void Inverse_mul_self_is_commutative_regression() { Fp2 a2 = new Fp2(Parameters.P / 2, Parameters.P / 4); Fp6 a = new Fp6(a2, a2, a2); Assert.True(a.IsValid()); Fp6 inv = a.Inverse(); Assert.AreEqual(a.Mul(inv), inv.Mul(a)); }