| 737 | } |
| 738 | |
| 739 | static void calc_invreq(const u8 *tlvstream, struct sha256 *id) |
| 740 | { |
| 741 | size_t start1, len1, start2, len2; |
| 742 | struct sha256_ctx ctx; |
| 743 | |
| 744 | /* BOLT #12: |
| 745 | * The writer: |
| 746 | *... |
| 747 | * - MUST NOT set any non-signature TLV fields outside the inclusive ranges: 0 to 159 and 1000000000 to 2999999999 |
| 748 | */ |
| 749 | len1 = tlv_span(tlvstream, 0, 159, &start1); |
| 750 | len2 = tlv_span(tlvstream, 1000000000, 2999999999, &start2); |
| 751 | |
| 752 | sha256_init(&ctx); |
| 753 | sha256_update(&ctx, tlvstream + start1, len1); |
| 754 | sha256_update(&ctx, tlvstream + start2, len2); |
| 755 | sha256_done(&ctx, id); |
| 756 | } |
| 757 | |
| 758 | void invreq_invreq_id(const struct tlv_invoice_request *invreq, struct sha256 *id) |
| 759 | { |
no test coverage detected