Skip to content

Commit

Permalink
Merge pull request #1198 from dominictarr/master
Browse files Browse the repository at this point in the history
make comments match the code in secure channel implementation
  • Loading branch information
jbenet committed May 6, 2015
2 parents b71b727 + e89e83f commit 5463331
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions p2p/crypto/secio/protocol.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ func (s *secureSession) handshake(ctx context.Context, insecure io.ReadWriter) e
// =============================================================================
// step 1.2 Selection -- select/agree on best encryption parameters

// to determine order, use cmp(H(lr||rpk), H(rr||lpk)).
// to determine order, use cmp(H(remote_pubkey||local_rand), H(local_pubkey||remote_rand)).
oh1 := u.Hash(append(proposeIn.GetPubkey(), nonceOut...))
oh2 := u.Hash(append(myPubKeyBytes, proposeIn.GetRand()...))
order := bytes.Compare(oh1, oh2)
Expand Down Expand Up @@ -203,7 +203,7 @@ func (s *secureSession) handshake(ctx context.Context, insecure io.ReadWriter) e
return err
}

// Receive + Parse their Propose packet and generate an Exchange packet.
// Receive + Parse their Exchange packet.
exchangeIn := new(pb.Exchange)
if _, err := readMsgCtx(ctx, s.insecureM, exchangeIn); err != nil {
return err
Expand Down Expand Up @@ -278,7 +278,7 @@ func (s *secureSession) handshake(ctx context.Context, insecure io.ReadWriter) e
// log.Debug("2.3 mac + cipher.")

// =============================================================================
// step 3. Finish -- send expected message (the nonces), verify encryption works
// step 3. Finish -- send expected message to verify encryption works (send local nonce)

// setup ETM ReadWriter
w := NewETMWriter(s.insecure, s.local.cipher, s.local.mac)
Expand Down

0 comments on commit 5463331

Please sign in to comment.