Пример #1
0
        public static bool Diff(uint[] x, int xOff, uint[] y, int yOff, uint[] z, int zOff)
        {
            bool flag = Nat160.Gte(x, xOff, y, yOff);

            if (flag)
            {
                Nat160.Sub(x, xOff, y, yOff, z, zOff);
            }
            else
            {
                Nat160.Sub(y, yOff, x, xOff, z, zOff);
            }
            return(flag);
        }
Пример #2
0
        public static uint[] FromBigInteger(BigInteger x)
        {
            if (x.SignValue < 0 || x.BitLength > 160)
            {
                throw new ArgumentException();
            }
            uint[] array = Nat160.Create();
            int    num   = 0;

            while (x.SignValue != 0)
            {
                array[num++] = (uint)x.IntValue;
                x            = x.ShiftRight(32);
            }
            return(array);
        }