Esempio n. 1
0
    public static void Reduce(uint[] xx, uint[] z)
    {
        ulong y = Nat224.Mul33Add(6803u, xx, 7, xx, 0, z, 0);

        if (Nat224.Mul33DWordAdd(6803u, y, z, 0) != 0 || (z[6] == uint.MaxValue && Nat224.Gte(z, P)))
        {
            Nat.Add33To(7, 6803u, z);
        }
    }
Esempio n. 2
0
        public static void Reduce(uint[] xx, uint[] z)
        {
            ulong cc = Nat224.Mul33Add(PInv33, xx, 7, xx, 0, z, 0);
            uint  c  = Nat224.Mul33DWordAdd(PInv33, cc, z, 0);

            Debug.Assert(c == 0 || c == 1);

            if (c != 0 || (z[6] == P6 && Nat224.Gte(z, P)))
            {
                Nat.Add33To(7, PInv33, z);
            }
        }