MCPcopy Index your code
hub / github.com/CovenantSQL/CovenantSQL / IsIDPubNonceValid

Function IsIDPubNonceValid

crypto/kms/pubkeystore.go:272–278  ·  view source on GitHub ↗

IsIDPubNonceValid returns if `id == HashBlock(key, nonce)`.

(id *proto.RawNodeID, nonce *mine.Uint256, key *asymmetric.PublicKey)

Source from the content-addressed store, hash-verified

270
271// IsIDPubNonceValid returns if `id == HashBlock(key, nonce)`.
272func IsIDPubNonceValid(id *proto.RawNodeID, nonce *mine.Uint256, key *asymmetric.PublicKey) bool {
273 if key == nil || id == nil || nonce == nil {
274 return false
275 }
276 keyHash := mine.HashBlock(key.Serialize(), *nonce)
277 return keyHash.IsEqual(&id.Hash)
278}
279
280// setNode sets id and its publicKey.
281func setNode(nodeInfo *proto.Node) (err error) {

Callers 4

nonceLoopFunction · 0.92
nonceGenFunction · 0.92
PingMethod · 0.92
SetNodeFunction · 0.85

Calls 2

SerializeMethod · 0.45
IsEqualMethod · 0.45

Tested by

no test coverage detected