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

Function per_commit_secret

common/derive_basepoints.c:107–121  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

105}
106
107bool per_commit_secret(const struct sha256 *shaseed,
108 struct secret *commit_secret,
109 u64 per_commit_index)
110{
111 struct sha256 s;
112
113 if (per_commit_index >= (1ULL << SHACHAIN_BITS))
114 return false;
115
116 shachain_from_seed(shaseed, shachain_index(per_commit_index), &s);
117
118 BUILD_ASSERT(sizeof(s) == sizeof(*commit_secret));
119 memcpy(commit_secret, &s, sizeof(s));
120 return true;
121}
122
123bool per_commit_point(const struct sha256 *shaseed,
124 struct pubkey *commit_point,

Callers 6

dump_commitments_infosFunction · 0.85
per_commit_pointFunction · 0.85
print_basepointsFunction · 0.85

Calls 2

shachain_from_seedFunction · 0.85
shachain_indexFunction · 0.85

Tested by

no test coverage detected