| 121 | } |
| 122 | |
| 123 | bool per_commit_point(const struct sha256 *shaseed, |
| 124 | struct pubkey *commit_point, |
| 125 | u64 per_commit_index) |
| 126 | { |
| 127 | struct secret secret; |
| 128 | |
| 129 | if (!per_commit_secret(shaseed, &secret, per_commit_index)) |
| 130 | return false; |
| 131 | |
| 132 | /* BOLT #3: |
| 133 | * |
| 134 | * The `per_commitment_point` is generated using elliptic-curve |
| 135 | * multiplication: |
| 136 | * |
| 137 | * per_commitment_point = per_commitment_secret * G |
| 138 | */ |
| 139 | if (secp256k1_ec_pubkey_create(secp256k1_ctx, |
| 140 | &commit_point->pubkey, |
| 141 | secret.data) != 1) |
| 142 | return false; |
| 143 | |
| 144 | return true; |
| 145 | } |
| 146 | |
| 147 | bool derive_payment_basepoint(const struct secret *seed, |
| 148 | struct pubkey *payment_basepoint, |
no test coverage detected