MCPcopy Create free account
hub / github.com/ElementsProject/lightning / node_id_hash

Function node_id_hash

common/node_id.h:66–69  ·  view source on GitHub ↗

We need to define a hashing function. siphash24 is a fast yet * cryptographic hash in ccan/crypto/siphash24; we might be able to get away * with a slightly faster hash with fewer guarantees, but it's good hygiene to * use this unless it's a proven bottleneck. siphash_seed() is a function in * common/pseudorand which sets up a seed for our hashing; it's different * every time the program is r

Source from the content-addressed store, hash-verified

64 * common/pseudorand which sets up a seed for our hashing; it's different
65 * every time the program is run. */
66static inline size_t node_id_hash(const struct node_id *id)
67{
68 return siphash24(siphash_seed(), id->k, sizeof(id->k));
69}
70
71/**
72 * check_signed_hash_nodeid - check a raw secp256k1 signature.

Callers

nothing calls this directly

Calls 2

siphash24Function · 0.85
siphash_seedClass · 0.70

Tested by

no test coverage detected