示例#1
0
        //private bool MillerRabin(PrimesBigInteger rounds, PrimesBigInteger n)
        //{
        //  PrimesBigInteger i = PrimesBigInteger.One;

        //  while (i.CompareTo(rounds) <= 0)
        //  {
        //    if (Witness(PrimesBigInteger.RandomM(n.Subtract(PrimesBigInteger.Two)).Add(PrimesBigInteger.Two), n))
        //      return false;
        //    i = i.Add(PrimesBigInteger.One);
        //  }
        //  return true;
        //}

        private void GetShift(PrimesBigInteger a)
        {
            m_d     = m_Value - 1;
            m_shift = 0;

            while (m_d.Mod(2).CompareTo(0) == 0)
            {
                log.Info(string.Format(rsc.Primetest.mr_shiftright, m_d, m_d.ShiftRight(1)));
                m_d = m_d.ShiftRight(1);
                m_shift++;
            }
        }