class Net::SSH::Transport::Kex::Curve25519Sha256

A key-exchange service implementing the “curve25519-sha256@libssh.org” key-exchange algorithm. (defined in tools.ietf.org/html/draft-ietf-curdle-ssh-curves-06)

Public Instance Methods

digester() click to toggle source
# File lib/net/ssh/transport/kex/curve25519_sha256.rb, line 15
def digester
  OpenSSL::Digest::SHA256
end

Private Instance Methods

compute_shared_secret(server_ecdh_pubkey) click to toggle source

compute shared secret from server’s public key and client’s private key

# File lib/net/ssh/transport/kex/curve25519_sha256.rb, line 31
def compute_shared_secret(server_ecdh_pubkey)
  pk = ::X25519::MontgomeryU.new(server_ecdh_pubkey)
  OpenSSL::BN.new(ecdh.diffie_hellman(pk).to_bytes, 2)
end
ecdh_public_key_bytes() click to toggle source

string Q_C, client’s ephemeral public key octet string

# File lib/net/ssh/transport/kex/curve25519_sha256.rb, line 26
def ecdh_public_key_bytes
  ecdh.public_key.to_bytes
end