| 757 | } |
| 758 | |
| 759 | static void calc_invreq(const u8 *tlvstream, struct sha256 *id) |
| 760 | { |
| 761 | size_t start1, len1, start2, len2; |
| 762 | struct sha256_ctx ctx; |
| 763 | |
| 764 | /* BOLT #12: |
| 765 | * The writer: |
| 766 | *... |
| 767 | * - MUST NOT set any non-signature TLV fields outside the inclusive ranges: 0 to 159 and 1000000000 to 2999999999 |
| 768 | */ |
| 769 | len1 = tlv_span(tlvstream, 0, 159, &start1); |
| 770 | len2 = tlv_span(tlvstream, 1000000000, 2999999999, &start2); |
| 771 | |
| 772 | sha256_init(&ctx); |
| 773 | sha256_update(&ctx, tlvstream + start1, len1); |
| 774 | sha256_update(&ctx, tlvstream + start2, len2); |
| 775 | sha256_done(&ctx, id); |
| 776 | } |
| 777 | |
| 778 | void invreq_invreq_id(const struct tlv_invoice_request *invreq, struct sha256 *id) |
| 779 | { |
no test coverage detected