/* Verify checksum over a complete header that includes the checksum field. Return 1 when OK, otherwise 0.  */
static int main_hdr_checksum_ok(void *hdr)
/* Verify checksum over a complete header that includes the checksum field. Return 1 when OK, otherwise 0.  */
static int main_hdr_checksum_ok(void *hdr)
{
	struct main_hdr_v0 *main_hdr = (struct main_hdr_v0 *)hdr;
	uint8_t checksum;
	checksum = image_checksum8(hdr, kwbimage_header_size(hdr));
	checksum -= main_hdr->checksum;
	return checksum == main_hdr->checksum;
}