Example #1
0
 public static long ModularProduct(long a, long b, long modulus)
 {
     return((long)UInt64Helper.ModularProduct((ulong)a, (ulong)b, (ulong)modulus));
 }
Example #2
0
 public static ulong ModularProduct(ulong a, ulong b, ulong modulus)
 {
     return(UInt64Helper.ModularProduct(a, b, modulus));
 }
Example #3
0
        public uint Modulus(ulong k)
        {
            var t = UInt64Helper.MultiplyHigh(m, k);

            return((uint)(k - ((((k - t) >> sh1) + t) >> sh2) * d));
        }
Example #4
0
        public ulong Divide(ulong k)
        {
            var t = UInt64Helper.MultiplyHigh(m, k);

            return((((k - t) >> sh1) + t) >> sh2);
        }
Example #5
0
 public uint Modulus(ulong k)
 {
     return((uint)(k - (UInt64Helper.MultiplyHigh(mPrime, k) >> shift) * d));
 }
Example #6
0
 public ulong Divide(ulong k)
 {
     return(UInt64Helper.MultiplyHigh(mPrime, k) >> shift);
 }
Example #7
0
 public ulong Divide(ulong k)
 {
     return(UInt64Helper.MultiplyHigh(recip, k));
 }