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:
parent
aa9f0dd707
commit
2adb53226c
1 changed files with 2 additions and 2 deletions
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue