46#define PEERDIST_INFO_V1 0x0100
49#define PEERDIST_INFO_V2 0x0200
97#define PEERDIST_INFO_V1_HASH_SHA256 0x0000800cUL
100#define PEERDIST_INFO_V1_HASH_SHA384 0x0000800dUL
103#define PEERDIST_INFO_V1_HASH_SHA512 0x0000800eUL
146#define peerdist_info_v1_segment_t( digestsize ) \
148 struct peerdist_info_v1_segment segment; \
149 uint8_t hash[digestsize]; \
150 uint8_t secret[digestsize]; \
151 } __attribute__ (( packed ))
179#define peerdist_info_v1_block_t( digestsize, blocks ) \
181 struct peerdist_info_v1_block block; \
182 uint8_t hash[blocks][digestsize]; \
183 } __attribute__ (( packed ))
225#define PEERDIST_INFO_V2_HASH_SHA512_TRUNC 0x04
250#define peerdist_info_v2_chunk_t( digestsize ) \
252 struct peerdist_info_v2_chunk chunk; \
253 peerdist_info_v2_segment_t ( digestsize ) segment[0]; \
254 } __attribute__ (( packed ))
257#define PEERDIST_INFO_V2_CHUNK_TYPE 0x00
280#define peerdist_info_v2_segment_t( digestsize ) \
282 struct peerdist_info_v2_segment segment; \
283 uint8_t hash[digestsize]; \
284 uint8_t secret[digestsize]; \
285 } __attribute__ (( packed ))
298#define PEERDIST_DIGEST_MAX_SIZE 64
391#define PEERDIST_SEGMENT_ID_MAGIC L"MS_P2P_CACHING"
442 unsigned int index );
445 unsigned int index );
unsigned long long uint64_t
uint8_t data[48]
Additional event data.
#define FILE_LICENCE(_licence)
Declare a particular licence as applying to a file.
#define FILE_SECBOOT(_status)
Declare a file's UEFI Secure Boot permission status.
uint16_t segment
Code segment.
uint8_t block[3][8]
DES-encrypted blocks.
int peerdist_info_segment(const struct peerdist_info *info, struct peerdist_info_segment *segment, unsigned int index)
Populate content information segment.
int peerdist_info_block(const struct peerdist_info_segment *segment, struct peerdist_info_block *block, unsigned int index)
Populate content information block.
#define PEERDIST_DIGEST_MAX_SIZE
Maximum digest size for any supported algorithm.
struct digest_algorithm sha512_trunc_algorithm
int peerdist_info(const void *data, size_t len, struct peerdist_info *info)
Populate content information.
A message digest algorithm.
A content information block.
struct peerdist_range range
Content range.
unsigned int index
Block index.
struct peerdist_range trim
Trimmed content range.
const struct peerdist_info_segment * segment
Content information segment.
uint8_t hash[PEERDIST_DIGEST_MAX_SIZE]
Block hash.
Content information operations.
int(* info)(struct peerdist_info *info)
Populate content information.
int(* segment)(struct peerdist_info_segment *segment)
Populate content information segment.
int(* block)(struct peerdist_info_block *block)
Populate content information block.
A content information segment.
unsigned int blocks
Number of blocks within this segment.
size_t blksize
Block size.
const struct peerdist_info * info
Content information.
unsigned int index
Segment index.
uint8_t hash[PEERDIST_DIGEST_MAX_SIZE]
Segment hash of data.
uint8_t secret[PEERDIST_DIGEST_MAX_SIZE]
Segment secret.
struct peerdist_range range
Content range.
Content Information version 1 block description header.
uint32_t blocks
Number of blocks within the block description.
Content Information version 1 segment description header.
uint32_t blksize
Block size for this segment.
uint64_t offset
Offset of this segment within the content.
uint32_t len
Length of this segment.
Content Information version 1 data structure header.
union peerdist_info_version version
Version number.
uint32_t segments
Number of segments within the content information.
uint32_t last
Length to read in last segment, or zero.
uint32_t hash
Hash algorithm.
uint32_t first
Length to skip in first segment.
Content Information version 2 chunk description header.
uint32_t len
Chunk data length.
Content Information version 2 segment description header.
uint32_t len
Segment length.
Content Information version 2 data structure header.
uint64_t offset
Offset of the first segment within the content.
union peerdist_info_version version
Version number.
uint64_t index
Index of the first segment within the content.
uint8_t hash
Hash algorithm.
uint32_t first
Length to skip in first segment.
uint64_t len
Length of content range, or zero.
size_t digestsize
Digest size.
unsigned int segments
Number of segments within the content information.
struct peerdist_info_operations * op
Content information operations.
struct digest_algorithm * digest
Digest algorithm.
struct peerdist_range range
Content range.
struct peerdist_range trim
Trimmed content range.
struct peerdist_raw raw
Raw content information.
size_t start
Start offset.
const void * data
Data buffer.
size_t len
Length of data buffer.
Content Information version number.
uint16_t raw
Raw version number.
uint8_t minor
Minor version number.
uint8_t major
Major version number.