uhash_core/params.rs
1//! UniversalHash v4 Algorithm Parameters
2//!
3//! These parameters are tuned for democratic mining where phones
4//! can compete meaningfully with desktops (1:3-5 ratio).
5
6/// Number of parallel computation chains
7pub const CHAINS: usize = 4;
8
9/// Scratchpad size per chain in bytes (512 KB)
10pub const SCRATCHPAD_SIZE: usize = 512 * 1024;
11
12/// Total memory footprint (2 MB)
13pub const TOTAL_MEMORY: usize = CHAINS * SCRATCHPAD_SIZE;
14
15/// Number of rounds per chain (spec: 12,288)
16pub const ROUNDS: usize = 12_288;
17
18/// Block size in bytes for memory operations
19pub const BLOCK_SIZE: usize = 64;
20
21/// Number of blocks per scratchpad
22pub const BLOCKS_PER_SCRATCHPAD: usize = SCRATCHPAD_SIZE / BLOCK_SIZE;
23
24/// AES block size
25pub const AES_BLOCK_SIZE: usize = 16;
26
27/// SHA-256 output size
28pub const SHA256_SIZE: usize = 32;
29
30/// BLAKE3 output size
31pub const BLAKE3_SIZE: usize = 32;
32
33/// Algorithm version
34pub const VERSION: u8 = 4;