Documentation
¶
Overview ¶
Copyright (c) 2026 Lux Industries Inc. SPDX-License-Identifier: BSD-3-Clause
emit_sample_kat — produces the canonical cross-runtime KAT bundle for luxfi/math/sample. The C++ side at luxcpp/crypto/math/test/ sample_cross_runtime_test.cpp reads the same JSON, drives a byte- buffer reader with the recorded entropy, and asserts byte-equal sample output.
LP-107 Phase 6.5: Go emits → C++ verifies. Cross-runtime release gate for primitive distribution samplers.
Usage:
go run ./cmd/emit_sample_kat --out testdata/sample_kat.json
Each entry contains:
Test: "Uniform/q=PulsarQ/i=N" -> param: q
"Ternary/q=PulsarQ/density=0.50/i=N" -> param: q, density
"CenteredBinomial/q=PulsarQ/eta=2/i=N" -> param: q, eta
InputHex: raw entropy bytes (4096) from a SHA-256 hash chain
OutputHex: first 64 samples, packed little-endian (512 bytes)
Entropy bytes are deterministic from the test name + index seed so emit runs are byte-stable.
Click to show internal directories.
Click to hide internal directories.