| 105 | } |
| 106 | |
| 107 | bool per_commit_point(const struct sha256 *shaseed, |
| 108 | struct pubkey *commit_point, |
| 109 | u64 per_commit_index) |
| 110 | { |
| 111 | struct secret secret; |
| 112 | |
| 113 | if (!per_commit_secret(shaseed, &secret, per_commit_index)) |
| 114 | return false; |
| 115 | |
| 116 | /* BOLT #3: |
| 117 | * |
| 118 | * The `per_commitment_point` is generated using elliptic-curve |
| 119 | * multiplication: |
| 120 | * |
| 121 | * per_commitment_point = per_commitment_secret * G |
| 122 | */ |
| 123 | if (secp256k1_ec_pubkey_create(secp256k1_ctx, |
| 124 | &commit_point->pubkey, |
| 125 | secret.data) != 1) |
| 126 | return false; |
| 127 | |
| 128 | return true; |
| 129 | } |
| 130 | |
| 131 | bool derive_payment_basepoint(const struct secret *seed, |
| 132 | struct pubkey *payment_basepoint, |
no test coverage detected