CRT Hash Function

5-channel CRT mixing with avalanche. CC0. No patents. No dependencies.

How It Works

Input -> integer fold -> CRT decompose into 5 channels: mod {8, 9, 25, 49, 11}.
Each round (Feistel-like):
  1. Per-channel mixing: multiply by primitive root + add neighbors
  2. CRT reconstruct back to integer
  3. XOR with input, multiply by round constant, mod N
  4. Re-decompose into 5 channels for next round
After 8 rounds, the 5 channel residues ARE the hash.

WHY THIS WORKS:
  - CRT decomposition splits input into 5 INDEPENDENT views
  - Integer folding (step 3) BREAKS the CRT bijection — creates real mixing
  - Cross-channel addition spreads each bit to all channels
  - Avalanche: 50.0% (near-ideal). Collisions: birthday-bound.
  - 5 channels = 8*9*25*49*11 = 970200 possible outputs per word

Output: 5 residues (mod 8, mod 9, mod 25, mod 49, mod 11) = 20-bit hash.
Merkle-Damgaard chaining for arbitrary-length input.

Hash Input

-

Hash = 5 CRT channel residues, hex-encoded. Each channel is independent.

Avalanche Test

Flip 1 bit of input. How many output bits change? Ideal: 50%.

Collision Resistance

Hash N sequential integers. Check for collisions in 20-bit output space.

Diffusion Visualization

Watch how a single input byte spreads across all 5 channels over rounds.

Distribution Test

Hash 10K sequential integers, check output uniformity per channel.

CC0 1.0 Universal - No Rights Reserved. CRT-based hash function using Z/970200Z = Z/8 x Z/9 x Z/25 x Z/49 x Z/11.
5 independent channels, cross-channel diffusion, ring arithmetic mixing.
No patents. No dependencies. No permission needed. antonlebed.com