-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.txt
51 lines (39 loc) · 1.21 KB
/
main.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
[ VERSION: 30 ]
// RESOURCE: https://www.cs.uic.edu/~jbell/CourseNotes/OperatingSystems/12_FileSystemImplementation.html
CONST MAGIC_LENGTH => 5;
CONST SIGNATURE_LENGTH => ed25519_dalek::SIGNATURE_LENGTH = 64;
<-- HEADER -->
MAGIC: [u8; MAGIC_LENGTH] | str
FLAGS: [u8;4] | u32
0-15 => RESERVED
7 => MUTABLE_REGISTRY
16-31 => ALL BITS HERE ARE FAIR GAME
ARCHIVE_VERSION: [u8;2] | u16
CAPACITY: [u8;2] | u16
FLAGS: [u8;4] | u32, SPECIFIES;
1 => HAS_SIGNATURES
2-15 => CUSTOM_DATA
<-- REGISTRY -->
ENTRIES: (x) * HEADER::CAPACITY
FLAGS: [u8;4] | u32, SPECIFIES;
0-8 => RESERVED
1 => IS_COMPRESSED
2-3 => COMPRESSION_ALGORITHM_USED
4 => IS_SIGNED
5 => <UNUSED>
6 => IS_ENCRYPTED
CONTENT_VERSION: [u8;1] | u8
(INDEX|LOCATION): [u8;8] | u64
(LENGTH|BYTE_OFFSET): [u8;8] | u64 ( SIZE OF BINARY DATA IN BYTES )
ID_LENGTH: [u8;2] | u16
# THE SIGNATURE IS ONLY PRESENT IF GLOBAL:: HAS_SIGNATURES == TRUE, UNIMPLEMENTED
SIGNATURE: [u8; SIGNATURE_LENGTH]
ID_GLOB: [u8; INFINITE] | MASSIVE
<-- ( BINARY GLOB ) -->
INCLUDES:
BINARY_DATA
// LAYERS -> ? OPTIONAL LAYERS
- SOURCE, ORIGINAL DATA
? COMPRESSION, SOURCE IS COMPRESSED
? ENCRYPTION, COMPRESSED DATA IS ENCRYPTED
? SIGNING, LAST ENDPOINT IS SIGNED