Exemplo n.º 1
0
bool ne7ssh_crypt::getDHGroup14Sha1Public (Botan::BigInt &publicKey)
{
#if BOTAN_PRE_15
  privKexKey = new DH_PrivateKey (get_dl_group("IETF-2048"));
#elif BOTAN_PRE_18
  privKexKey = new DH_PrivateKey (DL_Group("modp/ietf/2048"));
#else
  privKexKey = new DH_PrivateKey (*ne7ssh::rng, DL_Group("modp/ietf/2048"));
#endif
  DH_PublicKey pubKexKey = *privKexKey;

  publicKey = pubKexKey.get_y();
  if (publicKey.is_zero()) return false;
  else return true;
}
Exemplo n.º 2
0
/*************************************************
* Derive a key                                   *
*************************************************/
SecureVector<byte> DH_PrivateKey::derive_key(const DH_PublicKey& key) const
   {
   return derive_key(key.get_y());
   }