|
libaaruformat 1.0
Aaru Data Preservation Suite - Format Library
|
On-disk layout definitions for the checksum block (BlockType::ChecksumBlock). More...
#include <stdint.h>Go to the source code of this file.
Data Structures | |
| struct | ChecksumHeader |
| Header that precedes the sequence of checksum entries for a checksum block. More... | |
| struct | ChecksumEntry |
| Per-checksum metadata immediately followed by the digest / signature bytes. More... | |
Typedefs | |
| typedef struct ChecksumHeader | ChecksumHeader |
| typedef struct ChecksumEntry | ChecksumEntry |
On-disk layout definitions for the checksum block (BlockType::ChecksumBlock).
A checksum block stores one or more whole-image (user data) checksums. For optical media the user data definition follows the format's raw sector rules (e.g. 2352-byte raw sector when available).
Binary layout (all integers are little-endian, structure is packed):
+---------------------------—+----------------------------—+ | Field | Size (bytes) | +==============================+===============================+ | ChecksumHeader | sizeof(ChecksumHeader)=9 | | identifier | 4 (BlockType::ChecksumBlock) | | length | 4 (payload bytes that follow)| | entries | 1 (number of checksum entries)| +---------------------------—+----------------------------—+ | Repeated for each entry: | | ChecksumEntry | sizeof(ChecksumEntry)=5 | | type | 1 (ChecksumAlgorithm) | | length | 4 (digest length) | | digest bytes | length | +---------------------------—+----------------------------—+
Thus, the payload size (ChecksumHeader.length) MUST equal the sum over all entries of: sizeof(ChecksumEntry) + entry.length.
Typical digest lengths:
Definition in file checksum.h.
| typedef struct ChecksumEntry ChecksumEntry |
| typedef struct ChecksumHeader ChecksumHeader |