| 369 | } |
| 370 | |
| 371 | static void compute_blinding_factor(const struct pubkey *key, |
| 372 | const struct secret *sharedsecret, |
| 373 | u8 res[BLINDING_FACTOR_SIZE]) |
| 374 | { |
| 375 | struct sha256_ctx ctx; |
| 376 | u8 der[PUBKEY_CMPR_LEN]; |
| 377 | struct sha256 temp; |
| 378 | |
| 379 | pubkey_to_der(der, key); |
| 380 | sha256_init(&ctx); |
| 381 | sha256_update(&ctx, der, sizeof(der)); |
| 382 | sha256_update(&ctx, sharedsecret->data, sizeof(sharedsecret->data)); |
| 383 | sha256_done(&ctx, &temp); |
| 384 | memcpy(res, &temp, 32); |
| 385 | } |
| 386 | |
| 387 | static bool blind_group_element(struct pubkey *blindedelement, |
| 388 | const struct pubkey *pubkey, |
no test coverage detected