"""Validate the IFWI image's OWN internal checksums. This is independent of how we dumped it: if the image had bitrot, AMD's own directory checksums would fail. Two independently-obtained dumps agreeing is suggestive; the image validating its own checksums is much stronger. """ import struct, sys, zlib def fletcher32(data: bytes) -> int: s1 = s2 = 0xFFFF for i in range(0, len(data) - 1, 2): s1 = (s1 + struct.unpack_from('