| 105 | } |
| 106 | |
| 107 | bool 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 | |
| 123 | bool per_commit_point(const struct sha256 *shaseed, |
| 124 | struct pubkey *commit_point, |
no test coverage detected