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:
Rusty Russell
2018-07-09 20:47:58 +09:30
committed by Christian Decker
parent 6c98457ef2
commit e217bc1220
12 changed files with 30 additions and 16 deletions

View File

@@ -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,