Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HMV — Hyper-Modern Violet

HMV is an experimental hash-family extension of the Violet project. Where Violet explores a controller-driven cipher cascade, HMV carries the same design theme into a 1536-bit sponge permutation: an autonomous, coprime-period controller selects round constants and diffusion geometry.

Research software — do not deploy. HMV is a new construction, its security claims are design goals supported by the included analysis and formal artifacts, and it has not received independent cryptanalysis.

Design at a glance

The HMV state is an 8 × 24 byte matrix (1536 bits) over GF(2^8). A permutation applies sixteen rounds of:

A ← MixColumns(ShiftPlanes_t(SubBytes(A ⊕ K_t)))

MixColumns is an 8 × 8 circulant MDS matrix with branch number 9. ShiftPlanes_t is a controller-selected row transposition, and K_t is a controller-selected round constant. The controller combines a maximal-length 16-bit LFSR with a counter modulo 26, giving a period of 65,535 × 26 = 1,703,910 rounds. Its per-round offsets are constrained so that each input column spreads across eight distinct output columns.

The repository contains a readable Python reference, a C implementation, test and known-answer tooling, analysis scripts, a paper, and a Lean development.

hmv/hmv.py        Python reference implementation
src/              C implementation, self-test driver, and Makefile
analysis/         Parameter, diffusion, randomness, and generic experiments
figures/          Generated figures used below and by the paper
paper/            HMV paper and rendered PDF
lean/             Lean 4 formal development

Use

The Python reference uses only the standard library.

import sys

sys.path.insert(0, "hmv")
from hmv import hmv, hmv_mac, hmvx

digest = hmv(b"abc", 256)             # fixed-length digest
stream = hmvx(b"seed", 64)            # 64-byte XOF output
tag = hmv_mac(b"key", b"message", 256)

To build the C implementation, use a C11 compiler and make:

cd src
make
./hmv_test          # inverse-permutation check, streaming check, KATs, benchmark
./hmv_test kat      # known-answer output only
./hmv_test bench    # benchmark only

make also builds a constant-time configuration. The C and Python versions are intended to agree on the included test vectors.

Evidence and figures

The figures below are regenerated by the scripts in analysis/. They describe properties of this implementation and parameter set; they do not constitute a security proof. See the paper for methods and the lean/ directory for formal artifacts.

Primitive selection

S-box differential and Walsh profiles plus MDS-candidate search

Figure 1 — analysis/b0_parameters.py checks the selected S-box and diffusion layer. The differential distribution table peaks at four, the Walsh spectrum peaks at 32, and the search panel records the MDS candidates and their cost. The script also exhaustively checks the selected matrix's square subdeterminants.

Avalanche and diffusion

Avalanche growth, bit reach, and strict avalanche criterion

Figure 2 — analysis/b1_diffusion.py follows the effect of a one-bit input change. The first panel compares message and state diffusion by round, the second visualizes which state bytes are reached, and the histogram checks the per-output-bit flip probability against the strict-avalanche target of one half.

Statistical output checks

Test battery, p-value distribution, and byte uniformity

Figure 3 — analysis/b2_randomness.py runs a test battery over generated streams. It compares observed pass counts with an expected baseline, displays the p-value distribution, and plots byte-frequency deviations over the sampled output. These are sanity checks, not evidence that the output is random.

Generic-behaviour experiments

Truncated collisions, one-bit digest differences, and cost comparison

Figure 4 — analysis/b3_generic.py compares observed truncated collisions with birthday expectations, plots Hamming-weight changes caused by one flipped message bit, and records implementation cost measurements. The collision and avalanche results describe the sampled experiment rather than a full security reduction.

Reproduce the analysis

Run from the HMV/ directory after installing the root project's Python analysis dependencies:

python analysis/b0_parameters.py
python analysis/b1_diffusion.py
python analysis/b2_randomness.py
python analysis/b3_generic.py

The scripts refresh the files in figures/ and summaries in analysis/results/. They do not build or download Lean. If a Lean environment is already available, its independent build metadata is in lean/.

License

Released under the Apache License 2.0.

About

Experimental 1536-bit sponge hash family featuring a controller-driven permutation with machine-checked Lean 4 wide-trail proofs

Topics

Resources

Stars

Watchers

Forks

Contributors

Languages