mirror of
https://github.com/aljazceru/lightning.git
synced 2026-01-06 15:44:21 +01:00
per-commit-secret is a struct secret, not a sha256.
Well, it's generated by shachain, so technically it is a sha256, but that's an internal detail. It's a secret. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
committed by
Christian Decker
parent
6c98457ef2
commit
e217bc1220
@@ -51,11 +51,14 @@ bool derive_basepoints(const struct secret *seed,
|
||||
}
|
||||
|
||||
void per_commit_secret(const struct sha256 *shaseed,
|
||||
struct sha256 *commit_secret,
|
||||
struct secret *commit_secret,
|
||||
u64 per_commit_index)
|
||||
{
|
||||
shachain_from_seed(shaseed, shachain_index(per_commit_index),
|
||||
commit_secret);
|
||||
struct sha256 s;
|
||||
shachain_from_seed(shaseed, shachain_index(per_commit_index), &s);
|
||||
|
||||
BUILD_ASSERT(sizeof(s) == sizeof(*commit_secret));
|
||||
memcpy(commit_secret, &s, sizeof(s));
|
||||
}
|
||||
|
||||
bool per_commit_point(const struct sha256 *shaseed,
|
||||
|
||||
Reference in New Issue
Block a user