We derive invoice secret using 1-way function from payment_preimage * (just a different one from the payment_hash!) */
| 136 | /* We derive invoice secret using 1-way function from payment_preimage |
| 137 | * (just a different one from the payment_hash!) */ |
| 138 | static void invoice_secret(const struct preimage *payment_preimage, |
| 139 | struct secret *payment_secret) |
| 140 | { |
| 141 | struct preimage modified; |
| 142 | struct sha256 secret; |
| 143 | |
| 144 | modified = *payment_preimage; |
| 145 | modified.r[0] ^= 1; |
| 146 | |
| 147 | sha256(&secret, modified.r, |
| 148 | ARRAY_SIZE(modified.r) * sizeof(*modified.r)); |
| 149 | CROSS_TYPE_ASSIGNMENT(&payment_secret->data, &secret.u.u8); |
| 150 | } |
| 151 | |
| 152 | struct invoice_payment_hook_payload { |
| 153 | struct lightningd *ld; |
no test coverage detected