ax(node): replace prose comment with usage example on DeriveSharedSecret

AX Principle 2 — comments show HOW with real values, not WHAT the
signature already says. The old comment restated the method name;
the new comment shows the exact call pattern used in transport.go.

Co-Authored-By: Charon <charon@lethean.io>
This commit is contained in:
Claude 2026-04-02 08:13:49 +01:00
parent aa9f0dd707
commit 2adb53226c
No known key found for this signature in database
GPG key ID: AF404715446AEB41

View file

@ -166,8 +166,8 @@ func (n *NodeManager) GenerateIdentity(name string, role NodeRole) error {
return nil
}
// DeriveSharedSecret derives a shared secret with a peer using X25519 ECDH.
// The result is hashed with SHA-256 for use as a symmetric key.
// secret, err := nm.DeriveSharedSecret(peer.PublicKey)
// smsg.Encrypt(msg, base64.StdEncoding.EncodeToString(secret))
func (n *NodeManager) DeriveSharedSecret(peerPubKeyBase64 string) ([]byte, error) {
n.mu.RLock()
defer n.mu.RUnlock()