Verify Checksum of Firmware Image
Validate a firmware image whose last four bytes hold a little-endian CRC-32 over everything before them, and report whether the image is intact.
Constraints
- Input is a bytes object.
- An image shorter than 5 bytes must raise ValueError.
- Use zlib.crc32 over the payload only.
- Return a dict with valid, stored_crc and computed_crc.
- Do not modify the input.
1import zlib2 3def verify_image(image):4 # TODO5 return {}