)
const (
- // RSize TODO
+ // RSize is size in bytes of channel binding random value
RSize = 8
- // SSize TODO
+ // SSize is size in bytes of shared secret half
SSize = 32
)
return &hashed
}
-// NewHandshake create new handshake state.
+// NewHandshake creates new handshake state.
func NewHandshake(addr string, conn io.Writer, conf *PeerConf) *Handshake {
state := Handshake{
addr: addr,
return sum[len(sum)-8:]
}
-// HandshakeStart start handshake's procedure from the client. It is the entry point
-// for starting the handshake procedure.
+// HandshakeStarts start handshake's procedure from the client.
+// 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 {
state := NewHandshake(addr, conn, conf)
return state
}
-// Server process handshake message on the server side.
+// Server processes handshake message on the server side.
// This function is intended to be called on server's side.
// If this is the final handshake message, then new Peer object
// will be created and used as a transport. If no mutually
return nil
}
-// Client process handshake message on the client side.
+// Client processes handshake message on the client side.
// This function is intended to be called on client's side.
// If this is the final handshake message, then new Peer object
// will be created and used as a transport. If no mutually