/// <summary>
 /// Creates the private key.
 /// </summary>
 /// <param name="publicKey">The public key.</param>
 /// <returns></returns>
 public DiffieHellmanKey CreatePrivateKey(DiffieHellmanKey publicKey)
 {
     BigInteger yother = new BigInteger(publicKey.ToByteArray());
     return new DiffieHellmanKey(_prime, _g, yother.ModPow(_secret, _prime));
 }
Пример #2
0
        /// <summary>
        /// Creates the private key.
        /// </summary>
        /// <param name="publicKey">The public key.</param>
        /// <returns></returns>
        public DiffieHellmanKey CreatePrivateKey(DiffieHellmanKey publicKey)
        {
            BigInteger yother = new BigInteger(publicKey.ToByteArray());

            return(new DiffieHellmanKey(_prime, _g, yother.ModPow(_secret, _prime)));
        }