Given a base secret, an easy one-way function is SHA(base || input) */
| 5 | |
| 6 | /* Given a base secret, an easy one-way function is SHA(base || input) */ |
| 7 | static void hash_from_base(const struct secret *base_secret, |
| 8 | const void *input, |
| 9 | size_t input_len, |
| 10 | struct sha256 *hash) |
| 11 | { |
| 12 | struct sha256_ctx shactx; |
| 13 | |
| 14 | sha256_init(&shactx); |
| 15 | sha256_update(&shactx, base_secret, sizeof(*base_secret)); |
| 16 | sha256_update(&shactx, input, input_len); |
| 17 | sha256_done(&shactx, hash); |
| 18 | } |
| 19 | |
| 20 | void bolt12_path_secret(const struct secret *base_secret, |
| 21 | const struct sha256 *payment_hash, |
no test coverage detected