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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
use *;
/// 8-byte binary magic signature identifying `.euvpak` virtual filesystem archives.
pub const EUVPAK_MAGIC: = *b"EUVPAK01";
/// Current `.euvpak` container format version.
pub const EUVPAK_FORMAT_VERSION: u32 = 1;
/// Mandatory 64-byte payload alignment for `.euvpak` entries.
pub const EUVPAK_ALIGNMENT_BYTES: usize = 64;
/// Fixed 64-byte cache-line-aligned container header length.
pub const EUVPAK_HEADER_BYTES: usize = 64;
/// Fixed 48-byte open-addressed hash table TOC bucket length.
pub const EUVPAK_TOC_BUCKET_BYTES: usize = 48;
/// Minimum power-of-two bucket count for the open-addressed TOC hash table.
pub const EUVPAK_MIN_TOC_BUCKETS: usize = 16;
/// Header flag bit indicating CRC32 integrity verification metadata is populated.
pub const EUVPAK_FLAG_CRC32_ENABLED: u32 = 1;
/// Compression tag indicating raw uncompressed payload bytes.
pub const EUVPAK_COMPRESSION_NONE: u8 = 0;
/// Compression tag indicating pure-Rust LZ4 block compression.
pub const EUVPAK_COMPRESSION_LZ4: u8 = 1;
/// Open-addressed TOC bucket sentinel marking an unoccupied slot.
pub const EUVPAK_BUCKET_EMPTY: u8 = 0;
/// Open-addressed TOC bucket sentinel marking an occupied slot.
pub const EUVPAK_BUCKET_OCCUPIED: u8 = 1;
/// FNV-1a 64-bit hash offset basis used for normalized virtual paths.
pub const EUVPAK_FNV1A_OFFSET: u64 = 0xcbf2_9ce4_8422_2325;
/// FNV-1a 64-bit hash prime multiplier used for normalized virtual paths.
pub const EUVPAK_FNV1A_PRIME: u64 = 0x0000_0100_0000_01b3;
/// Log2 size of the stack-allocated LZ4 4-byte match hash table (`4096` slots).
pub const LZ4_HASH_LOG: usize = 12;
/// Entry count of the stack-allocated LZ4 4-byte match hash table.
pub const LZ4_HASH_SIZE: usize = 1 << LZ4_HASH_LOG;
/// Minimum LZ4 back-reference match length in bytes.
pub const LZ4_MIN_MATCH: usize = 4;
/// Mandatory trailing uncompressed literal run reserved by the LZ4 block format.
pub const LZ4_LAST_LITERALS: usize = 5;
/// Minimum input length required before searching for LZ4 matches.
pub const LZ4_MF_LIMIT: usize = 12;
/// Maximum LZ4 backward match offset in bytes (`65535`).
pub const LZ4_MAX_DISTANCE: usize = 65_535;
/// Knuth multiplicative hash constant used for 4-byte LZ4 sequence hashing.
pub const LZ4_HASH_MULTIPLIER: u32 = 2_654_435_761;
/// IEEE 802.3 CRC32 reversed polynomial.
pub const EUVPAK_CRC32_POLY: u32 = 0xEDB8_8320;
/// Compile-time 4x256 slice-by-4 IEEE 802.3 CRC32 lookup tables for high-throughput integrity checks.
pub const EUVPAK_CRC32_TABLES: = build_euvpak_crc32_tables;
/// Error returned when an `.euvpak` buffer is too short, misaligned, or fails structural validation.
pub const ERR_EUVPAK_INVALID_ARCHIVE: &str = "euvpak: invalid or truncated archive";
/// Error returned when an `.euvpak` header, TOC, or entry fails CRC32 integrity verification.
pub const ERR_EUVPAK_CRC_MISMATCH: &str = "euvpak: integrity CRC32 checksum mismatch";
/// Error returned when an entry hash or virtual path does not exist inside the archive.
pub const ERR_EUVPAK_ENTRY_NOT_FOUND: &str = "euvpak: requested entry not found";
/// Error returned when an LZ4 compressed payload violates block framing or offset bounds.
pub const ERR_EUVPAK_LZ4_CORRUPT: &str = "euvpak: corrupted LZ4 compressed block";
/// Error returned when an LZ4 decoded output length does not match expected uncompressed size.
pub const ERR_EUVPAK_LZ4_SIZE_MISMATCH: &str = "euvpak: LZ4 decoded length mismatch";