Example #1
0
        internal RSACryptoSystem(BackgroundWorker UseWorker, RSACryptoWorkerInfo UseWInfo)
        {
            Worker     = UseWorker;
            WorkerInfo = UseWInfo;
            StartTime  = new ECTime();
            StartTime.SetToNow();
            RngCsp  = new RNGCryptoServiceProvider();
            IntMath = new IntegerMath(null);

            IntMathForP = new IntegerMath(null);
            IntMathForQ = new IntegerMath(null);
            // Worker.ReportProgress( 0, IntMath.GetStatusString() );

            Quotient               = new Integer();
            Remainder              = new Integer();
            PrimeP                 = new Integer();
            PrimeQ                 = new Integer();
            PrimePMinus1           = new Integer();
            PrimeQMinus1           = new Integer();
            PubKeyN                = new Integer();
            PubKeyExponent         = new Integer();
            PrivKInverseExponent   = new Integer();
            PrivKInverseExponentDP = new Integer();
            PrivKInverseExponentDQ = new Integer();
            QInv           = new Integer();
            PhiN           = new Integer();
            TestForDecrypt = new Integer();
            M1ForInverse   = new Integer();
            M2ForInverse   = new Integer();
            HForQInv       = new Integer();
            M1MinusM2      = new Integer();
            M1M2SizeDiff   = new Integer();

            PubKeyExponent.SetFromULong(PubKeyExponentUint);
        }
Example #2
0
        internal ChineseRemainder(IntegerMath UseIntMath)
        {
            if (DigitsArraySize > IntegerMath.PrimeArrayLength)
            {
                throw(new Exception("ChineseRemainder digit size is too big."));
            }

            IntMath = UseIntMath;

            DigitsArray = new int[DigitsArraySize];
            // SetToZero(); Not necessary for managed code.
        }
Example #3
0
        internal Division(MainForm UseForm, IntegerMath UseIntMath)
        {
            MForm   = UseForm;
            IntMath = UseIntMath;

            // You might want to pass a null IntMath to this
            // so that it creates its own that doesn't
            // interfere with something else.
            if (IntMath == null)
            {
                IntMath = new IntegerMath(MForm);
            }
        }
        internal ChineseRemainder(IntegerMath UseIntMath)
        {
            IntMath = UseIntMath;

            if (DigitsArraySize > IntMath.GetPrimeArrayLength())
            {
                throw(new Exception("ChineseRemainder digit size is too big."));
            }


            DigitsArray = new int[DigitsArraySize];
            SetToZero();
        }
Example #5
0
 internal StandardAlgorithms(MainForm UseForm, IntegerMath UseIntMath)
 {
     MForm   = UseForm;
     IntMath = UseIntMath;
 }