Exemplo n.º 1
0
        private bool ISetupKeys(int g)
        {
            BigNum b = new BigNum(Helpers.StrongRandom(64));
            BigNum N = new BigNum(fN);
            BigNum X = new BigNum(fX);

            //Calculate seeds
            BigNum client_seed = X.PowMod(b, N);
            BigNum server_seed = new BigNum(g).PowMod(b, N);

            //Dump data
            fDhData = server_seed.ToArray();
            fClientSeed = client_seed.ToArray();

            //Explicitly dispose unmanaged OpenSSL resources
            b.Dispose();
            N.Dispose();
            X.Dispose();
            client_seed.Dispose();
            server_seed.Dispose();
            return true;
        }