1 | #ifndef _CHUNKLIST_H |
2 | #define _CHUNKLIST_H |
3 | |
4 | |
5 | #include <libkern/crypto/sha2.h> |
6 | |
7 | /* |
8 | * Chunklist file format |
9 | */ |
10 | |
11 | #define CHUNKLIST_MAGIC 0x4C4B4E43 |
12 | #define CHUNKLIST_FILE_VERSION_10 1 |
13 | #define CHUNKLIST_CHUNK_METHOD_10 1 |
14 | #define CHUNKLIST_SIGNATURE_METHOD_10 1 |
15 | #define CHUNKLIST_SIG_LEN 256 |
16 | #define CHUNKLIST_PUBKEY_LEN (2048/8) |
17 | |
18 | struct chunklist_hdr { |
19 | uint32_t cl_magic; |
20 | uint32_t ; |
21 | uint8_t cl_file_ver; |
22 | uint8_t cl_chunk_method; |
23 | uint8_t cl_sig_method; |
24 | uint8_t __unused1; |
25 | uint64_t cl_chunk_count; |
26 | uint64_t cl_chunk_offset; |
27 | uint64_t cl_sig_offset; |
28 | } __attribute__((packed)); |
29 | |
30 | struct chunklist_chunk { |
31 | uint32_t chunk_size; |
32 | uint8_t chunk_sha256[SHA256_DIGEST_LENGTH]; |
33 | } __attribute__((packed)); |
34 | |
35 | struct chunklist_sig { |
36 | uint8_t cl_sig[CHUNKLIST_SIG_LEN]; |
37 | }; |
38 | |
39 | |
40 | /* |
41 | * Chunklist signing public keys |
42 | */ |
43 | |
44 | struct chunklist_pubkey { |
45 | const bool isprod; |
46 | const uint8_t key[CHUNKLIST_PUBKEY_LEN]; |
47 | }; |
48 | |
49 | const struct chunklist_pubkey chunklist_pubkeys[] = { |
50 | |
51 | }; |
52 | |
53 | #define CHUNKLIST_NPUBKEYS (sizeof(chunklist_pubkeys)/sizeof(chunklist_pubkeys[0])) |
54 | |
55 | #endif |
56 | |