Beispiel #1
0
        /// <summary>
        /// Decides whether the given object <c>other</c> is the same as this field
        /// </summary>
        ///
        /// <param name="Obj">The object for comparison</param>
        ///
        /// <returns>Returns <c>(this == other)</c></returns>
        public override bool Equals(Object Obj)
        {
            if (Obj == null || !(Obj is MPKCPrivateKey))
            {
                return(false);
            }

            MPKCPrivateKey key = (MPKCPrivateKey)Obj;


            if (!N.Equals(key.N))
            {
                return(false);
            }
            if (!K.Equals(key.K))
            {
                return(false);
            }
            if (!GF.Equals(key.GF))
            {
                return(false);
            }
            if (!GP.Equals(key.GP))
            {
                return(false);
            }
            if (!P1.Equals(key.P1))
            {
                return(false);
            }
            if (!H.Equals(key.H))
            {
                return(false);
            }
            if (QInv.Length != key.QInv.Length)
            {
                return(false);
            }

            for (int i = 0; i < QInv.Length; i++)
            {
                if (!QInv[i].Equals(key.QInv[i]))
                {
                    return(false);
                }
            }

            return(true);
        }