emit_sample_kat

command
v1.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 4, 2026 License: BSD-3-Clause Imports: 9 Imported by: 0

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL