emit_sample_kat

command
v1.5.1 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2026 License: BSD-3-Clause Imports: 9 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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