示例#1
0
        public static bool operator <(BigNumber left, BigNumber right)
        {
            //Ensure that the BigNums have not been disposed
            if (left.fDisposed)
            {
                throw new ObjectDisposedException("left");
            }
            if (right.fDisposed)
            {
                throw new ObjectDisposedException("right");
            }

            return(OpenSSL.BN_cmp(left.fBigNum, right.fBigNum) == -1);
        }
示例#2
0
        /// <summary>
        /// Compares the values of two BigNums
        /// </summary>
        /// <param name="obj">BigNum to compare with</param>
        /// <returns>If the two values are equal</returns>
        public override bool Equals(object obj)
        {
            if (!(obj is BigNumber))
            {
                throw new ArgumentException("obj must be a BigNum to compare");
            }
            BigNumber cmp = obj as BigNumber;

            //Ensure that the BigNums have not been disposed
            if (fDisposed)
            {
                throw new ObjectDisposedException("this");
            }
            if (cmp.fDisposed)
            {
                throw new ObjectDisposedException("cmp");
            }

            return(OpenSSL.BN_cmp(fBigNum, cmp.fBigNum) == 0);
        }