| 1040 | } |
| 1041 | |
| 1042 | static void calc_invreq(const u8 *tlvstream, struct sha256 *id) |
| 1043 | { |
| 1044 | size_t start1, len1, start2, len2; |
| 1045 | struct sha256_ctx ctx; |
| 1046 | |
| 1047 | /* BOLT #12: |
| 1048 | * The writer: |
| 1049 | *... |
| 1050 | * - MUST NOT set any non-signature TLV fields outside the inclusive ranges: 0 to 159 and 1000000000 to 2999999999 |
| 1051 | */ |
| 1052 | len1 = tlv_span(tlvstream, 0, 159, &start1); |
| 1053 | len2 = tlv_span(tlvstream, 1000000000, 2999999999, &start2); |
| 1054 | |
| 1055 | sha256_init(&ctx); |
| 1056 | sha256_update(&ctx, tlvstream + start1, len1); |
| 1057 | sha256_update(&ctx, tlvstream + start2, len2); |
| 1058 | sha256_done(&ctx, id); |
| 1059 | } |
| 1060 | |
| 1061 | void invreq_invreq_id(const struct tlv_invoice_request *invreq, struct sha256 *id) |
| 1062 | { |
no test coverage detected