public void EqualsTest()
        {
            int replen1 = 12;
            int replen2 = 11;

            for (int paramIndex = 0; paramIndex < _parameters.Length; ++paramIndex)
            {
                FieldZqElement[]    exponents1 = _parameters[paramIndex].FieldZq.GetRandomElements(replen1, true);
                FieldZqElement[]    exponents2 = _parameters[paramIndex].FieldZq.GetRandomElements(replen2, true);
                DLRepOfGroupElement dl1        = new DLRepOfGroupElement(exponents1, _parameters[paramIndex]);
                DLRepOfGroupElement dl2        = new DLRepOfGroupElement(exponents1, _parameters[paramIndex]);
                DLRepOfGroupElement dl3        = new DLRepOfGroupElement(exponents2, _parameters[paramIndex]);

                Assert.IsTrue(dl1.Equals(dl1), "dl1 should equal itself");
                Assert.IsTrue(dl1.Equals(dl2), "dl1 should equal dl2");
                Assert.IsTrue(dl2.Equals(dl1), "dl2 should equal dl1");
                Assert.IsFalse(dl2.Equals(dl3), "dl2 should not equal dl3");
                Assert.IsFalse(dl3.Equals(dl2), "dl3 should not equal dl2");
                Assert.IsFalse(dl3.Equals(exponents1[0]), "wrong class input!");

                DLRepOfGroupElement nulldl = new DLRepOfGroupElement();
                Assert.IsFalse(dl1.Equals(nulldl), "not equal to nulldl");
                Assert.IsFalse(nulldl.Equals(dl1), "nulldl not equal to dl1");
                Assert.IsTrue(nulldl.Equals(nulldl), "nulldl equal to itself");

                GroupElement[] bases = new GroupElement[replen1];
                for (int i = 0; i < bases.Length; ++i)
                {
                    bases[i] = _parameters[paramIndex].Group.Identity;
                }
                DLRepOfGroupElement dl4 = new DLRepOfGroupElement(bases, exponents1, _parameters[paramIndex].Group);
                Assert.IsFalse(dl1.Equals(dl4), "dl1 and dl4 different due to bases");
                Assert.IsFalse(dl4.Equals(dl1), "dl4 and dl1 different due to bases");
            }
        }
        public void DLRepEqualsWrongExponentTest()
        {
            GroupElement[]   bases     = StaticHelperClass.GenerateRandomBases(8, 0);
            FieldZqElement[] exponents = StaticHelperClass.GenerateRandomExponents(8, 0);

            DLRepOfGroupElement dl = new DLRepOfGroupElement(bases, exponents, _parameters[0].Group);

            exponents[7] = exponents[2];
            DLRepOfGroupElement badDL = new DLRepOfGroupElement(bases, exponents, _parameters[0].Group);

            Assert.IsFalse(dl.Equals(badDL), "should fail due to bad exponent.");
            Assert.IsFalse(badDL.Equals(dl), "should fail due to bad exponent.");
        }