| 341 | } |
| 342 | |
| 343 | static void compute_blinding_factor(const struct pubkey *key, |
| 344 | const struct secret *sharedsecret, |
| 345 | u8 res[BLINDING_FACTOR_SIZE]) |
| 346 | { |
| 347 | struct sha256_ctx ctx; |
| 348 | u8 der[PUBKEY_CMPR_LEN]; |
| 349 | struct sha256 temp; |
| 350 | |
| 351 | pubkey_to_der(der, key); |
| 352 | sha256_init(&ctx); |
| 353 | sha256_update(&ctx, der, sizeof(der)); |
| 354 | sha256_update(&ctx, sharedsecret->data, sizeof(sharedsecret->data)); |
| 355 | sha256_done(&ctx, &temp); |
| 356 | memcpy(res, &temp, 32); |
| 357 | } |
| 358 | |
| 359 | static bool blind_group_element(struct pubkey *blindedelement, |
| 360 | const struct pubkey *pubkey, |
no test coverage detected