class Net::SSH::Transport::Kex::EcdhSHA2NistP256
key-exchange algorithm. (defined in RFC 5656)
A key-exchange service implementing the “ecdh-sha2-nistp256”
def compute_shared_secret(server_ecdh_pubkey)
def compute_shared_secret(server_ecdh_pubkey) pk = OpenSSL::PKey::EC::Point.new(OpenSSL::PKey::EC.new(curve_name).group, OpenSSL::BN.new(server_ecdh_pubkey, 2)) OpenSSL::BN.new(ecdh.dh_compute_key(pk), 2) end
def curve_name
def curve_name OpenSSL::PKey::EC::CurveNameAlias['nistp256'] end
def digester
def digester OpenSSL::Digest::SHA256 end
def ecdh_public_key_bytes
def ecdh_public_key_bytes ecdh.public_key.to_bn.to_s(2) end
def generate_key # :nodoc:
def generate_key # :nodoc: OpenSSL::PKey::EC.generate(curve_name) end