public static void Add(uint[] x, uint[] y, uint[] z)
 {
     if (Nat224.Add(x, y, z) != 0u || (z[6] == 4294967295u && Nat224.Gte(z, SecP224R1Field.P)))
     {
         SecP224R1Field.AddPInvTo(z);
     }
 }
Exemple #2
0
 public static void Add(uint[] x, uint[] y, uint[] z)
 {
     if (Nat224.Add(x, y, z) != 0 || (z[6] == uint.MaxValue && Nat224.Gte(z, P)))
     {
         Nat.Add33To(7, 6803u, z);
     }
 }
Exemple #3
0
 public static void Add(uint[] x, uint[] y, uint[] z)
 {
     if (Nat224.Add(x, y, z) != 0 || (z[6] == 4294967295u && Nat224.Gte(z, P)))
     {
         Nat.Add33To(7, 6803u, z);
     }
 }
Exemple #4
0
 public static void Add(uint[] x, uint[] y, uint[] z)
 {
     if (Nat224.Add(x, y, z) != 0 || (z[6] == 4294967295u && Nat224.Gte(z, P)))
     {
         AddPInvTo(z);
     }
 }
Exemple #5
0
 public static void Add(uint[] x, uint[] y, uint[] z)
 {
     if ((Nat224.Add(x, y, z) != 0) || ((z[6] == uint.MaxValue) && Nat224.Gte(z, P)))
     {
         Nat.Add33To(7, 0x1a93, z);
     }
 }
 public static void Add(uint[] x, uint[] y, uint[] z)
 {
     if ((Nat224.Add(x, y, z) != 0) || ((z[6] == uint.MaxValue) && Nat224.Gte(z, P)))
     {
         AddPInvTo(z);
     }
 }
        public static void Add(uint[] x, uint[] y, uint[] z)
        {
            uint c = Nat224.Add(x, y, z);

            if (c != 0 || (z[6] == P6 && Nat224.Gte(z, P)))
            {
                AddPInvTo(z);
            }
        }
        public static void Add(uint[] x, uint[] y, uint[] z)
        {
            uint c = Nat224.Add(x, y, z);

            if (c != 0 || (z[6] == P6 && Nat224.Gte(z, P)))
            {
                Nat.Add33To(7, PInv33, z);
            }
        }
        public static void Add(uint[] x, uint[] y, uint[] z)
        {
            uint c = Nat224.Add(x, y, z);

            if (c != 0 || (z[6] == P6 && Nat224.Gte(z, P)))
            {
                Nat224.AddDWord(PInv, z, 0);
            }
        }
        public static void Subtract(uint[] x, uint[] y, uint[] z)
        {
            int c = Nat224.Sub(x, y, z);

            if (c != 0)
            {
                Nat224.Add(z, P, z);
            }
        }
        public static void Half(uint[] x, uint[] z)
        {
            if ((x[0] & 1u) == 0u)
            {
                Nat.ShiftDownBit(7, x, 0u, z);
                return;
            }
            uint c = Nat224.Add(x, SecP224R1Field.P, z);

            Nat.ShiftDownBit(7, z, c);
        }
Exemple #12
0
        public static void Half(uint[] x, uint[] z)
        {
            if ((x[0] & 1) == 0)
            {
                Nat.ShiftDownBit(7, x, 0u, z);
                return;
            }
            uint c = Nat224.Add(x, P, z);

            Nat.ShiftDownBit(7, z, c);
        }
 public static void Half(uint[] x, uint[] z)
 {
     if ((x[0] & 1) == 0)
     {
         Nat224.ShiftDownBit(x, 0, z);
     }
     else
     {
         uint c = Nat224.Add(x, P, z);
         Nat224.ShiftDownBit(z, c, z);
     }
 }
        public static void Reduce(uint[] xx, uint[] z)
        {
            long xx07 = xx[7], xx08 = xx[8], xx09 = xx[9], xx10 = xx[10];
            long xx11 = xx[11], xx12 = xx[12], xx13 = xx[13];

            long t0 = xx07 + xx11;
            long t1 = xx08 + xx12;
            long t2 = xx09 + xx13;

            long cc = 0;

            cc  += (long)xx[0] - t0;
            z[0] = (uint)cc;
            cc >>= 32;
            cc  += (long)xx[1] - t1;
            z[1] = (uint)cc;
            cc >>= 32;
            cc  += (long)xx[2] - t2;
            z[2] = (uint)cc;
            cc >>= 32;
            cc  += (long)xx[3] + t0 - xx10;
            z[3] = (uint)cc;
            cc >>= 32;
            cc  += (long)xx[4] + t1 - xx11;
            z[4] = (uint)cc;
            cc >>= 32;
            cc  += (long)xx[5] + t2 - xx12;
            z[5] = (uint)cc;
            cc >>= 32;
            cc  += (long)xx[6] + xx10 - xx13;
            z[6] = (uint)cc;
            cc >>= 32;

            int c = (int)cc;

            if (c > 0)
            {
                Reduce32((uint)c, z);
            }
            else
            {
                while (c < 0)
                {
                    c += (int)Nat224.Add(z, P, z);
                }
            }
        }