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 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 Unitary_inverse_seems_fine() { // ReSharper disable once EqualExpressionComparison Fp6 oneOneOne = new Fp6(Fp2.One, Fp2.One, Fp2.One); Fp12 unitaryInverted = new Fp12(oneOneOne, oneOneOne).UnitaryInverse(); Assert.AreEqual(oneOneOne, unitaryInverted.A, "A"); Assert.AreEqual(oneOneOne.Negate(), unitaryInverted.B, "B"); }