Loading...
Searching...
No Matches
checksum.h
Go to the documentation of this file.
/*
* This file is part of the Aaru Data Preservation Suite.
* Copyright (c) 2019-2026 Natalia Portillo.
*
* This library is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2.1 of the
* License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
#ifndef LIBAARUFORMAT_CHECKSUM_H
#define LIBAARUFORMAT_CHECKSUM_H
#include <stdint.h> // Fixed-width integer types for on-disk structures.
#pragma pack(push, 1)
typedef struct ChecksumHeader
{
uint32_t identifier;
uint32_t length;
uint8_t entries;
} ChecksumHeader;
typedef struct ChecksumEntry
{
uint8_t type;
uint32_t length;
} ChecksumEntry;
#pragma pack(pop)
#endif // LIBAARUFORMAT_CHECKSUM_H
ChecksumEntry
Per-checksum metadata immediately followed by the digest / signature bytes.
Definition checksum.h:91
ChecksumEntry::length
uint32_t length
Length in bytes of the digest that immediately follows this structure.
Definition checksum.h:93
ChecksumEntry::type
uint8_t type
Algorithm used (value from ChecksumAlgorithm).
Definition checksum.h:92
ChecksumHeader
Header that precedes the sequence of checksum entries for a checksum block.
Definition checksum.h:74
ChecksumHeader::identifier
uint32_t identifier
Block identifier, must be BlockType::ChecksumBlock.
Definition checksum.h:75
ChecksumHeader::length
uint32_t length
Length in bytes of the payload (all entries + their digest data, excluding this header).
Definition checksum.h:76
ChecksumHeader::entries
uint8_t entries
Number of checksum entries that follow in the payload.
Definition checksum.h:77