MCPcopy
hub / github.com/tailscale/tailscale / NewNode

Function NewNode

types/key/node.go:55–63  ·  view source on GitHub ↗

NewNode creates and returns a new node private key.

()

Source from the content-addressed store, hash-verified

53
54// NewNode creates and returns a new node private key.
55func NewNode() NodePrivate {
56 var ret NodePrivate
57 rand(ret.k[:])
58 // WireGuard does its own clamping, so this would be unnecessary -
59 // but we also use this key for DERP comms, which does require
60 // clamping.
61 clamp25519Private(ret.k[:])
62 return ret
63}
64
65// Raw32 returns k as 32 raw bytes.
66func (k NodePrivate) Raw32() [32]byte { return k.k }

Calls 2

randFunction · 0.85
clamp25519PrivateFunction · 0.85

Used in the wild real call sites across dependent graphs

searching dependent graphs…