Authenticated Btrfs
Authenticated Btrfs
Posted May 1, 2020 6:46 UTC (Fri) by cyphar (subscriber, #110703)In reply to: Authenticated Btrfs by flussence
Parent article: Authenticated Btrfs
ZFS has the same restriction (the checksum field in ZFS block pointers is 32 bytes long). The trick is that you take the first 16 bytes of SHA-256 and the first 16 bytes of HMAC-256, and the concatenation of both is your new 32 byte checksum. If you don't have the key, you can only verify half of the checksum but that is sufficient to detect data corruption. Obviously this is a workaround for fixed-size block pointers -- ideally you would just store both checksums.