// It is the entry point for starting the handshake procedure.
// First handshake packet will be sent immediately.
func HandshakeStart(addr string, conn io.Writer, conf *PeerConf) (*Handshake, error) {
state := NewHandshake(addr, conn, conf)
// It is the entry point for starting the handshake procedure.
// First handshake packet will be sent immediately.
func HandshakeStart(addr string, conn io.Writer, conf *PeerConf) (*Handshake, error) {
state := NewHandshake(addr, conn, conf)
if state.dhPriv, dhPubRepr, err = dhKeypairGen(); err != nil {
return nil, errors.Wrap(err, "dhKeypairGen")
}
if state.dhPriv, dhPubRepr, err = dhKeypairGen(); err != nil {
return nil, errors.Wrap(err, "dhKeypairGen")
}